diff options
| author | Marshall Clow <mclow.lists@gmail.com> | 2018-02-08 06:34:03 +0000 |
|---|---|---|
| committer | Marshall Clow <mclow.lists@gmail.com> | 2018-02-08 06:34:03 +0000 |
| commit | 6d9f750dec29e8ae5366092e64cd343dae2c7464 (patch) | |
| tree | 288a03e39b1efbedbf9aefab43d1a7ba5606ff7a /libcxx/include/string | |
| parent | c19aed963e9eb4986f3c6cbec1bf08e63d56a367 (diff) | |
| download | bcm5719-llvm-6d9f750dec29e8ae5366092e64cd343dae2c7464.tar.gz bcm5719-llvm-6d9f750dec29e8ae5366092e64cd343dae2c7464.zip | |
Implement deduction guide for basic_string as described in P0433
llvm-svn: 324569
Diffstat (limited to 'libcxx/include/string')
| -rw-r--r-- | libcxx/include/string | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/libcxx/include/string b/libcxx/include/string index f89ef5741e5..e8ec709c25a 100644 --- a/libcxx/include/string +++ b/libcxx/include/string @@ -311,6 +311,13 @@ public: bool __invariants() const; }; +template<class InputIterator, + class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>> +basic_string(InputIterator, InputIterator, Allocator = Allocator()) + -> basic_string<typename iterator_traits<InputIterator>::value_type, + char_traits<typename iterator_traits<InputIterator>::value_type>, + Allocator>; // C++17 + template<class charT, class traits, class Allocator> basic_string<charT, traits, Allocator> operator+(const basic_string<charT, traits, Allocator>& lhs, @@ -1485,6 +1492,18 @@ private: friend basic_string operator+<>(const basic_string&, value_type); }; +#ifndef _LIBCPP_HAS_NO_DEDUCTION_GUIDES +template<class _InputIterator, + class _CharT = typename iterator_traits<_InputIterator>::value_type, + class _Allocator = allocator<_CharT>, + class = typename enable_if<__is_input_iterator<_InputIterator>::value, void>::type, + class = typename enable_if<__is_allocator<_Allocator>::value, void>::type + > +basic_string(_InputIterator, _InputIterator, _Allocator = _Allocator()) + -> basic_string<_CharT, char_traits<_CharT>, _Allocator>; +#endif + + template <class _CharT, class _Traits, class _Allocator> inline _LIBCPP_INLINE_VISIBILITY void |

