Home | History | Annotate | Download | only in allocator.adaptor.members
      1 //===----------------------------------------------------------------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is dual licensed under the MIT and the University of Illinois Open
      6 // Source Licenses. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 // UNSUPPORTED: c++98, c++03
     11 
     12 // <memory>
     13 
     14 // template <class OuterAlloc, class... InnerAllocs>
     15 //   class scoped_allocator_adaptor
     16 
     17 // size_type max_size() const;
     18 
     19 #include <scoped_allocator>
     20 #include <cassert>
     21 
     22 #include "allocators.h"
     23 
     24 int main()
     25 {
     26     {
     27         typedef std::scoped_allocator_adaptor<A1<int>> A;
     28         const A a(A1<int>(100));
     29         assert(a.max_size() == 100);
     30     }
     31     {
     32         typedef std::scoped_allocator_adaptor<A1<int>, A2<int>> A;
     33         const A a(A1<int>(20), A2<int>());
     34         assert(a.max_size() == 20);
     35     }
     36     {
     37         typedef std::scoped_allocator_adaptor<A1<int>, A2<int>, A3<int>> A;
     38         const A a(A1<int>(200), A2<int>(), A3<int>());
     39         assert(a.max_size() == 200);
     40     }
     41 
     42 }
     43