header_vector_synop.pass.cpp (1093B)
1 // -*- C++ -*- 2 //===----------------------------------------------------------------------===// 3 // 4 // The LLVM Compiler Infrastructure 5 // 6 // This file is dual licensed under the MIT and the University of Illinois Open 7 // Source Licenses. See LICENSE.TXT for details. 8 // 9 //===----------------------------------------------------------------------===// 10 11 // REQUIRES: c++experimental 12 // UNSUPPORTED: c++98, c++03 13 14 // <experimental/vector> 15 16 // namespace std { namespace experimental { namespace pmr { 17 // template <class T> 18 // using vector = 19 // ::std::vector<T, polymorphic_allocator<T>> 20 // 21 // }}} // namespace std::experimental::pmr 22 23 #include <experimental/vector> 24 #include <experimental/memory_resource> 25 #include <type_traits> 26 #include <cassert> 27 28 namespace pmr = std::experimental::pmr; 29 30 int main() 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 }