summaryrefslogtreecommitdiffstats
path: root/test/strings/basic.string/string.modifiers/string::insert/iter_initializer_list.pass.cpp
blob: e4727df1572bf688225a89c85cea9941ccef31f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
//===----------------------------------------------------------------------===//
//
//                     The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//

// <string>

// iterator insert(const_iterator p, initializer_list<charT> il);

#include <string>
#include <cassert>

int main()
{
#ifdef _LIBCPP_MOVE
    {
        std::string s("123456");
        std::string::iterator i = s.insert(s.begin() + 3, {'a', 'b', 'c'});
        assert(i - s.begin() == 3);
        assert(s == "123abc456");
    }
#endif
}