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 // UNSUPPORTED: c++98, c++03 12 13 // <experimental/forward_list> 14 15 // namespace std { namespace experimental { namespace pmr { 16 // template <class T> 17 // using forward_list = 18 // ::std::forward_list<T, polymorphic_allocator<T>> 19 // 20 // }}} // namespace std::experimental::pmr 21 22 #include <experimental/forward_list> 23 #include <experimental/memory_resource> 24 #include <type_traits> 25 #include <cassert> 26 27 namespace pmr = std::experimental::pmr; 28 29 int main() 30 { 31 using StdForwardList = std::forward_list<int, pmr::polymorphic_allocator<int>>; 32 using PmrForwardList = pmr::forward_list<int>; 33 static_assert(std::is_same<StdForwardList, PmrForwardList>::value, ""); 34 PmrForwardList d; 35 assert(d.get_allocator().resource() == pmr::get_default_resource()); 36 } 37