1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // template <class Alloc>
13 // struct allocator_traits
15 // static allocator_type
16 // select_on_container_copy_construction(const allocator_type& a);
22 #include <type_traits>
25 #include "test_macros.h"
32 explicit A(int i = 0) : id(i) {}
42 explicit B(int i = 0) : id(i) {}
44 B select_on_container_copy_construction() const
54 assert(std::allocator_traits<A<int> >::select_on_container_copy_construction(a).id == 0);
58 assert(std::allocator_traits<A<int> >::select_on_container_copy_construction(a).id == 0);
60 #if TEST_STD_VER >= 11
63 assert(std::allocator_traits<B<int> >::select_on_container_copy_construction(b).id == 100);
67 assert(std::allocator_traits<B<int> >::select_on_container_copy_construction(b).id == 100);