Home | History | Annotate | Download | only in vector.data
      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 
     12 // const_pointer data() const;
     13 
     14 #include <vector>
     15 #include <cassert>
     16 
     17 int main()
     18 {
     19     {
     20         const std::vector<int> v;
     21         assert(v.data() == 0);
     22     }
     23     {
     24         const std::vector<int> v(100);
     25         assert(v.data() == &v.front());
     26     }
     27 }
     28