Where is the definition of libc ++ ios_base :: clear?

In the libC ++ header <ios>, available for viewing here:

https://github.com/llvm-mirror/libcxx/blob/master/include/ios

There are two ads class ios_base, "version libcpp" has a method clear, ios_base::clear()and the other - no. This is a public method and is not described here:

http://en.cppreference.com/w/cpp/io/ios_base

Also, in the implementation mentioned above, it basic_ios::clear()calls ios_base::clear(), but it does not seem to be defined anywhere. In libstdC ++, it is implemented, as can be seen here:

http://repo.or.cz/w/official-gcc.git/blob/HEAD:/libstdc%2B%2B-v3/include/bits/basic_ios.tcc

So my questions are:

1) why is there a public method ios_base::clear()in libC ++?

2), where can I find how it basic_ios::clear()is implemented in libC ++?

+3
source share
1 answer

I think you can blame me for this.

I found that throwing an exception is nothing but the size of the code. And so I would like to outline functions that, when possible, fall into the sources.

basic_ios::clear()it must sometimes throw an exception and is also a template class. If I remember correctly, it irritated me, because rdstateobviously does not depend on a template parameter basic_ios: CharT, Traits. So I implemented rdstatein the base class ( ios_base), so that any related non-intensive code could be used by all instances basic_ios.

style , ios_base::clear() src/ios.cpp. protected ios_base, basic_ios::clear() - .

: "" - .

+1

All Articles