diff options
Diffstat (limited to 'boost/iterator/iterator_facade.hpp')
-rw-r--r-- | boost/iterator/iterator_facade.hpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/boost/iterator/iterator_facade.hpp b/boost/iterator/iterator_facade.hpp index c08a869bbd..7b11d0aec1 100644 --- a/boost/iterator/iterator_facade.hpp +++ b/boost/iterator/iterator_facade.hpp @@ -22,6 +22,7 @@ #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_pointer.hpp> +#include <boost/type_traits/add_lvalue_reference.hpp> #include <boost/type_traits/remove_const.hpp> #include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/is_convertible.hpp> @@ -284,7 +285,15 @@ namespace iterators { : mpl::eval_if< mpl::and_< // A proxy is only needed for readable iterators - is_convertible<Reference,Value const&> + is_convertible< + Reference + // Use add_lvalue_reference to form `reference to Value` due to + // some (strict) C++03 compilers (e.g. `gcc -std=c++03`) reject + // 'reference-to-reference' in the template which described in CWG + // DR106. + // http://www.open-std.org/Jtc1/sc22/wg21/docs/cwg_defects.html#106 + , typename add_lvalue_reference<Value const>::type + > // No multipass iterator can have values that disappear // before positions can be re-visited |