class Traits,
class Alloc = std::allocator<CharT> >
explicit basic_string( std::basic_string_view<CharT, Traits>,
const Alloc& = Alloc() )
class Traits,
class Alloc = std::allocator<CharT> >
basic_string( std::basic_string_view<CharT, Traits>,
typename /* see below */::size_type,
typename /* see below */::size_type,
const Alloc& = Alloc() )
3) The size_type
parameter type refers to the nested type size_type
of the type deduced by the deduction guide.
Note: the extent to which the library determines that a type does not satisfy LegacyInputIterator is unspecified, except that as a minimum integral types do not qualify as input iterators. Likewise, the extent to which it determines that a type does not satisfy Allocator is unspecified, except that as a minimum the member type Alloc::value_type
must exist and the expression std::declval<Alloc&>().allocate(std::size_t{}) must be well-formed when treated as an unevaluated operand.
Guides (2,3) are needed because the std::basic_string constructors for std::basic_string_views are made templates to avoid causing ambiguities in existing code, and those templates do not support class template argument deduction.
[edit] Notes [edit] Example [edit] Defect reportsThe following behavior-changing defect reports were applied retroactively to previously published C++ standards.
DR Applied to Behavior as published Correct behavior LWG 3075 C++17 deduction frombasic_string_view
was unsupported
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4