Loading [MathJax]/extensions/tex2jax.js
https://mooseframework.inl.gov
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends
Typedefs | Functions | Variables
InfixIterator.h File Reference

Go to the source code of this file.

Typedefs

typedef charT char_type
 
typedef traits traits_type
 
typedef std::basic_ostream< charT, traits > ostream_type
 

Functions

template<class T , class charT = char, class traits = std::char_traits<charT>>
class infix_ostream_iterator if defined (__GNUC__) &&!defined(__clang__) &&(__GNUC__<
 GCC9 currently hits a "no type named 'value_type'" error during build if this is removed and iterator traits are listed within the class corresponding to the C++17 standard. More...
 
 infix_ostream_iterator (ostream_type &s)
 
 infix_ostream_iterator (ostream_type &s, charT const *d, bool first=true)
 
infix_ostream_iterator< T, charT, traits > & operator= (T const &item)
 
infix_ostream_iterator< T, charT, traits > & operator* ()
 
infix_ostream_iterator< T, charT, traits > & operator++ ()
 
infix_ostream_iterator< T, charT, traits > & operator++ (int)
 

Variables

class infix_ostream_iterator if void
 
std::basic_ostream< charT, traits > * os
 
charT const * delimiter
 
bool first_elem
 

Typedef Documentation

◆ char_type

typedef charT char_type

Definition at line 38 of file InfixIterator.h.

◆ ostream_type

typedef std::basic_ostream<charT, traits> ostream_type

Definition at line 40 of file InfixIterator.h.

◆ traits_type

typedef traits traits_type

Definition at line 39 of file InfixIterator.h.

Function Documentation

◆ defined()

template<class T , class charT = char, class traits = std::char_traits<charT>>
class infix_ostream_iterator if defined ( __GNUC__  ) &&

GCC9 currently hits a "no type named 'value_type'" error during build if this is removed and iterator traits are listed within the class corresponding to the C++17 standard.

This preserves use of std::iterator for GCC9 and earlier.

◆ infix_ostream_iterator() [1/2]

infix_ostream_iterator ( ostream_type s)

Definition at line 41 of file InfixIterator.h.

41 : os(&s), delimiter(0), first_elem(true) {}
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33
bool first_elem
Definition: InfixIterator.h:35
charT const * delimiter
Definition: InfixIterator.h:34

◆ infix_ostream_iterator() [2/2]

infix_ostream_iterator ( ostream_type s,
charT const *  d,
bool  first = true 
)

Definition at line 42 of file InfixIterator.h.

43  : os(&s), delimiter(d), first_elem(first)
44  {
45  }
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33
bool first_elem
Definition: InfixIterator.h:35
charT const * delimiter
Definition: InfixIterator.h:34

◆ operator*()

infix_ostream_iterator<T, charT, traits>& operator* ( )

◆ operator++() [1/2]

infix_ostream_iterator<T, charT, traits>& operator++ ( )

Definition at line 57 of file InfixIterator.h.

57 { return *this; }

◆ operator++() [2/2]

infix_ostream_iterator<T, charT, traits>& operator++ ( int  )

Definition at line 58 of file InfixIterator.h.

58 { return *this; }

◆ operator=()

infix_ostream_iterator<T, charT, traits>& operator= ( T const &  item)

Definition at line 46 of file InfixIterator.h.

Referenced by InputParameters::InputParameters(), and InputParameters::operator=().

47  {
48  // Here's the only real change from ostream_iterator:
49  // Normally, the '*os << item;' would come before the 'if'.
50  if (!first_elem && delimiter != 0)
51  *os << delimiter;
52  *os << item;
53  first_elem = false;
54  return *this;
55  }
std::basic_ostream< charT, traits > * os
Definition: InfixIterator.h:33
bool first_elem
Definition: InfixIterator.h:35
charT const * delimiter
Definition: InfixIterator.h:34

Variable Documentation

◆ delimiter

charT const* delimiter

◆ first_elem

bool first_elem

Definition at line 35 of file InfixIterator.h.

Referenced by Moose::elementsIntersectedByLine(), and operator=().

◆ os

std::basic_ostream<charT, traits>* os

◆ void

Initial value:
{
#if defined(__clang__) || (__GNUC__ > 9)
using iterator_category = std::output_iterator_tag

Definition at line 26 of file InfixIterator.h.

Referenced by InputParameters::addCommandLineParamHelper(), MooseApp::loadLibraryAndDependencies(), Executor::Result::pass(), RestartableDataReader::readHeader(), and CompileTimeDerivativesMaterialInternal::details::zeroes().