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 #include "min_allocator.h"
     18 
     19 int main()
     20 {
     21     {
     22         const std::vector<int> v;
     23         assert(v.data() == 0);
     24     }
     25     {
     26         const std::vector<int> v(100);
     27         assert(v.data() == &v.front());
     28     }
     29 #if __cplusplus >= 201103L
     30     {
     31         const std::vector<int, min_allocator<int>> v;
     32         assert(v.data() == 0);
     33     }
     34     {
     35         const std::vector<int, min_allocator<int>> v(100);
     36         assert(v.data() == &v.front());
     37     }
     38 #endif
     39 }
     40