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 // UNSUPPORTED: c++98, c++03 11 12 // <string> 13 14 // basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<charT> il); 15 16 #include <string> 17 #include <cassert> 18 19 #include "min_allocator.h" 20 21 int main() 22 { 23 { 24 std::string s("123def456"); 25 s.replace(s.cbegin() + 3, s.cbegin() + 6, {'a', 'b', 'c'}); 26 assert(s == "123abc456"); 27 } 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 } 35