Eric Fiselier | dba23b4 | 2016-05-07 03:09:55 +0000 | [diff] [blame] | 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/vector> |
| 14 | |
| 15 | // namespace std { namespace experimental { namespace pmr { |
| 16 | // template <class T> |
| 17 | // using vector = |
| 18 | // ::std::vector<T, polymorphic_allocator<T>> |
| 19 | // |
| 20 | // }}} // namespace std::experimental::pmr |
| 21 | |
| 22 | #include <experimental/vector> |
| 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 StdVector = std::vector<int, pmr::polymorphic_allocator<int>>; |
| 32 | using PmrVector = pmr::vector<int>; |
| 33 | static_assert(std::is_same<StdVector, PmrVector>::value, ""); |
| 34 | PmrVector d; |
| 35 | assert(d.get_allocator().resource() == pmr::get_default_resource()); |
| 36 | } |