vector_main.cpp 525 B

1234567891011121314151617181920212223
  1. // Copyright (C) 2008-2018 Lorenzo Caminiti
  2. // Distributed under the Boost Software License, Version 1.0 (see accompanying
  3. // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
  4. // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
  5. //[cline90_vector_main
  6. #include "vector.hpp"
  7. #include <cassert>
  8. int main() {
  9. vector<int> v (3);
  10. assert(v.size() == 3);
  11. v[0] = 123;
  12. v.resize(2);
  13. assert(v[0] == 123);
  14. assert(v.size() == 2);
  15. return 0;
  16. }
  17. //]