Where is the class std :: out_of_range fully defined?

I am looking under /usr/include/c++ on my Ubuntu Linux. In /usr/include/c++/stdexcept I found the following:

 class out_of_range : public logic_error { public: explicit out_of_range(const string& __arg); }; 

But I can not find the definition of out_of_range() constructors out_of_range() .

Also, when the STL throws an out_of_range() exception, it uses (an example taken from stl_vector.h ):

 __throw_out_of_range(__N("vector::_M_range_check")); 

And the only thing I can find for __throw_out_of_range() :

 void __throw_out_of_range(const char*) __attribute__((__noreturn__)); 

Could you tell me where the definitions of the out_of_range class out_of_range ?

+6
source share
4 answers

They are probably defined in libstdc++ . You can get the source code on the GCC website. On Ubuntu distributions, you have the library ( libstdc++.so ) installed, not the source code. You only found ads, not definitions.

+3
source

std::out_of_range fully defined in ยง19.2.5. The out_of_range [out.of.range] class is C ++ 11 standard.

+1
source

Those are in libstdc++ , which is built as part of gcc . You can download gcc-core-XYZtar.bz2 and find it there.

0
source

here you go

http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-3.4/stdexcept_8cc-source.html

remember that libstdC ++ is no longer distributed as a separate library, but the source of the library is actually linked to gcc, so to download libstdC ++ you need to download gcc.

0
source

Source: https://habr.com/ru/post/950143/


All Articles