diff options
Diffstat (limited to '3rdParty/Boost/src/boost/range/concepts.hpp')
| -rw-r--r-- | 3rdParty/Boost/src/boost/range/concepts.hpp | 39 | 
1 files changed, 37 insertions, 2 deletions
| diff --git a/3rdParty/Boost/src/boost/range/concepts.hpp b/3rdParty/Boost/src/boost/range/concepts.hpp index 8e4d2cf..5965293 100644 --- a/3rdParty/Boost/src/boost/range/concepts.hpp +++ b/3rdParty/Boost/src/boost/range/concepts.hpp @@ -98,8 +98,9 @@ namespace boost {          // classes:          //          // The Range algorithms often do not require that the iterators are -        // Assignable, but the correct standard conformant iterators -        // do require the iterators to be a model of the Assignable concept. +        // Assignable or default constructable, but the correct standard +        // conformant iterators do require the iterators to be a model of the +        // Assignable concept.          // Iterators that contains a functor that is not assignable therefore          // are not correct models of the standard iterator concepts,          // despite being adequate for most algorithms. An example of this @@ -141,6 +142,26 @@ namespace boost {                      BOOST_DEDUCED_TYPENAME SinglePassIteratorConcept::traversal_category,                      single_pass_traversal_tag                  >)); + +            BOOST_CONCEPT_USAGE(SinglePassIteratorConcept) +            { +                Iterator i2(++i); +                boost::ignore_unused_variable_warning(i2); + +                // deliberately we are loose with the postfix version for the single pass +                // iterator due to the commonly poor adherence to the specification means that +                // many algorithms would be unusable, whereas actually without the check they +                // work +                (void)(i++); + +                BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r1(*i); +                boost::ignore_unused_variable_warning(r1); + +                BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r2(*(++i)); +                boost::ignore_unused_variable_warning(r2); +            } +        private: +            Iterator i;  #endif          }; @@ -160,6 +181,20 @@ namespace boost {                      BOOST_DEDUCED_TYPENAME ForwardIteratorConcept::traversal_category,                      forward_traversal_tag                  >)); + +            BOOST_CONCEPT_USAGE(ForwardIteratorConcept) +            { +                // See the above note in the SinglePassIteratorConcept about the handling of the +                // postfix increment. Since with forward and better iterators there is no need +                // for a proxy, we can sensibly require that the dereference result +                // is convertible to reference. +                Iterator i2(i++); +                boost::ignore_unused_variable_warning(i2); +                BOOST_DEDUCED_TYPENAME boost::detail::iterator_traits<Iterator>::reference r(*(i++)); +                boost::ignore_unused_variable_warning(r); +            } +        private: +            Iterator i;  #endif           }; | 
 Swift
 Swift