Home | History | Annotate | Download | only in vector.bool
      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 // <vector>
     11 // vector<bool>
     12 
     13 // void reserve(size_type n);
     14 
     15 #include <vector>
     16 #include <cassert>
     17 
     18 int main()
     19 {
     20     {
     21         std::vector<bool> v;
     22         v.reserve(10);
     23         assert(v.capacity() >= 10);
     24     }
     25     {
     26         std::vector<bool> v(100);
     27         assert(v.capacity() >= 100);
     28         v.reserve(50);
     29         assert(v.size() == 100);
     30         assert(v.capacity() >= 100);
     31         v.reserve(150);
     32         assert(v.size() == 100);
     33         assert(v.capacity() >= 150);
     34     }
     35 }
     36