1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8
9 // UNSUPPORTED: c++03
10
11 // <string>
12
13 // basic_string& replace(const_iterator i1, const_iterator i2, initializer_list<charT> il);
14
15 #include <string>
16 #include <cassert>
17
18 #include "test_macros.h"
19 #include "min_allocator.h"
20
main(int,char **)21 int main(int, char**)
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 return 0;
36 }
37