Home | History | Annotate | Download | only in list.cons
      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 // <list>
     11 
     12 // explicit list(const Alloc& = Alloc());
     13 
     14 #include <list>
     15 #include <cassert>
     16 #include "DefaultOnly.h"
     17 #include "min_allocator.h"
     18 
     19 int main()
     20 {
     21     {
     22         std::list<int> l;
     23         assert(l.size() == 0);
     24         assert(std::distance(l.begin(), l.end()) == 0);
     25     }
     26     {
     27         std::list<DefaultOnly> l;
     28         assert(l.size() == 0);
     29         assert(std::distance(l.begin(), l.end()) == 0);
     30     }
     31     {
     32         std::list<int> l((std::allocator<int>()));
     33         assert(l.size() == 0);
     34         assert(std::distance(l.begin(), l.end()) == 0);
     35     }
     36 #if TEST_STD_VER >= 11
     37     {
     38         std::list<int, min_allocator<int>> l;
     39         assert(l.size() == 0);
     40         assert(std::distance(l.begin(), l.end()) == 0);
     41     }
     42     {
     43         std::list<DefaultOnly, min_allocator<DefaultOnly>> l;
     44         assert(l.size() == 0);
     45         assert(std::distance(l.begin(), l.end()) == 0);
     46     }
     47     {
     48         std::list<int, min_allocator<int>> l((min_allocator<int>()));
     49         assert(l.size() == 0);
     50         assert(std::distance(l.begin(), l.end()) == 0);
     51     }
     52     {
     53         std::list<int> l = {};
     54         assert(l.size() == 0);
     55         assert(std::distance(l.begin(), l.end()) == 0);
     56     }
     57     {
     58         std::list<int, explicit_allocator<int>> l;
     59         assert(l.size() == 0);
     60         assert(std::distance(l.begin(), l.end()) == 0);
     61     }
     62     {
     63         std::list<int, explicit_allocator<int>> l((explicit_allocator<int>()));
     64         assert(l.size() == 0);
     65         assert(std::distance(l.begin(), l.end()) == 0);
     66     }
     67 #endif
     68 }
     69