Home | History | Annotate | Download | only in memory.resource.aliases
      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/list>
     15 
     16 // namespace std { namespace experimental { namespace pmr {
     17 // template <class T>
     18 // using list =
     19 //     ::std::list<T, polymorphic_allocator<T>>
     20 //
     21 // }}} // namespace std::experimental::pmr
     22 
     23 #include <experimental/list>
     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 StdList = std::list<int, pmr::polymorphic_allocator<int>>;
     33     using PmrList = pmr::list<int>;
     34     static_assert(std::is_same<StdList, PmrList>::value, "");
     35     PmrList d;
     36     assert(d.get_allocator().resource() == pmr::get_default_resource());
     37 }
     38