constant_iter_arrow_fail.cpp 476 B

1234567891011121314151617181920
  1. // Copyright David Abrahams 2004. Distributed under the Boost
  2. // Software License, Version 1.0. (See accompanying
  3. // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  4. #include <boost/iterator/iterator_adaptor.hpp>
  5. #include <utility>
  6. struct my_iter : boost::iterator_adaptor<my_iter, std::pair<int,int> const*>
  7. {
  8. my_iter(std::pair<int,int> const*);
  9. my_iter();
  10. };
  11. std::pair<int,int> const x(1,1);
  12. my_iter p(&x);
  13. void test()
  14. {
  15. p->first = 3;
  16. }