config_def.hpp 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // (C) Copyright David Abrahams 2002.
  2. // (C) Copyright Jeremy Siek 2002.
  3. // (C) Copyright Thomas Witt 2002.
  4. // Distributed under the Boost Software License, Version 1.0. (See
  5. // accompanying file LICENSE_1_0.txt or copy at
  6. // http://www.boost.org/LICENSE_1_0.txt)
  7. // no include guard multiple inclusion intended
  8. //
  9. // This is a temporary workaround until the bulk of this is
  10. // available in boost config.
  11. // 23/02/03 thw
  12. //
  13. #include <boost/config.hpp> // for prior
  14. #include <boost/detail/workaround.hpp>
  15. #ifdef BOOST_ITERATOR_CONFIG_DEF
  16. # error you have nested config_def #inclusion.
  17. #else
  18. # define BOOST_ITERATOR_CONFIG_DEF
  19. #endif
  20. // We enable this always now. Otherwise, the simple case in
  21. // libs/iterator/test/constant_iterator_arrow.cpp fails to compile
  22. // because the operator-> return is improperly deduced as a non-const
  23. // pointer.
  24. // Recall that in general, compilers without partial specialization
  25. // can't strip constness. Consider counting_iterator, which normally
  26. // passes a const Value to iterator_facade. As a result, any code
  27. // which makes a std::vector of the iterator's value_type will fail
  28. // when its allocator declares functions overloaded on reference and
  29. // const_reference (the same type).
  30. //
  31. // Furthermore, Borland 5.5.1 drops constness in enough ways that we
  32. // end up using a proxy for operator[] when we otherwise shouldn't.
  33. // Using reference constness gives it an extra hint that it can
  34. // return the value_type from operator[] directly, but is not
  35. // strictly necessary. Not sure how best to resolve this one.
  36. # define BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY 1
  37. // no include guard; multiple inclusion intended