fail_ref_citerator.cpp 863 B

123456789101112131415161718192021222324252627282930313233
  1. // Copyright 2002 The Trustees of Indiana University.
  2. // Use, modification and distribution is subject to the Boost Software
  3. // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. // Boost.MultiArray Library
  6. // Authors: Ronald Garcia
  7. // Jeremy Siek
  8. // Andrew Lumsdaine
  9. // See http://www.boost.org/libs/multi_array for documentation.
  10. //
  11. // fail_ref_citerator.cpp
  12. // const_iterator/iterator conversion test
  13. //
  14. #include <boost/multi_array.hpp>
  15. #include <boost/core/lightweight_test.hpp>
  16. int main() {
  17. typedef boost::multi_array_ref<int,3> array_ref;
  18. typedef array_ref::iterator iterator1;
  19. typedef array_ref::const_iterator citerator1;
  20. // FAIL! ILLEGAL conversion from const_iterator to iterator
  21. iterator1 in = citerator1();
  22. return boost::report_errors();
  23. }