Implementation of String(const char* s) Constructor

Could I get some help finding the definition of the constructor string(const char* s) in <string>?
http://en.cppreference.com/w/cpp/string/basic_string/basic_string

std::string is just a typedef of one of the template instantiations.
That doesn't answer my question. If you must insist, explain instead how std::basic_string implements the constructor.
That's a good start, but it's nary impossible to find the constructor despite how ordered it is.
Look for argument type: const _CharT* you will find declaration on line 449. But no definition. Well, look, those member names are hyperlinks, wonder where they'll lead us: https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.0/classstd_1_1basic__string.html#std_1_1basic__stringa22
Looking through signatures, we can find one we need:
basic_string ( const _CharT* _s, const _Alloc & _a = _Alloc() )

Definition at line 225 of file basic_string.tcc.
basic_string.tcc is a hyperlink we can use to reques implementation file: https://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.0/basic__string_8tcc-source.html

Here is implementation:
1
2
3
4
5
6
template<typename _CharT, typename _Traits, typename _Alloc>
     basic_string<_CharT, _Traits, _Alloc>::
     basic_string(const _CharT* __s, const _Alloc& __a)
     : _M_dataplus(_S_construct(__s, __s ? __s + traits_type::length(__s) :
                    __s + npos, __a), __a)
     { }
Topic archived. No new replies allowed.