1 // -*- C++ -*- 2 //===----------------------------------------------------------------------===// 3 // 4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 5 // See https://llvm.org/LICENSE.txt for license information. 6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 7 // 8 //===----------------------------------------------------------------------===// 9 10 // UNSUPPORTED: c++03 11 12 // <experimental/vector> 13 14 // namespace std { namespace experimental { namespace pmr { 15 // template <class T> 16 // using vector = 17 // ::std::vector<T, polymorphic_allocator<T>> 18 // 19 // }}} // namespace std::experimental::pmr 20 21 #include <experimental/vector> 22 #include <experimental/memory_resource> 23 #include <type_traits> 24 #include <cassert> 25 26 #include "test_macros.h" 27 28 namespace pmr = std::experimental::pmr; 29 main(int,char **)30int main(int, char**) 31 { 32 using StdVector = std::vector<int, pmr::polymorphic_allocator<int>>; 33 using PmrVector = pmr::vector<int>; 34 static_assert(std::is_same<StdVector, PmrVector>::value, ""); 35 PmrVector d; 36 assert(d.get_allocator().resource() == pmr::get_default_resource()); 37 38 return 0; 39 } 40