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 push_back(const value_type& x);
     14 
     15 #include <vector>
     16 #include <cassert>
     17 
     18 int main()
     19 {
     20     {
     21         bool a[] = {0, 1, 1, 0, 1, 0, 0};
     22         const unsigned N = sizeof(a)/sizeof(a[0]);
     23         std::vector<int> c;
     24         for (unsigned i = 0; i < N; ++i)
     25         {
     26             c.push_back(a[i]);
     27             assert(c.size() == i+1);
     28             for (int j = 0; j < c.size(); ++j)
     29                 assert(c[j] == a[j]);
     30         }
     31     }
     32 }
     33