| 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, c++11, c++14 |
| 10 | |
| 11 | // <iterator> |
| 12 | |
| 13 | // back_insert_iterator |
| 14 | |
| 15 | // Make sure that the implicitly-generated CTAD works. |
| 16 | |
| 17 | #include <iterator> |
| 18 | #include <string> |
| 19 | #include <vector> |
| 20 | |
| 21 | #include "test_macros.h" |
| 22 | |
| 23 | int main(int, char**) { |
| 24 | { |
| 25 | std::string s; |
| 26 | std::back_insert_iterator it(s); |
| 27 | ASSERT_SAME_TYPE(decltype(it), std::back_insert_iterator<std::string>); |
| 28 | } |
| 29 | { |
| 30 | std::vector<int> v; |
| 31 | std::back_insert_iterator it(v); |
| 32 | std::back_insert_iterator copy(it); |
| 33 | ASSERT_SAME_TYPE(decltype(it), std::back_insert_iterator<std::vector<int>>); |
| 34 | ASSERT_SAME_TYPE(decltype(copy), std::back_insert_iterator<std::vector<int>>); |
| 35 | } |
| 36 | |
| 37 | return 0; |
| 38 | } |
| 39 | |