Search code examples
c++classiostreamdefinitiontemplate-classes

Definition of different States of Streams (C++)


I know that ios_base has a declaration of states for streams like
ios_base::goodbit(error state)
ios_base::ate(file open mode state)
and many more.
What I'm interested in knowing is the definition of these member functions of ios_base
Are they a simple class or a class template? How are they implemented? Which one is there parent class(if any)?


Solution

  • Are they a simple class or a class template?

    They are actually static constexpr declarations nested in the std::ios_base class (as from the reference documentation):

    enter image description here

    How are they implemented? Which one is there parent class(if any)?

    As mentioned there, it's compiler implementation specific. Usually these are simple values without usage of a parent class.