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

source code of libcxx/test/std/iterators/predef.iterators/insert.iterators/front.insert.iterator/implicit_ctad.pass.cpp