boost_no_iter_construct.ipp 927 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // (C) Copyright John Maddock 2001.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_NO_TEMPLATED_ITERATOR_CONSTRUCTORS
  7. // TITLE: template iterator-constructors
  8. // DESCRIPTION: The standard library does not provide
  9. // templated iterator constructors for its containers.
  10. #include <vector>
  11. #include <deque>
  12. #include <list>
  13. namespace boost_no_templated_iterator_constructors{
  14. int test()
  15. {
  16. std::vector<int> v1;
  17. std::deque<int> d1;
  18. std::list<char> l1;
  19. //
  20. // now try constructors:
  21. std::vector<long> v2(d1.begin(), d1.end());
  22. std::deque<long> d2(v1.begin(), v1.end());
  23. std::list<long> l2(d1.begin(), d1.end());
  24. return 0;
  25. }
  26. }