1 //===----------------------------------------------------------------------===// 2 // 3 // The LLVM Compiler Infrastructure 4 // 5 // This file is dual licensed under the MIT and the University of Illinois Open 6 // Source Licenses. See LICENSE.TXT for details. 7 // 8 //===----------------------------------------------------------------------===// 9 10 // <string> 11 12 // basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<charT> il); 13 14 #include <string> 15 #include <cassert> 16 17 #include "../../min_allocator.h" 18 19 int main() 20 { 21 #ifndef _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 22 { 23 std::string s("123def456"); 24 s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'}); 25 assert(s == "123abc456"); 26 } 27 #if __cplusplus >= 201103L 28 { 29 typedef std::basic_string<char, std::char_traits<char>, min_allocator<char>> S; 30 S s("123def456"); 31 s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'}); 32 assert(s == "123abc456"); 33 } 34 #endif 35 #endif // _LIBCPP_HAS_NO_GENERALIZED_INITIALIZERS 36 } 37