deduction guides for std::basic_string
Defined in header <string>
|
||
template< class InputIt, class Alloc = std::allocator<typename std::iterator_traits |
(1) | (since C++17) |
template< class CharT, class Traits, |
(2) | (since C++17) |
template< class CharT, class Traits, |
(3) | (since C++17) |
template< ranges::input_range R, class Alloc = std::allocator<ranges::range_value_t<R>> > |
(4) | (since C++23) |
InputIt
satisfies LegacyInputIterator and Alloc
satisfies Allocator.Alloc
satisfies Allocator.size_type
parameter type refers to the nested type size_type
of the type deduced by the deduction guide.input_range
.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.
Contents |
[edit] Notes
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
Feature-test macro | Value | Std | Feature |
---|---|---|---|