Include bind in ndnboost.
diff --git a/ndnboost/range/algorithm/equal.hpp b/ndnboost/range/algorithm/equal.hpp
new file mode 100644
index 0000000..27b741d
--- /dev/null
+++ b/ndnboost/range/algorithm/equal.hpp
@@ -0,0 +1,198 @@
+// Boost.Range library
+//
+// Copyright Neil Groves 2009.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_ALGORITHM_EQUAL_HPP_INCLUDED
+#define BOOST_RANGE_ALGORITHM_EQUAL_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/range/concepts.hpp>
+#include <iterator>
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ // An implementation of equality comparison that is optimized for iterator
+ // traversal categories less than RandomAccessTraversal.
+ template< class SinglePassTraversalReadableIterator1,
+ class SinglePassTraversalReadableIterator2,
+ class IteratorCategoryTag1,
+ class IteratorCategoryTag2 >
+ inline bool equal_impl( SinglePassTraversalReadableIterator1 first1,
+ SinglePassTraversalReadableIterator1 last1,
+ SinglePassTraversalReadableIterator2 first2,
+ SinglePassTraversalReadableIterator2 last2,
+ IteratorCategoryTag1,
+ IteratorCategoryTag2 )
+ {
+ while (true)
+ {
+ // If we have reached the end of the left range then this is
+ // the end of the loop. They are equal if and only if we have
+ // simultaneously reached the end of the right range.
+ if (first1 == last1)
+ return first2 == last2;
+
+ // If we have reached the end of the right range at this line
+ // it indicates that the right range is shorter than the left
+ // and hence the result is false.
+ if (first2 == last2)
+ return false;
+
+ // continue looping if and only if the values are equal
+ if (*first1 != *first2)
+ break;
+
+ ++first1;
+ ++first2;
+ }
+
+ // Reaching this line in the algorithm indicates that a value
+ // inequality has been detected.
+ return false;
+ }
+
+ template< class SinglePassTraversalReadableIterator1,
+ class SinglePassTraversalReadableIterator2,
+ class IteratorCategoryTag1,
+ class IteratorCategoryTag2,
+ class BinaryPredicate >
+ inline bool equal_impl( SinglePassTraversalReadableIterator1 first1,
+ SinglePassTraversalReadableIterator1 last1,
+ SinglePassTraversalReadableIterator2 first2,
+ SinglePassTraversalReadableIterator2 last2,
+ BinaryPredicate pred,
+ IteratorCategoryTag1,
+ IteratorCategoryTag2 )
+ {
+ while (true)
+ {
+ // If we have reached the end of the left range then this is
+ // the end of the loop. They are equal if and only if we have
+ // simultaneously reached the end of the right range.
+ if (first1 == last1)
+ return first2 == last2;
+
+ // If we have reached the end of the right range at this line
+ // it indicates that the right range is shorter than the left
+ // and hence the result is false.
+ if (first2 == last2)
+ return false;
+
+ // continue looping if and only if the values are equal
+ if (!pred(*first1, *first2))
+ break;
+
+ ++first1;
+ ++first2;
+ }
+
+ // Reaching this line in the algorithm indicates that a value
+ // inequality has been detected.
+ return false;
+ }
+
+ // An implementation of equality comparison that is optimized for
+ // random access iterators.
+ template< class RandomAccessTraversalReadableIterator1,
+ class RandomAccessTraversalReadableIterator2 >
+ inline bool equal_impl( RandomAccessTraversalReadableIterator1 first1,
+ RandomAccessTraversalReadableIterator1 last1,
+ RandomAccessTraversalReadableIterator2 first2,
+ RandomAccessTraversalReadableIterator2 last2,
+ std::random_access_iterator_tag,
+ std::random_access_iterator_tag )
+ {
+ return ((last1 - first1) == (last2 - first2))
+ && std::equal(first1, last1, first2);
+ }
+
+ template< class RandomAccessTraversalReadableIterator1,
+ class RandomAccessTraversalReadableIterator2,
+ class BinaryPredicate >
+ inline bool equal_impl( RandomAccessTraversalReadableIterator1 first1,
+ RandomAccessTraversalReadableIterator1 last1,
+ RandomAccessTraversalReadableIterator2 first2,
+ RandomAccessTraversalReadableIterator2 last2,
+ BinaryPredicate pred )
+ {
+ return ((last1 - first1) == (last2 - first2))
+ && std::equal(first1, last1, first2, pred);
+ }
+
+ template< class SinglePassTraversalReadableIterator1,
+ class SinglePassTraversalReadableIterator2 >
+ inline bool equal( SinglePassTraversalReadableIterator1 first1,
+ SinglePassTraversalReadableIterator1 last1,
+ SinglePassTraversalReadableIterator2 first2,
+ SinglePassTraversalReadableIterator2 last2 )
+ {
+ BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator1 >::iterator_category tag1;
+ BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator2 >::iterator_category tag2;
+
+ return equal_impl(first1, last1, first2, last2, tag1, tag2);
+ }
+
+ template< class SinglePassTraversalReadableIterator1,
+ class SinglePassTraversalReadableIterator2,
+ class BinaryPredicate >
+ inline bool equal( SinglePassTraversalReadableIterator1 first1,
+ SinglePassTraversalReadableIterator1 last1,
+ SinglePassTraversalReadableIterator2 first2,
+ SinglePassTraversalReadableIterator2 last2,
+ BinaryPredicate pred )
+ {
+ BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator1 >::iterator_category tag1;
+ BOOST_DEDUCED_TYPENAME std::iterator_traits< SinglePassTraversalReadableIterator2 >::iterator_category tag2;
+
+ return equal_impl(first1, last1, first2, last2, pred, tag1, tag2);
+ }
+
+ } // namespace range_detail
+
+ namespace range
+ {
+
+ /// \brief template function equal
+ ///
+ /// range-based version of the equal std algorithm
+ ///
+ /// \pre SinglePassRange1 is a model of the SinglePassRangeConcept
+ /// \pre SinglePassRange2 is a model of the SinglePassRangeConcept
+ /// \pre BinaryPredicate is a model of the BinaryPredicateConcept
+ template< class SinglePassRange1, class SinglePassRange2 >
+ inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2 )
+ {
+ BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
+ BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
+
+ return ::ndnboost::range_detail::equal(
+ ::ndnboost::begin(rng1), ::ndnboost::end(rng1),
+ ::ndnboost::begin(rng2), ::ndnboost::end(rng2) );
+ }
+
+ /// \overload
+ template< class SinglePassRange1, class SinglePassRange2, class BinaryPredicate >
+ inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2,
+ BinaryPredicate pred )
+ {
+ BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
+ BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
+
+ return ::ndnboost::range_detail::equal(
+ ::ndnboost::begin(rng1), ::ndnboost::end(rng1),
+ ::ndnboost::begin(rng2), ::ndnboost::end(rng2),
+ pred);
+ }
+
+ } // namespace range
+ using ::ndnboost::range::equal;
+} // namespace ndnboost
+
+#endif // include guard
diff --git a/ndnboost/range/as_literal.hpp b/ndnboost/range/as_literal.hpp
new file mode 100644
index 0000000..82babd8
--- /dev/null
+++ b/ndnboost/range/as_literal.hpp
@@ -0,0 +1,127 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2006. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_AS_LITERAL_HPP
+#define BOOST_RANGE_AS_LITERAL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#include <ndnboost/range/detail/as_literal.hpp>
+#else
+
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/detail/str_types.hpp>
+
+#include <ndnboost/detail/workaround.hpp>
+
+#include <cstring>
+#ifndef BOOST_NO_CWCHAR
+#include <cwchar>
+#endif
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ inline std::size_t length( const char* s )
+ {
+ return strlen( s );
+ }
+
+#ifndef BOOST_NO_CWCHAR
+ inline std::size_t length( const wchar_t* s )
+ {
+ return wcslen( s );
+ }
+#endif
+
+ //
+ // Remark: the compiler cannot choose between T* and T[sz]
+ // overloads, so we must put the T* internal to the
+ // unconstrained version.
+ //
+
+ inline bool is_char_ptr( char* )
+ {
+ return true;
+ }
+
+ inline bool is_char_ptr( const char* )
+ {
+ return true;
+ }
+
+#ifndef BOOST_NO_CWCHAR
+ inline bool is_char_ptr( wchar_t* )
+ {
+ return true;
+ }
+
+ inline bool is_char_ptr( const wchar_t* )
+ {
+ return true;
+ }
+#endif
+
+ template< class T >
+ inline long is_char_ptr( const T& /* r */ )
+ {
+ return 0L;
+ }
+
+ template< class T >
+ inline iterator_range<T*>
+ make_range( T* const r, bool )
+ {
+ return iterator_range<T*>( r, r + length(r) );
+ }
+
+ template< class T >
+ inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<T>::type>
+ make_range( T& r, long )
+ {
+ return ndnboost::make_iterator_range( r );
+ }
+
+ }
+
+ template< class Range >
+ inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<Range>::type>
+ as_literal( Range& r )
+ {
+ return range_detail::make_range( r, range_detail::is_char_ptr(r) );
+ }
+
+ template< class Range >
+ inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type>
+ as_literal( const Range& r )
+ {
+ return range_detail::make_range( r, range_detail::is_char_ptr(r) );
+ }
+
+ template< class Char, std::size_t sz >
+ inline iterator_range<Char*> as_literal( Char (&arr)[sz] )
+ {
+ return range_detail::make_range( arr, range_detail::is_char_ptr(arr) );
+ }
+
+ template< class Char, std::size_t sz >
+ inline iterator_range<const Char*> as_literal( const Char (&arr)[sz] )
+ {
+ return range_detail::make_range( arr, range_detail::is_char_ptr(arr) );
+ }
+}
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+#endif
diff --git a/ndnboost/range/begin.hpp b/ndnboost/range/begin.hpp
new file mode 100644
index 0000000..0143261
--- /dev/null
+++ b/ndnboost/range/begin.hpp
@@ -0,0 +1,143 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_BEGIN_HPP
+#define BOOST_RANGE_BEGIN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#include <ndnboost/range/detail/begin.hpp>
+#else
+
+#include <ndnboost/range/iterator.hpp>
+
+namespace ndnboost
+{
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+namespace range_detail
+{
+#endif
+
+ //////////////////////////////////////////////////////////////////////
+ // primary template
+ //////////////////////////////////////////////////////////////////////
+
+ template< typename C >
+ inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
+ range_begin( C& c )
+ {
+ //
+ // If you get a compile-error here, it is most likely because
+ // you have not implemented range_begin() properly in
+ // the namespace of C
+ //
+ return c.begin();
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ inline Iterator range_begin( const std::pair<Iterator,Iterator>& p )
+ {
+ return p.first;
+ }
+
+ template< typename Iterator >
+ inline Iterator range_begin( std::pair<Iterator,Iterator>& p )
+ {
+ return p.first;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////
+
+ //
+ // May this be discarded? Or is it needed for bad compilers?
+ //
+ template< typename T, std::size_t sz >
+ inline const T* range_begin( const T (&a)[sz] )
+ {
+ return a;
+ }
+
+ template< typename T, std::size_t sz >
+ inline T* range_begin( T (&a)[sz] )
+ {
+ return a;
+ }
+
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+} // namespace 'range_detail'
+#endif
+
+// Use a ADL namespace barrier to avoid ambiguity with other unqualified
+// calls. This is particularly important with C++0x encouraging
+// unqualified calls to begin/end.
+namespace range_adl_barrier
+{
+
+template< class T >
+inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type begin( T& r )
+{
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+ using namespace range_detail;
+#endif
+ return range_begin( r );
+}
+
+template< class T >
+inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type begin( const T& r )
+{
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+ using namespace range_detail;
+#endif
+ return range_begin( r );
+}
+
+ } // namespace range_adl_barrier
+} // namespace ndnboost
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+namespace ndnboost
+{
+ namespace range_adl_barrier
+ {
+ template< class T >
+ inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
+ const_begin( const T& r )
+ {
+ return ndnboost::range_adl_barrier::begin( r );
+ }
+ } // namespace range_adl_barrier
+
+ using namespace range_adl_barrier;
+} // namespace ndnboost
+
+#endif
+
diff --git a/ndnboost/range/concepts.hpp b/ndnboost/range/concepts.hpp
new file mode 100644
index 0000000..a8d4790
--- /dev/null
+++ b/ndnboost/range/concepts.hpp
@@ -0,0 +1,366 @@
+// Boost.Range library concept checks
+//
+// Copyright Neil Groves 2009. Use, modification and distribution
+// are subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// Copyright Daniel Walker 2006. Use, modification and distribution
+// are subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_CONCEPTS_HPP
+#define BOOST_RANGE_CONCEPTS_HPP
+
+#include <ndnboost/concept_check.hpp>
+#include <ndnboost/iterator/iterator_concepts.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/range/value_type.hpp>
+#include <ndnboost/range/detail/misc_concept.hpp>
+
+/*!
+ * \file
+ * \brief Concept checks for the Boost Range library.
+ *
+ * The structures in this file may be used in conjunction with the
+ * Boost Concept Check library to insure that the type of a function
+ * parameter is compatible with a range concept. If not, a meaningful
+ * compile time error is generated. Checks are provided for the range
+ * concepts related to iterator traversal categories. For example, the
+ * following line checks that the type T models the ForwardRange
+ * concept.
+ *
+ * \code
+ * BOOST_CONCEPT_ASSERT((ForwardRangeConcept<T>));
+ * \endcode
+ *
+ * A different concept check is required to ensure writeable value
+ * access. For example to check for a ForwardRange that can be written
+ * to, the following code is required.
+ *
+ * \code
+ * BOOST_CONCEPT_ASSERT((WriteableForwardRangeConcept<T>));
+ * \endcode
+ *
+ * \see http://www.boost.org/libs/range/doc/range.html for details
+ * about range concepts.
+ * \see http://www.boost.org/libs/iterator/doc/iterator_concepts.html
+ * for details about iterator concepts.
+ * \see http://www.boost.org/libs/concept_check/concept_check.htm for
+ * details about concept checks.
+ */
+
+namespace ndnboost {
+
+ namespace range_detail {
+
+#ifndef BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+
+// List broken compiler versions here:
+ #ifdef __GNUC__
+ // GNUC 4.2 has strange issues correctly detecting compliance with the Concepts
+ // hence the least disruptive approach is to turn-off the concept checking for
+ // this version of the compiler.
+ #if __GNUC__ == 4 && __GNUC_MINOR__ == 2
+ #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0
+ #endif
+ #endif
+
+ #ifdef __BORLANDC__
+ #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0
+ #endif
+
+ #ifdef __PATHCC__
+ #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 0
+ #endif
+
+// Default to using the concept asserts unless we have defined it off
+// during the search for black listed compilers.
+ #ifndef BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ #define BOOST_RANGE_ENABLE_CONCEPT_ASSERT 1
+ #endif
+
+#endif
+
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ #define BOOST_RANGE_CONCEPT_ASSERT( x ) BOOST_CONCEPT_ASSERT( x )
+#else
+ #define BOOST_RANGE_CONCEPT_ASSERT( x )
+#endif
+
+ // Rationale for the inclusion of redefined iterator concept
+ // classes:
+ //
+ // The Range algorithms often do not require that the iterators are
+ // 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
+ // use case is the combination of the ndnboost::adaptors::filtered
+ // class with a ndnboost::lambda::bind generated functor.
+ // Ultimately modeling the range concepts using composition
+ // with the Boost.Iterator concepts would render the library
+ // incompatible with many common Boost.Lambda expressions.
+ template<class Iterator>
+ struct IncrementableIteratorConcept : CopyConstructible<Iterator>
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ typedef BOOST_DEDUCED_TYPENAME iterator_traversal<Iterator>::type traversal_category;
+
+ BOOST_RANGE_CONCEPT_ASSERT((
+ Convertible<
+ traversal_category,
+ incrementable_traversal_tag
+ >));
+
+ BOOST_CONCEPT_USAGE(IncrementableIteratorConcept)
+ {
+ ++i;
+ (void)i++;
+ }
+ private:
+ Iterator i;
+#endif
+ };
+
+ template<class Iterator>
+ struct SinglePassIteratorConcept
+ : IncrementableIteratorConcept<Iterator>
+ , EqualityComparable<Iterator>
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ BOOST_RANGE_CONCEPT_ASSERT((
+ Convertible<
+ BOOST_DEDUCED_TYPENAME SinglePassIteratorConcept::traversal_category,
+ single_pass_traversal_tag
+ >));
+
+ BOOST_CONCEPT_USAGE(SinglePassIteratorConcept)
+ {
+ Iterator i2(++i);
+ ndnboost::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 ndnboost::detail::iterator_traits<Iterator>::reference r1(*i);
+ ndnboost::ignore_unused_variable_warning(r1);
+
+ BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::reference r2(*(++i));
+ ndnboost::ignore_unused_variable_warning(r2);
+ }
+ private:
+ Iterator i;
+#endif
+ };
+
+ template<class Iterator>
+ struct ForwardIteratorConcept
+ : SinglePassIteratorConcept<Iterator>
+ , DefaultConstructible<Iterator>
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::difference_type difference_type;
+
+ BOOST_MPL_ASSERT((is_integral<difference_type>));
+ BOOST_MPL_ASSERT_RELATION(std::numeric_limits<difference_type>::is_signed, ==, true);
+
+ BOOST_RANGE_CONCEPT_ASSERT((
+ Convertible<
+ 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++);
+ ndnboost::ignore_unused_variable_warning(i2);
+ BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::reference r(*(i++));
+ ndnboost::ignore_unused_variable_warning(r);
+ }
+ private:
+ Iterator i;
+#endif
+ };
+
+ template<class Iterator>
+ struct BidirectionalIteratorConcept
+ : ForwardIteratorConcept<Iterator>
+ {
+ #if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ BOOST_RANGE_CONCEPT_ASSERT((
+ Convertible<
+ BOOST_DEDUCED_TYPENAME BidirectionalIteratorConcept::traversal_category,
+ bidirectional_traversal_tag
+ >));
+
+ BOOST_CONCEPT_USAGE(BidirectionalIteratorConcept)
+ {
+ --i;
+ (void)i--;
+ }
+ private:
+ Iterator i;
+ #endif
+ };
+
+ template<class Iterator>
+ struct RandomAccessIteratorConcept
+ : BidirectionalIteratorConcept<Iterator>
+ {
+ #if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ BOOST_RANGE_CONCEPT_ASSERT((
+ Convertible<
+ BOOST_DEDUCED_TYPENAME RandomAccessIteratorConcept::traversal_category,
+ random_access_traversal_tag
+ >));
+
+ BOOST_CONCEPT_USAGE(RandomAccessIteratorConcept)
+ {
+ i += n;
+ i = i + n;
+ i = n + i;
+ i -= n;
+ i = i - n;
+ n = i - j;
+ }
+ private:
+ BOOST_DEDUCED_TYPENAME RandomAccessIteratorConcept::difference_type n;
+ Iterator i;
+ Iterator j;
+ #endif
+ };
+
+ } // namespace range_detail
+
+ //! Check if a type T models the SinglePassRange range concept.
+ template<class T>
+ struct SinglePassRangeConcept
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ typedef BOOST_DEDUCED_TYPENAME range_iterator<T const>::type const_iterator;
+ typedef BOOST_DEDUCED_TYPENAME range_iterator<T>::type iterator;
+
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::SinglePassIteratorConcept<iterator>));
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::SinglePassIteratorConcept<const_iterator>));
+
+ BOOST_CONCEPT_USAGE(SinglePassRangeConcept)
+ {
+ // This has been modified from assigning to this->i
+ // (where i was a member variable) to improve
+ // compatibility with Boost.Lambda
+ iterator i1 = ndnboost::begin(*m_range);
+ iterator i2 = ndnboost::end(*m_range);
+
+ ignore_unused_variable_warning(i1);
+ ignore_unused_variable_warning(i2);
+
+ const_constraints(*m_range);
+ }
+
+ private:
+ void const_constraints(const T& const_range)
+ {
+ const_iterator ci1 = ndnboost::begin(const_range);
+ const_iterator ci2 = ndnboost::end(const_range);
+
+ ignore_unused_variable_warning(ci1);
+ ignore_unused_variable_warning(ci2);
+ }
+
+ // Rationale:
+ // The type of m_range is T* rather than T because it allows
+ // T to be an abstract class. The other obvious alternative of
+ // T& produces a warning on some compilers.
+ T* m_range;
+#endif
+ };
+
+ //! Check if a type T models the ForwardRange range concept.
+ template<class T>
+ struct ForwardRangeConcept : SinglePassRangeConcept<T>
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::ForwardIteratorConcept<BOOST_DEDUCED_TYPENAME ForwardRangeConcept::iterator>));
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::ForwardIteratorConcept<BOOST_DEDUCED_TYPENAME ForwardRangeConcept::const_iterator>));
+#endif
+ };
+
+ template<class Range>
+ struct WriteableRangeConcept
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ typedef BOOST_DEDUCED_TYPENAME range_iterator<Range>::type iterator;
+
+ BOOST_CONCEPT_USAGE(WriteableRangeConcept)
+ {
+ *i = v;
+ }
+ private:
+ iterator i;
+ BOOST_DEDUCED_TYPENAME range_value<Range>::type v;
+#endif
+ };
+
+ //! Check if a type T models the WriteableForwardRange range concept.
+ template<class T>
+ struct WriteableForwardRangeConcept
+ : ForwardRangeConcept<T>
+ , WriteableRangeConcept<T>
+ {
+ };
+
+ //! Check if a type T models the BidirectionalRange range concept.
+ template<class T>
+ struct BidirectionalRangeConcept : ForwardRangeConcept<T>
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::iterator>));
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::BidirectionalIteratorConcept<BOOST_DEDUCED_TYPENAME BidirectionalRangeConcept::const_iterator>));
+#endif
+ };
+
+ //! Check if a type T models the WriteableBidirectionalRange range concept.
+ template<class T>
+ struct WriteableBidirectionalRangeConcept
+ : BidirectionalRangeConcept<T>
+ , WriteableRangeConcept<T>
+ {
+ };
+
+ //! Check if a type T models the RandomAccessRange range concept.
+ template<class T>
+ struct RandomAccessRangeConcept : BidirectionalRangeConcept<T>
+ {
+#if BOOST_RANGE_ENABLE_CONCEPT_ASSERT
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::iterator>));
+ BOOST_RANGE_CONCEPT_ASSERT((range_detail::RandomAccessIteratorConcept<BOOST_DEDUCED_TYPENAME RandomAccessRangeConcept::const_iterator>));
+#endif
+ };
+
+ //! Check if a type T models the WriteableRandomAccessRange range concept.
+ template<class T>
+ struct WriteableRandomAccessRangeConcept
+ : RandomAccessRangeConcept<T>
+ , WriteableRangeConcept<T>
+ {
+ };
+
+} // namespace ndnboost
+
+#endif // BOOST_RANGE_CONCEPTS_HPP
diff --git a/ndnboost/range/config.hpp b/ndnboost/range/config.hpp
new file mode 100644
index 0000000..449007c
--- /dev/null
+++ b/ndnboost/range/config.hpp
@@ -0,0 +1,54 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_CONFIG_HPP
+#define BOOST_RANGE_CONFIG_HPP
+
+#include <ndnboost/detail/workaround.hpp>
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/config.hpp>
+
+#ifdef BOOST_RANGE_DEDUCED_TYPENAME
+#error "macro already defined!"
+#endif
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# define BOOST_RANGE_DEDUCED_TYPENAME typename
+#else
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1300) && !defined(_MSC_EXTENSIONS)
+# define BOOST_RANGE_DEDUCED_TYPENAME typename
+# else
+# define BOOST_RANGE_DEDUCED_TYPENAME BOOST_DEDUCED_TYPENAME
+# endif
+#endif
+
+#ifdef BOOST_RANGE_NO_ARRAY_SUPPORT
+#error "macro already defined!"
+#endif
+
+#if BOOST_WORKAROUND( BOOST_MSVC, < 1300 ) || BOOST_WORKAROUND( __MWERKS__, <= 0x3003 )
+#define BOOST_RANGE_NO_ARRAY_SUPPORT 1
+#endif
+
+#ifdef BOOST_RANGE_NO_ARRAY_SUPPORT
+#define BOOST_RANGE_ARRAY_REF() (boost_range_array)
+#define BOOST_RANGE_NO_STATIC_ASSERT
+#else
+#define BOOST_RANGE_ARRAY_REF() (&boost_range_array)
+#endif
+
+
+
+#endif
+
diff --git a/ndnboost/range/const_iterator.hpp b/ndnboost/range/const_iterator.hpp
new file mode 100644
index 0000000..2b78e60
--- /dev/null
+++ b/ndnboost/range/const_iterator.hpp
@@ -0,0 +1,67 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_CONST_ITERATOR_HPP
+#define BOOST_RANGE_CONST_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <ndnboost/range/detail/const_iterator.hpp>
+#else
+
+#include <ndnboost/range/detail/extract_optional_type.hpp>
+#include <ndnboost/type_traits/remove_const.hpp>
+#include <cstddef>
+#include <utility>
+
+namespace ndnboost
+{
+ //////////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////////
+
+ namespace range_detail {
+ BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( const_iterator )
+ }
+
+ template< typename C >
+ struct range_const_iterator : range_detail::extract_const_iterator<C>
+ {};
+
+ //////////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ struct range_const_iterator< std::pair<Iterator,Iterator> >
+ {
+ typedef Iterator type;
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename T, std::size_t sz >
+ struct range_const_iterator< T[sz] >
+ {
+ typedef const T* type;
+ };
+
+} // namespace ndnboost
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif
diff --git a/ndnboost/range/detail/as_literal.hpp b/ndnboost/range/detail/as_literal.hpp
new file mode 100644
index 0000000..94b1b6e
--- /dev/null
+++ b/ndnboost/range/detail/as_literal.hpp
@@ -0,0 +1,33 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2006. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_AS_LITERAL_HPP
+#define BOOST_RANGE_DETAIL_AS_LITERAL_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/detail/detail_str.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+
+namespace ndnboost
+{
+ template< class Range >
+ inline iterator_range<BOOST_DEDUCED_TYPENAME range_iterator<Range>::type>
+ as_literal( Range& r )
+ {
+ return ::ndnboost::make_iterator_range( ::ndnboost::range_detail::str_begin(r),
+ ::ndnboost::range_detail::str_end(r) );
+ }
+
+}
+
+#endif
diff --git a/ndnboost/range/detail/begin.hpp b/ndnboost/range/detail/begin.hpp
new file mode 100644
index 0000000..aea43cf
--- /dev/null
+++ b/ndnboost/range/detail/begin.hpp
@@ -0,0 +1,94 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_BEGIN_HPP
+#define BOOST_RANGE_DETAIL_BEGIN_HPP
+
+#include <ndnboost/config.hpp> // BOOST_MSVC
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/range/detail/common.hpp>
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+# include <ndnboost/range/value_type.hpp>
+#endif
+
+namespace ndnboost
+{
+
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_begin;
+
+ //////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_begin<std_container_>
+ {
+ template< typename C >
+ static BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type fun( C& c )
+ {
+ return c.begin();
+ };
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_begin<std_pair_>
+ {
+ template< typename P >
+ static BOOST_RANGE_DEDUCED_TYPENAME range_iterator<P>::type fun( const P& p )
+ {
+ return p.first;
+ }
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_begin<array_>
+ {
+ #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+ template< typename T, std::size_t sz >
+ static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ return boost_range_array;
+ }
+ #else
+ template<typename T>
+ static BOOST_RANGE_DEDUCED_TYPENAME range_value<T>::type* fun(T& t)
+ {
+ return t;
+ }
+ #endif
+ };
+
+ } // namespace 'range_detail'
+
+ namespace range_adl_barrier
+ {
+ template< typename C >
+ inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
+ begin( C& c )
+ {
+ return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
+ }
+ }
+} // namespace 'boost'
+
+
+#endif
diff --git a/ndnboost/range/detail/common.hpp b/ndnboost/range/detail/common.hpp
new file mode 100644
index 0000000..f607721
--- /dev/null
+++ b/ndnboost/range/detail/common.hpp
@@ -0,0 +1,117 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_COMMON_HPP
+#define BOOST_RANGE_DETAIL_COMMON_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/detail/sfinae.hpp>
+#include <ndnboost/type_traits/is_void.hpp>
+#include <ndnboost/type_traits/detail/ice_or.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/int.hpp>
+#include <cstddef>
+
+//////////////////////////////////////////////////////////////////////////////
+// missing partial specialization workaround.
+//////////////////////////////////////////////////////////////////////////////
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ // 1 = std containers
+ // 2 = std::pair
+ // 3 = const std::pair
+ // 4 = array
+ // 5 = const array
+ // 6 = char array
+ // 7 = wchar_t array
+ // 8 = char*
+ // 9 = const char*
+ // 10 = whar_t*
+ // 11 = const wchar_t*
+ // 12 = string
+
+ typedef mpl::int_<1>::type std_container_;
+ typedef mpl::int_<2>::type std_pair_;
+ typedef mpl::int_<3>::type const_std_pair_;
+ typedef mpl::int_<4>::type array_;
+ typedef mpl::int_<5>::type const_array_;
+ typedef mpl::int_<6>::type char_array_;
+ typedef mpl::int_<7>::type wchar_t_array_;
+ typedef mpl::int_<8>::type char_ptr_;
+ typedef mpl::int_<9>::type const_char_ptr_;
+ typedef mpl::int_<10>::type wchar_t_ptr_;
+ typedef mpl::int_<11>::type const_wchar_t_ptr_;
+ typedef mpl::int_<12>::type string_;
+
+ template< typename C >
+ struct range_helper
+ {
+ static C* c;
+ static C ptr;
+
+ BOOST_STATIC_CONSTANT( bool, is_pair_ = sizeof( ndnboost::range_detail::is_pair_impl( c ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_char_ptr_ = sizeof( ndnboost::range_detail::is_char_ptr_impl( ptr ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_const_char_ptr_ = sizeof( ndnboost::range_detail::is_const_char_ptr_impl( ptr ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_wchar_t_ptr_ = sizeof( ndnboost::range_detail::is_wchar_t_ptr_impl( ptr ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_const_wchar_t_ptr_ = sizeof( ndnboost::range_detail::is_const_wchar_t_ptr_impl( ptr ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_char_array_ = sizeof( ndnboost::range_detail::is_char_array_impl( ptr ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_wchar_t_array_ = sizeof( ndnboost::range_detail::is_wchar_t_array_impl( ptr ) ) == sizeof( yes_type ) );
+ BOOST_STATIC_CONSTANT( bool, is_string_ = (ndnboost::type_traits::ice_or<is_const_char_ptr_, is_const_wchar_t_ptr_>::value ));
+ BOOST_STATIC_CONSTANT( bool, is_array_ = ndnboost::is_array<C>::value );
+
+ };
+
+ template< typename C >
+ class range
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_pair_,
+ ndnboost::range_detail::std_pair_,
+ void >::type pair_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_array_,
+ ndnboost::range_detail::array_,
+ pair_t >::type array_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_string_,
+ ndnboost::range_detail::string_,
+ array_t >::type string_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_const_char_ptr_,
+ ndnboost::range_detail::const_char_ptr_,
+ string_t >::type const_char_ptr_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_char_ptr_,
+ ndnboost::range_detail::char_ptr_,
+ const_char_ptr_t >::type char_ptr_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_const_wchar_t_ptr_,
+ ndnboost::range_detail::const_wchar_t_ptr_,
+ char_ptr_t >::type const_wchar_ptr_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_wchar_t_ptr_,
+ ndnboost::range_detail::wchar_t_ptr_,
+ const_wchar_ptr_t >::type wchar_ptr_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_wchar_t_array_,
+ ndnboost::range_detail::wchar_t_array_,
+ wchar_ptr_t >::type wchar_array_t;
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::range_detail::range_helper<C>::is_char_array_,
+ ndnboost::range_detail::char_array_,
+ wchar_array_t >::type char_array_t;
+ public:
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::mpl::if_c< ::ndnboost::is_void<char_array_t>::value,
+ ndnboost::range_detail::std_container_,
+ char_array_t >::type type;
+ }; // class 'range'
+ }
+}
+
+#endif
+
diff --git a/ndnboost/range/detail/const_iterator.hpp b/ndnboost/range/detail/const_iterator.hpp
new file mode 100644
index 0000000..a23c25a
--- /dev/null
+++ b/ndnboost/range/detail/const_iterator.hpp
@@ -0,0 +1,71 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_CONST_ITERATOR_HPP
+#define BOOST_RANGE_DETAIL_CONST_ITERATOR_HPP
+
+#include <ndnboost/range/detail/common.hpp>
+#include <ndnboost/range/detail/remove_extent.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// missing partial specialization workaround.
+//////////////////////////////////////////////////////////////////////////////
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_const_iterator_;
+
+ template<>
+ struct range_const_iterator_<std_container_>
+ {
+ template< typename C >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME C::const_iterator type;
+ };
+ };
+
+ template<>
+ struct range_const_iterator_<std_pair_>
+ {
+ template< typename P >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME P::first_type type;
+ };
+ };
+
+
+ template<>
+ struct range_const_iterator_<array_>
+ {
+ template< typename T >
+ struct pts
+ {
+ typedef const BOOST_RANGE_DEDUCED_TYPENAME
+ remove_extent<T>::type* type;
+ };
+ };
+ }
+
+ template< typename C >
+ class range_const_iterator
+ {
+ typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
+ public:
+ typedef BOOST_DEDUCED_TYPENAME range_detail::range_const_iterator_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
+ };
+
+}
+
+#endif
diff --git a/ndnboost/range/detail/detail_str.hpp b/ndnboost/range/detail/detail_str.hpp
new file mode 100644
index 0000000..5519996
--- /dev/null
+++ b/ndnboost/range/detail/detail_str.hpp
@@ -0,0 +1,376 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_DETAIL_STR_HPP
+#define BOOST_RANGE_DETAIL_DETAIL_STR_HPP
+
+#include <ndnboost/config.hpp> // BOOST_MSVC
+#include <ndnboost/range/iterator.hpp>
+
+namespace ndnboost
+{
+
+ namespace range_detail
+ {
+ //
+ // iterator
+ //
+
+ template<>
+ struct range_iterator_<char_array_>
+ {
+ template< typename T >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME
+ remove_extent<T>::type* type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef char* type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<const_char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const char* type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef wchar_t* type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<const_wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const wchar_t* type;
+ };
+ };
+
+
+ //
+ // const iterator
+ //
+
+ template<>
+ struct range_const_iterator_<char_array_>
+ {
+ template< typename T >
+ struct pts
+ {
+ typedef const BOOST_RANGE_DEDUCED_TYPENAME
+ remove_extent<T>::type* type;
+ };
+ };
+
+ template<>
+ struct range_const_iterator_<char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const char* type;
+ };
+ };
+
+ template<>
+ struct range_const_iterator_<const_char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const char* type;
+ };
+ };
+
+ template<>
+ struct range_const_iterator_<wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const wchar_t* type;
+ };
+ };
+
+ template<>
+ struct range_const_iterator_<const_wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const wchar_t* type;
+ };
+ };
+ }
+}
+
+#include <ndnboost/range/detail/begin.hpp>
+#include <ndnboost/range/detail/end.hpp>
+#include <ndnboost/range/detail/size_type.hpp>
+#include <ndnboost/range/detail/value_type.hpp>
+#include <ndnboost/range/detail/common.hpp>
+
+namespace ndnboost
+{
+
+ namespace range_detail
+ {
+ //
+ // str_begin()
+ //
+ template<>
+ struct range_begin<char_ptr_>
+ {
+ static char* fun( char* s )
+ {
+ return s;
+ }
+ };
+
+ template<>
+ struct range_begin<const_char_ptr_>
+ {
+ static const char* fun( const char* s )
+ {
+ return s;
+ }
+ };
+
+ template<>
+ struct range_begin<wchar_t_ptr_>
+ {
+
+ static wchar_t* fun( wchar_t* s )
+ {
+ return s;
+ }
+ };
+
+ template<>
+ struct range_begin<const_wchar_t_ptr_>
+ {
+ static const wchar_t* fun( const wchar_t* s )
+ {
+ return s;
+ }
+ };
+
+ template< typename C >
+ inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
+ str_begin( C& c )
+ {
+ return range_detail::range_begin< BOOST_RANGE_DEDUCED_TYPENAME
+ range_detail::range<C>::type >::fun( c );
+ }
+
+ //
+ // str_end()
+ //
+
+ template<>
+ struct range_end<char_array_>
+ {
+ template< typename T, std::size_t sz >
+ static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ return ndnboost::range_detail::array_end( boost_range_array );
+ }
+ };
+
+ template<>
+ struct range_end<wchar_t_array_>
+ {
+ template< typename T, std::size_t sz >
+ static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ return ndnboost::range_detail::array_end( boost_range_array );
+ }
+ };
+
+ template<>
+ struct range_end<char_ptr_>
+ {
+ static char* fun( char* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+
+ template<>
+ struct range_end<const_char_ptr_>
+ {
+ static const char* fun( const char* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+
+ template<>
+ struct range_end<wchar_t_ptr_>
+ {
+ static wchar_t* fun( wchar_t* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+
+
+ template<>
+ struct range_end<const_wchar_t_ptr_>
+ {
+ static const wchar_t* fun( const wchar_t* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+
+ template< typename C >
+ inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
+ str_end( C& c )
+ {
+ return range_detail::range_end< BOOST_RANGE_DEDUCED_TYPENAME
+ range_detail::range<C>::type >::fun( c );
+ }
+
+ //
+ // size_type
+ //
+
+ template<>
+ struct range_size_type_<char_array_>
+ {
+ template< typename A >
+ struct pts
+ {
+ typedef std::size_t type;
+ };
+ };
+
+ template<>
+ struct range_size_type_<char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef std::size_t type;
+ };
+ };
+
+ template<>
+ struct range_size_type_<const_char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef std::size_t type;
+ };
+ };
+
+ template<>
+ struct range_size_type_<wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef std::size_t type;
+ };
+ };
+
+ template<>
+ struct range_size_type_<const_wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef std::size_t type;
+ };
+ };
+
+ //
+ // value_type
+ //
+
+ template<>
+ struct range_value_type_<char_array_>
+ {
+ template< typename T >
+ struct pts
+ {
+ typedef char type;
+ };
+ };
+
+ template<>
+ struct range_value_type_<char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef char type;
+ };
+ };
+
+ template<>
+ struct range_value_type_<const_char_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const char type;
+ };
+ };
+
+ template<>
+ struct range_value_type_<wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef wchar_t type;
+ };
+ };
+
+ template<>
+ struct range_value_type_<const_wchar_t_ptr_>
+ {
+ template< typename S >
+ struct pts
+ {
+ typedef const wchar_t type;
+ };
+ };
+
+ } // namespace 'range_detail'
+
+} // namespace 'boost'
+
+
+#endif
diff --git a/ndnboost/range/detail/end.hpp b/ndnboost/range/detail/end.hpp
new file mode 100644
index 0000000..a16cf73
--- /dev/null
+++ b/ndnboost/range/detail/end.hpp
@@ -0,0 +1,101 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_END_HPP
+#define BOOST_RANGE_DETAIL_END_HPP
+
+#include <ndnboost/config.hpp> // BOOST_MSVC
+#include <ndnboost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+# include <ndnboost/range/detail/vc6/end.hpp>
+#else
+# include <ndnboost/range/detail/implementation_help.hpp>
+# include <ndnboost/range/iterator.hpp>
+# include <ndnboost/range/detail/common.hpp>
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+# include <ndnboost/range/detail/remove_extent.hpp>
+# endif
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_end;
+
+ //////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<std_container_>
+ {
+ template< typename C >
+ static BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
+ fun( C& c )
+ {
+ return c.end();
+ };
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<std_pair_>
+ {
+ template< typename P >
+ static BOOST_RANGE_DEDUCED_TYPENAME range_iterator<P>::type
+ fun( const P& p )
+ {
+ return p.second;
+ }
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<array_>
+ {
+ #if !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
+ template< typename T, std::size_t sz >
+ static T* fun( T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ return ndnboost::range_detail::array_end( boost_range_array );
+ }
+ #else
+ template<typename T>
+ static BOOST_RANGE_DEDUCED_TYPENAME remove_extent<T>::type* fun(T& t)
+ {
+ return t + remove_extent<T>::size;
+ }
+ #endif
+ };
+
+ } // namespace 'range_detail'
+
+ namespace range_adl_barrier
+ {
+ template< typename C >
+ inline BOOST_RANGE_DEDUCED_TYPENAME range_iterator<C>::type
+ end( C& c )
+ {
+ return range_detail::range_end< BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type >::fun( c );
+ }
+ } // namespace range_adl_barrier
+
+} // namespace 'boost'
+
+# endif // VC6
+#endif
diff --git a/ndnboost/range/detail/extract_optional_type.hpp b/ndnboost/range/detail/extract_optional_type.hpp
new file mode 100644
index 0000000..e77f37c
--- /dev/null
+++ b/ndnboost/range/detail/extract_optional_type.hpp
@@ -0,0 +1,52 @@
+// Boost.Range library
+//
+// Copyright Arno Schoedl & Neil Groves 2009.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_DETAIL_EXTRACT_OPTIONAL_TYPE_HPP_INCLUDED
+#define BOOST_RANGE_DETAIL_EXTRACT_OPTIONAL_TYPE_HPP_INCLUDED
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/config.hpp>
+
+#ifdef BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
+
+#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
+ template< typename C > \
+ struct extract_ ## a_typedef \
+ { \
+ typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \
+ };
+
+#else
+
+namespace ndnboost {
+ namespace range_detail {
+ template< typename T > struct exists { typedef void type; };
+ }
+}
+
+// Defines extract_some_typedef<T> which exposes T::some_typedef as
+// extract_some_typedef<T>::type if T::some_typedef exists. Otherwise
+// extract_some_typedef<T> is empty.
+#define BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( a_typedef ) \
+ template< typename C, typename Enable=void > \
+ struct extract_ ## a_typedef \
+ {}; \
+ template< typename C > \
+ struct extract_ ## a_typedef< C \
+ , BOOST_DEDUCED_TYPENAME ndnboost::range_detail::exists< BOOST_DEDUCED_TYPENAME C::a_typedef >::type \
+ > { \
+ typedef BOOST_DEDUCED_TYPENAME C::a_typedef type; \
+ };
+
+#endif
+
+#endif // include guard
diff --git a/ndnboost/range/detail/implementation_help.hpp b/ndnboost/range/detail/implementation_help.hpp
new file mode 100644
index 0000000..9e80d6b
--- /dev/null
+++ b/ndnboost/range/detail/implementation_help.hpp
@@ -0,0 +1,103 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_IMPLEMENTATION_HELP_HPP
+#define BOOST_RANGE_DETAIL_IMPLEMENTATION_HELP_HPP
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/detail/common.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+#include <cstddef>
+#include <string.h>
+
+#ifndef BOOST_NO_CWCHAR
+#include <wchar.h>
+#endif
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template <typename T>
+ inline void boost_range_silence_warning( const T& ) { }
+
+ /////////////////////////////////////////////////////////////////////
+ // end() help
+ /////////////////////////////////////////////////////////////////////
+
+ inline const char* str_end( const char* s, const char* )
+ {
+ return s + strlen( s );
+ }
+
+#ifndef BOOST_NO_CWCHAR
+ inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
+ {
+ return s + wcslen( s );
+ }
+#else
+ inline const wchar_t* str_end( const wchar_t* s, const wchar_t* )
+ {
+ if( s == 0 || s[0] == 0 )
+ return s;
+ while( *++s != 0 )
+ ;
+ return s;
+ }
+#endif
+
+ template< class Char >
+ inline Char* str_end( Char* s )
+ {
+ return const_cast<Char*>( str_end( s, s ) );
+ }
+
+ template< class T, std::size_t sz >
+ inline T* array_end( T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ return boost_range_array + sz;
+ }
+
+ template< class T, std::size_t sz >
+ inline const T* array_end( const T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ return boost_range_array + sz;
+ }
+
+ /////////////////////////////////////////////////////////////////////
+ // size() help
+ /////////////////////////////////////////////////////////////////////
+
+ template< class Char >
+ inline std::size_t str_size( const Char* const& s )
+ {
+ return str_end( s ) - s;
+ }
+
+ template< class T, std::size_t sz >
+ inline std::size_t array_size( T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ boost_range_silence_warning( boost_range_array );
+ return sz;
+ }
+
+ template< class T, std::size_t sz >
+ inline std::size_t array_size( const T BOOST_RANGE_ARRAY_REF()[sz] )
+ {
+ boost_range_silence_warning( boost_range_array );
+ return sz;
+ }
+
+ } // namespace 'range_detail'
+
+} // namespace 'boost'
+
+
+#endif
diff --git a/ndnboost/range/detail/iterator.hpp b/ndnboost/range/detail/iterator.hpp
new file mode 100644
index 0000000..c58b5ad
--- /dev/null
+++ b/ndnboost/range/detail/iterator.hpp
@@ -0,0 +1,78 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_ITERATOR_HPP
+#define BOOST_RANGE_DETAIL_ITERATOR_HPP
+
+#include <ndnboost/range/detail/common.hpp>
+#include <ndnboost/range/detail/remove_extent.hpp>
+
+#include <ndnboost/static_assert.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// missing partial specialization workaround.
+//////////////////////////////////////////////////////////////////////////////
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_iterator_ {
+ template< typename C >
+ struct pts
+ {
+ typedef int type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<std_container_>
+ {
+ template< typename C >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME C::iterator type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<std_pair_>
+ {
+ template< typename P >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME P::first_type type;
+ };
+ };
+
+ template<>
+ struct range_iterator_<array_>
+ {
+ template< typename T >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME
+ remove_extent<T>::type* type;
+ };
+ };
+
+ }
+
+ template< typename C >
+ class range_mutable_iterator
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
+ public:
+ typedef typename range_detail::range_iterator_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
+ };
+}
+
+#endif
diff --git a/ndnboost/range/detail/misc_concept.hpp b/ndnboost/range/detail/misc_concept.hpp
new file mode 100644
index 0000000..fb2a39c
--- /dev/null
+++ b/ndnboost/range/detail/misc_concept.hpp
@@ -0,0 +1,33 @@
+// Boost.Range library concept checks
+//
+// Copyright Neil Groves 2009. Use, modification and distribution
+// are subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+#ifndef BOOST_RANGE_DETAIL_MISC_CONCEPT_HPP_INCLUDED
+#define BOOST_RANGE_DETAIL_MISC_CONCEPT_HPP_INCLUDED
+
+#include <ndnboost/concept_check.hpp>
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template<typename T1, typename T2>
+ class SameTypeConcept
+ {
+ public:
+ BOOST_CONCEPT_USAGE(SameTypeConcept)
+ {
+ same_type(a,b);
+ }
+ private:
+ template<typename T> void same_type(T,T) {}
+ T1 a;
+ T2 b;
+ };
+ }
+}
+
+#endif // include guard
diff --git a/ndnboost/range/detail/remove_extent.hpp b/ndnboost/range/detail/remove_extent.hpp
new file mode 100644
index 0000000..9d89ed7
--- /dev/null
+++ b/ndnboost/range/detail/remove_extent.hpp
@@ -0,0 +1,157 @@
+// Boost.Range library
+//
+// Copyright Jonathan Turkanis 2005. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+
+#ifndef BOOST_RANGE_DETAIL_REMOVE_BOUNDS_HPP
+#define BOOST_RANGE_DETAIL_REMOVE_BOUNDS_HPP
+
+#include <ndnboost/config.hpp> // MSVC, NO_INTRINSIC_WCHAR_T, put size_t in std.
+#include <cstddef>
+#include <ndnboost/mpl/eval_if.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+
+ template< typename Case1 = mpl::true_,
+ typename Type1 = mpl::void_,
+ typename Case2 = mpl::true_,
+ typename Type2 = mpl::void_,
+ typename Case3 = mpl::true_,
+ typename Type3 = mpl::void_,
+ typename Case4 = mpl::true_,
+ typename Type4 = mpl::void_,
+ typename Case5 = mpl::true_,
+ typename Type5 = mpl::void_,
+ typename Case6 = mpl::true_,
+ typename Type6 = mpl::void_,
+ typename Case7 = mpl::true_,
+ typename Type7 = mpl::void_,
+ typename Case8 = mpl::true_,
+ typename Type8 = mpl::void_,
+ typename Case9 = mpl::true_,
+ typename Type9 = mpl::void_,
+ typename Case10 = mpl::true_,
+ typename Type10 = mpl::void_,
+ typename Case11 = mpl::true_,
+ typename Type11 = mpl::void_,
+ typename Case12 = mpl::true_,
+ typename Type12 = mpl::void_,
+ typename Case13 = mpl::true_,
+ typename Type13 = mpl::void_,
+ typename Case14 = mpl::true_,
+ typename Type14 = mpl::void_,
+ typename Case15 = mpl::true_,
+ typename Type15 = mpl::void_,
+ typename Case16 = mpl::true_,
+ typename Type16 = mpl::void_,
+ typename Case17 = mpl::true_,
+ typename Type17 = mpl::void_,
+ typename Case18 = mpl::true_,
+ typename Type18 = mpl::void_,
+ typename Case19 = mpl::true_,
+ typename Type19 = mpl::void_,
+ typename Case20 = mpl::true_,
+ typename Type20 = mpl::void_>
+ struct select {
+ typedef typename
+ mpl::eval_if<
+ Case1, mpl::identity<Type1>, mpl::eval_if<
+ Case2, mpl::identity<Type2>, mpl::eval_if<
+ Case3, mpl::identity<Type3>, mpl::eval_if<
+ Case4, mpl::identity<Type4>, mpl::eval_if<
+ Case5, mpl::identity<Type5>, mpl::eval_if<
+ Case6, mpl::identity<Type6>, mpl::eval_if<
+ Case7, mpl::identity<Type7>, mpl::eval_if<
+ Case8, mpl::identity<Type8>, mpl::eval_if<
+ Case9, mpl::identity<Type9>, mpl::if_<
+ Case10, Type10, mpl::void_ > > > > > > > > >
+ >::type result1;
+ typedef typename
+ mpl::eval_if<
+ Case11, mpl::identity<Type11>, mpl::eval_if<
+ Case12, mpl::identity<Type12>, mpl::eval_if<
+ Case13, mpl::identity<Type13>, mpl::eval_if<
+ Case14, mpl::identity<Type14>, mpl::eval_if<
+ Case15, mpl::identity<Type15>, mpl::eval_if<
+ Case16, mpl::identity<Type16>, mpl::eval_if<
+ Case17, mpl::identity<Type17>, mpl::eval_if<
+ Case18, mpl::identity<Type18>, mpl::eval_if<
+ Case19, mpl::identity<Type19>, mpl::if_<
+ Case20, Type20, mpl::void_ > > > > > > > > >
+ > result2;
+ typedef typename
+ mpl::eval_if<
+ is_same<result1, mpl::void_>,
+ result2,
+ mpl::identity<result1>
+ >::type type;
+ };
+
+ template<typename T>
+ struct remove_extent {
+ static T* ar;
+ BOOST_STATIC_CONSTANT(std::size_t, size = sizeof(*ar) / sizeof((*ar)[0]));
+
+ typedef typename
+ select<
+ is_same<T, bool[size]>, bool,
+ is_same<T, char[size]>, char,
+ is_same<T, signed char[size]>, signed char,
+ is_same<T, unsigned char[size]>, unsigned char,
+ #ifndef BOOST_NO_INTRINSIC_WCHAR_T
+ is_same<T, wchar_t[size]>, wchar_t,
+ #endif
+ is_same<T, short[size]>, short,
+ is_same<T, unsigned short[size]>, unsigned short,
+ is_same<T, int[size]>, int,
+ is_same<T, unsigned int[size]>, unsigned int,
+ is_same<T, long[size]>, long,
+ is_same<T, unsigned long[size]>, unsigned long,
+ is_same<T, float[size]>, float,
+ is_same<T, double[size]>, double,
+ is_same<T, long double[size]>, long double
+ >::type result1;
+ typedef typename
+ select<
+ is_same<T, const bool[size]>, const bool,
+ is_same<T, const char[size]>, const char,
+ is_same<T, const signed char[size]>, const signed char,
+ is_same<T, const unsigned char[size]>, const unsigned char,
+ #ifndef BOOST_NO_INTRINSIC_WCHAR_T
+ is_same<T, const wchar_t[size]>, const wchar_t,
+ #endif
+ is_same<T, const short[size]>, const short,
+ is_same<T, const unsigned short[size]>, const unsigned short,
+ is_same<T, const int[size]>, const int,
+ is_same<T, const unsigned int[size]>, const unsigned int,
+ is_same<T, const long[size]>, const long,
+ is_same<T, const unsigned long[size]>, const unsigned long,
+ is_same<T, const float[size]>, const float,
+ is_same<T, const double[size]>, const double,
+ is_same<T, const long double[size]>, const long double
+ > result2;
+ typedef typename
+ mpl::eval_if<
+ is_same<result1, mpl::void_>,
+ result2,
+ mpl::identity<result1>
+ >::type type;
+ };
+
+ } // namespace 'range_detail'
+
+} // namespace 'boost'
+
+
+#endif
diff --git a/ndnboost/range/detail/safe_bool.hpp b/ndnboost/range/detail/safe_bool.hpp
new file mode 100644
index 0000000..fad34c4
--- /dev/null
+++ b/ndnboost/range/detail/safe_bool.hpp
@@ -0,0 +1,72 @@
+// This header intentionally has no include guards.
+//
+// Copyright (c) 2010 Neil Groves
+// Distributed under the Boost Software License, Version 1.0.
+// See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt
+//
+// This code utilises the experience gained during the evolution of
+// <ndnboost/smart_ptr/operator_bool.hpp>
+#ifndef BOOST_RANGE_SAFE_BOOL_INCLUDED_HPP
+#define BOOST_RANGE_SAFE_BOOL_INCLUDED_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/range/config.hpp>
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+
+template<class DataMemberPtr>
+class safe_bool
+{
+public:
+ typedef safe_bool this_type;
+
+#if (defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, < 0x570)) || defined(__CINT_)
+ typedef bool unspecified_bool_type;
+ static unspecified_bool_type to_unspecified_bool(const bool x, DataMemberPtr)
+ {
+ return x;
+ }
+#elif defined(_MANAGED)
+ static void unspecified_bool(this_type***)
+ {
+ }
+ typedef void(*unspecified_bool_type)(this_type***);
+ static unspecified_bool_type to_unspecified_bool(const bool x, DataMemberPtr)
+ {
+ return x ? unspecified_bool : 0;
+ }
+#elif \
+ ( defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200) ) || \
+ ( defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304) ) || \
+ ( defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) )
+
+ typedef bool (this_type::*unspecified_bool_type)() const;
+
+ static unspecified_bool_type to_unspecified_bool(const bool x, DataMemberPtr)
+ {
+ return x ? &this_type::detail_safe_bool_member_fn : 0;
+ }
+private:
+ bool detail_safe_bool_member_fn() const { return false; }
+#else
+ typedef DataMemberPtr unspecified_bool_type;
+ static unspecified_bool_type to_unspecified_bool(const bool x, DataMemberPtr p)
+ {
+ return x ? p : 0;
+ }
+#endif
+private:
+ safe_bool();
+ safe_bool(const safe_bool&);
+ void operator=(const safe_bool&);
+ ~safe_bool();
+};
+
+ } // namespace range_detail
+} // namespace ndnboost
+
+#endif // include guard
diff --git a/ndnboost/range/detail/sfinae.hpp b/ndnboost/range/detail/sfinae.hpp
new file mode 100644
index 0000000..d940c3a
--- /dev/null
+++ b/ndnboost/range/detail/sfinae.hpp
@@ -0,0 +1,77 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_SFINAE_HPP
+#define BOOST_RANGE_DETAIL_SFINAE_HPP
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+#include <ndnboost/type_traits/detail/yes_no_type.hpp>
+#include <utility>
+
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ using type_traits::yes_type;
+ using type_traits::no_type;
+
+ //////////////////////////////////////////////////////////////////////
+ // string
+ //////////////////////////////////////////////////////////////////////
+
+ yes_type is_string_impl( const char* const );
+ yes_type is_string_impl( const wchar_t* const );
+ no_type is_string_impl( ... );
+
+ template< std::size_t sz >
+ yes_type is_char_array_impl( char BOOST_RANGE_ARRAY_REF()[sz] );
+ template< std::size_t sz >
+ yes_type is_char_array_impl( const char BOOST_RANGE_ARRAY_REF()[sz] );
+ no_type is_char_array_impl( ... );
+
+ template< std::size_t sz >
+ yes_type is_wchar_t_array_impl( wchar_t BOOST_RANGE_ARRAY_REF()[sz] );
+ template< std::size_t sz >
+ yes_type is_wchar_t_array_impl( const wchar_t BOOST_RANGE_ARRAY_REF()[sz] );
+ no_type is_wchar_t_array_impl( ... );
+
+ yes_type is_char_ptr_impl( char* const );
+ no_type is_char_ptr_impl( ... );
+
+ yes_type is_const_char_ptr_impl( const char* const );
+ no_type is_const_char_ptr_impl( ... );
+
+ yes_type is_wchar_t_ptr_impl( wchar_t* const );
+ no_type is_wchar_t_ptr_impl( ... );
+
+ yes_type is_const_wchar_t_ptr_impl( const wchar_t* const );
+ no_type is_const_wchar_t_ptr_impl( ... );
+
+ //////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ yes_type is_pair_impl( const std::pair<Iterator,Iterator>* );
+ no_type is_pair_impl( ... );
+
+ //////////////////////////////////////////////////////////////////////
+ // tags
+ //////////////////////////////////////////////////////////////////////
+
+ struct char_or_wchar_t_array_tag {};
+
+ } // namespace 'range_detail'
+
+} // namespace 'boost'
+
+#endif
diff --git a/ndnboost/range/detail/size_type.hpp b/ndnboost/range/detail/size_type.hpp
new file mode 100644
index 0000000..3314922
--- /dev/null
+++ b/ndnboost/range/detail/size_type.hpp
@@ -0,0 +1,55 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_SIZE_TYPE_HPP
+#define BOOST_RANGE_DETAIL_SIZE_TYPE_HPP
+
+#include <ndnboost/range/detail/common.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// missing partial specialization workaround.
+//////////////////////////////////////////////////////////////////////////////
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_size_type_
+ {
+ template< typename C >
+ struct pts
+ {
+ typedef std::size_t type;
+ };
+ };
+
+ template<>
+ struct range_size_type_<std_container_>
+ {
+ template< typename C >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME C::size_type type;
+ };
+ };
+ }
+
+ template< typename C >
+ class range_size
+ {
+ typedef typename range_detail::range<C>::type c_type;
+ public:
+ typedef typename range_detail::range_size_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
+ };
+}
+
+#endif
+
diff --git a/ndnboost/range/detail/str_types.hpp b/ndnboost/range/detail/str_types.hpp
new file mode 100644
index 0000000..1829762
--- /dev/null
+++ b/ndnboost/range/detail/str_types.hpp
@@ -0,0 +1,38 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2006. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_STR_TYPES_HPP
+#define BOOST_RANGE_DETAIL_STR_TYPES_HPP
+
+#include <ndnboost/range/size_type.hpp>
+#include <ndnboost/range/iterator.hpp>
+
+namespace ndnboost
+{
+ template< class T >
+ struct range_mutable_iterator<T*>
+ {
+ typedef T* type;
+ };
+
+ template< class T >
+ struct range_const_iterator<T*>
+ {
+ typedef const T* type;
+ };
+
+ template< class T >
+ struct range_size<T*>
+ {
+ typedef std::size_t type;
+ };
+}
+
+#endif
diff --git a/ndnboost/range/detail/value_type.hpp b/ndnboost/range/detail/value_type.hpp
new file mode 100644
index 0000000..f5c919b
--- /dev/null
+++ b/ndnboost/range/detail/value_type.hpp
@@ -0,0 +1,72 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_VALUE_TYPE_HPP
+#define BOOST_RANGE_DETAIL_VALUE_TYPE_HPP
+
+#include <ndnboost/range/detail/common.hpp>
+#include <ndnboost/range/detail/remove_extent.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+//////////////////////////////////////////////////////////////////////////////
+// missing partial specialization workaround.
+//////////////////////////////////////////////////////////////////////////////
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_value_type_;
+
+ template<>
+ struct range_value_type_<std_container_>
+ {
+ template< typename C >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME C::value_type type;
+ };
+ };
+
+ template<>
+ struct range_value_type_<std_pair_>
+ {
+ template< typename P >
+ struct pts
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME ndnboost::iterator_value< BOOST_RANGE_DEDUCED_TYPENAME P::first_type >::type type;
+ };
+ };
+
+ template<>
+ struct range_value_type_<array_>
+ {
+ template< typename T >
+ struct pts
+ {
+ typedef BOOST_DEDUCED_TYPENAME remove_extent<T>::type type;
+ };
+ };
+
+ }
+
+ template< typename C >
+ class range_value
+ {
+ typedef BOOST_DEDUCED_TYPENAME range_detail::range<C>::type c_type;
+ public:
+ typedef BOOST_DEDUCED_TYPENAME range_detail::range_value_type_<c_type>::BOOST_NESTED_TEMPLATE pts<C>::type type;
+ };
+
+}
+
+#endif
+
diff --git a/ndnboost/range/detail/vc6/end.hpp b/ndnboost/range/detail/vc6/end.hpp
new file mode 100644
index 0000000..1853de8
--- /dev/null
+++ b/ndnboost/range/detail/vc6/end.hpp
@@ -0,0 +1,170 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DETAIL_VC6_END_HPP
+#define BOOST_RANGE_DETAIL_VC6_END_HPP
+
+#include <ndnboost/range/detail/implementation_help.hpp>
+#include <ndnboost/range/detail/implementation_help.hpp>
+#include <ndnboost/range/result_iterator.hpp>
+#include <ndnboost/range/detail/common.hpp>
+#include <ndnboost/range/detail/remove_extent.hpp>
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template< typename T >
+ struct range_end;
+
+ //////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<std_container_>
+ {
+ template< typename C >
+ struct inner {
+ static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<C>::type
+ fun( C& c )
+ {
+ return c.end();
+ };
+ };
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<std_pair_>
+ {
+ template< typename P >
+ struct inner {
+ static BOOST_RANGE_DEDUCED_TYPENAME range_result_iterator<P>::type
+ fun( const P& p )
+ {
+ return p.second;
+ }
+ };
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<array_>
+ {
+ template< typename T >
+ struct inner {
+ static BOOST_DEDUCED_TYPENAME remove_extent<T>::type*
+ fun(T& t)
+ {
+ return t + remove_extent<T>::size;
+ }
+ };
+ };
+
+
+ template<>
+ struct range_end<char_array_>
+ {
+ template< typename T >
+ struct inner {
+ static BOOST_DEDUCED_TYPENAME remove_extent<T>::type*
+ fun(T& t)
+ {
+ return t + remove_extent<T>::size;
+ }
+ };
+ };
+
+ template<>
+ struct range_end<wchar_t_array_>
+ {
+ template< typename T >
+ struct inner {
+ static BOOST_DEDUCED_TYPENAME remove_extent<T>::type*
+ fun(T& t)
+ {
+ return t + remove_extent<T>::size;
+ }
+ };
+ };
+
+ //////////////////////////////////////////////////////////////////////
+ // string
+ //////////////////////////////////////////////////////////////////////
+
+ template<>
+ struct range_end<char_ptr_>
+ {
+ template< typename T >
+ struct inner {
+ static char* fun( char* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+ };
+
+ template<>
+ struct range_end<const_char_ptr_>
+ {
+ template< typename T >
+ struct inner {
+ static const char* fun( const char* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+ };
+
+ template<>
+ struct range_end<wchar_t_ptr_>
+ {
+ template< typename T >
+ struct inner {
+ static wchar_t* fun( wchar_t* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+ };
+
+
+ template<>
+ struct range_end<const_wchar_t_ptr_>
+ {
+ template< typename T >
+ struct inner {
+ static const wchar_t* fun( const wchar_t* s )
+ {
+ return ndnboost::range_detail::str_end( s );
+ }
+ };
+ };
+
+ } // namespace 'range_detail'
+
+ template< typename C >
+ inline BOOST_DEDUCED_TYPENAME range_result_iterator<C>::type
+ end( C& c )
+ {
+ return range_detail::range_end<range_detail::range<C>::type>::inner<C>::fun( c );
+ }
+
+} // namespace 'boost'
+
+
+#endif
diff --git a/ndnboost/range/difference_type.hpp b/ndnboost/range/difference_type.hpp
new file mode 100644
index 0000000..b26058a
--- /dev/null
+++ b/ndnboost/range/difference_type.hpp
@@ -0,0 +1,29 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DIFFERENCE_TYPE_HPP
+#define BOOST_RANGE_DIFFERENCE_TYPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+namespace ndnboost
+{
+ template< class T >
+ struct range_difference : iterator_difference< typename range_iterator<T>::type >
+ { };
+}
+
+#endif
diff --git a/ndnboost/range/distance.hpp b/ndnboost/range/distance.hpp
new file mode 100644
index 0000000..12d93fa
--- /dev/null
+++ b/ndnboost/range/distance.hpp
@@ -0,0 +1,34 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2006. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_DISTANCE_HPP
+#define BOOST_RANGE_DISTANCE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/difference_type.hpp>
+
+namespace ndnboost
+{
+
+ template< class T >
+ inline BOOST_DEDUCED_TYPENAME range_difference<T>::type
+ distance( const T& r )
+ {
+ return std::distance( ndnboost::begin( r ), ndnboost::end( r ) );
+ }
+
+} // namespace 'boost'
+
+#endif
diff --git a/ndnboost/range/empty.hpp b/ndnboost/range/empty.hpp
new file mode 100644
index 0000000..6fdd177
--- /dev/null
+++ b/ndnboost/range/empty.hpp
@@ -0,0 +1,34 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_EMPTY_HPP
+#define BOOST_RANGE_EMPTY_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+
+namespace ndnboost
+{
+
+ template< class T >
+ inline bool empty( const T& r )
+ {
+ return ndnboost::begin( r ) == ndnboost::end( r );
+ }
+
+} // namespace 'boost'
+
+
+#endif
diff --git a/ndnboost/range/end.hpp b/ndnboost/range/end.hpp
new file mode 100644
index 0000000..9a7cb11
--- /dev/null
+++ b/ndnboost/range/end.hpp
@@ -0,0 +1,136 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_END_HPP
+#define BOOST_RANGE_END_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#include <ndnboost/range/detail/end.hpp>
+#else
+
+#include <ndnboost/range/detail/implementation_help.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+
+namespace ndnboost
+{
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+namespace range_detail
+{
+#endif
+
+ //////////////////////////////////////////////////////////////////////
+ // primary template
+ //////////////////////////////////////////////////////////////////////
+ template< typename C >
+ inline BOOST_DEDUCED_TYPENAME range_iterator<C>::type
+ range_end( C& c )
+ {
+ //
+ // If you get a compile-error here, it is most likely because
+ // you have not implemented range_begin() properly in
+ // the namespace of C
+ //
+ return c.end();
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ inline Iterator range_end( const std::pair<Iterator,Iterator>& p )
+ {
+ return p.second;
+ }
+
+ template< typename Iterator >
+ inline Iterator range_end( std::pair<Iterator,Iterator>& p )
+ {
+ return p.second;
+ }
+
+ //////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////
+
+ template< typename T, std::size_t sz >
+ inline const T* range_end( const T (&a)[sz] )
+ {
+ return range_detail::array_end<T,sz>( a );
+ }
+
+ template< typename T, std::size_t sz >
+ inline T* range_end( T (&a)[sz] )
+ {
+ return range_detail::array_end<T,sz>( a );
+ }
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+} // namespace 'range_detail'
+#endif
+
+namespace range_adl_barrier
+{
+
+template< class T >
+inline BOOST_DEDUCED_TYPENAME range_iterator<T>::type end( T& r )
+{
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+ using namespace range_detail;
+#endif
+ return range_end( r );
+}
+
+template< class T >
+inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type end( const T& r )
+{
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+ using namespace range_detail;
+#endif
+ return range_end( r );
+}
+
+ } // namespace range_adl_barrier
+} // namespace 'boost'
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+namespace ndnboost
+{
+ namespace range_adl_barrier
+ {
+ template< class T >
+ inline BOOST_DEDUCED_TYPENAME range_iterator<const T>::type
+ const_end( const T& r )
+ {
+ return ndnboost::range_adl_barrier::end( r );
+ }
+ } // namespace range_adl_barrier
+ using namespace range_adl_barrier;
+} // namespace ndnboost
+
+#endif
+
diff --git a/ndnboost/range/functions.hpp b/ndnboost/range/functions.hpp
new file mode 100644
index 0000000..7fa535f
--- /dev/null
+++ b/ndnboost/range/functions.hpp
@@ -0,0 +1,27 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2006. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_FUNCTIONS_HPP
+#define BOOST_RANGE_FUNCTIONS_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/size.hpp>
+#include <ndnboost/range/distance.hpp>
+#include <ndnboost/range/empty.hpp>
+#include <ndnboost/range/rbegin.hpp>
+#include <ndnboost/range/rend.hpp>
+
+#endif
+
diff --git a/ndnboost/range/iterator.hpp b/ndnboost/range/iterator.hpp
new file mode 100644
index 0000000..8710a2e
--- /dev/null
+++ b/ndnboost/range/iterator.hpp
@@ -0,0 +1,72 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_ITERATOR_HPP
+#define BOOST_RANGE_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/mutable_iterator.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+#include <ndnboost/type_traits/is_const.hpp>
+#include <ndnboost/type_traits/remove_const.hpp>
+#include <ndnboost/mpl/eval_if.hpp>
+
+namespace ndnboost
+{
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+
+ namespace range_detail_vc7_1
+ {
+ template< typename C, typename Sig = void(C) >
+ struct range_iterator
+ {
+ typedef BOOST_RANGE_DEDUCED_TYPENAME
+ mpl::eval_if_c< is_const<C>::value,
+ range_const_iterator< typename remove_const<C>::type >,
+ range_mutable_iterator<C> >::type type;
+ };
+
+ template< typename C, typename T >
+ struct range_iterator< C, void(T[]) >
+ {
+ typedef T* type;
+ };
+ }
+
+#endif
+
+ template< typename C >
+ struct range_iterator
+ {
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+
+ typedef BOOST_RANGE_DEDUCED_TYPENAME
+ range_detail_vc7_1::range_iterator<C>::type type;
+
+#else
+
+ typedef BOOST_RANGE_DEDUCED_TYPENAME
+ mpl::eval_if_c< is_const<C>::value,
+ range_const_iterator< typename remove_const<C>::type >,
+ range_mutable_iterator<C> >::type type;
+
+#endif
+ };
+
+} // namespace ndnboost
+
+//#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif
diff --git a/ndnboost/range/iterator_range.hpp b/ndnboost/range/iterator_range.hpp
new file mode 100644
index 0000000..26a9016
--- /dev/null
+++ b/ndnboost/range/iterator_range.hpp
@@ -0,0 +1,16 @@
+// Boost.Range library
+//
+// Copyright Neil Groves 2009.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_ITERATOR_RANGE_HPP_INCLUDED
+#define BOOST_RANGE_ITERATOR_RANGE_HPP_INCLUDED
+
+#include "ndnboost/range/iterator_range_core.hpp"
+#include "ndnboost/range/iterator_range_io.hpp"
+
+#endif // include guard
diff --git a/ndnboost/range/iterator_range_core.hpp b/ndnboost/range/iterator_range_core.hpp
new file mode 100644
index 0000000..e4ca4ea
--- /dev/null
+++ b/ndnboost/range/iterator_range_core.hpp
@@ -0,0 +1,653 @@
+// Boost.Range library
+//
+// Copyright Neil Groves & Thorsten Ottosen & Pavol Droba 2003-2004.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_ITERATOR_RANGE_CORE_HPP_INCLUDED
+#define BOOST_RANGE_ITERATOR_RANGE_CORE_HPP_INCLUDED
+
+#include <ndnboost/config.hpp> // Define __STL_CONFIG_H, if appropriate.
+#include <ndnboost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
+ #pragma warning( push )
+ #pragma warning( disable : 4996 )
+#endif
+
+#include <ndnboost/assert.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+#include <ndnboost/iterator/iterator_facade.hpp>
+#include <ndnboost/mpl/or.hpp>
+#include <ndnboost/type_traits/is_abstract.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+#include <ndnboost/type_traits/is_pointer.hpp>
+#include <ndnboost/range/functions.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/range/difference_type.hpp>
+#include <ndnboost/range/algorithm/equal.hpp>
+#include <ndnboost/range/detail/safe_bool.hpp>
+#include <ndnboost/utility/enable_if.hpp>
+#include <iterator>
+#include <algorithm>
+#include <cstddef>
+
+/*! \file
+ Defines the \c iterator_class and related functions.
+ \c iterator_range is a simple wrapper of iterator pair idiom. It provides
+ a rich subset of Container interface.
+*/
+
+
+namespace ndnboost
+{
+ namespace iterator_range_detail
+ {
+ //
+ // The functions adl_begin and adl_end are implemented in a separate
+ // class for gcc-2.9x
+ //
+ template<class IteratorT>
+ struct iterator_range_impl {
+ template< class ForwardRange >
+ static IteratorT adl_begin( ForwardRange& r )
+ {
+ return static_cast<IteratorT>( ndnboost::begin( r ) );
+ }
+
+ template< class ForwardRange >
+ static IteratorT adl_end( ForwardRange& r )
+ {
+ return static_cast<IteratorT>( ndnboost::end( r ) );
+ }
+ };
+
+ template< class Left, class Right >
+ inline bool less_than( const Left& l, const Right& r )
+ {
+ return std::lexicographical_compare( ndnboost::begin(l),
+ ndnboost::end(l),
+ ndnboost::begin(r),
+ ndnboost::end(r) );
+ }
+
+ template< class Left, class Right >
+ inline bool greater_than( const Left& l, const Right& r )
+ {
+ return less_than(r,l);
+ }
+
+ template< class Left, class Right >
+ inline bool less_or_equal_than( const Left& l, const Right& r )
+ {
+ return !iterator_range_detail::less_than(r,l);
+ }
+
+ template< class Left, class Right >
+ inline bool greater_or_equal_than( const Left& l, const Right& r )
+ {
+ return !iterator_range_detail::less_than(l,r);
+ }
+
+ // This version is maintained since it is used in other boost libraries
+ // such as Boost.Assign
+ template< class Left, class Right >
+ inline bool equal(const Left& l, const Right& r)
+ {
+ return ndnboost::equal(l, r);
+ }
+
+ struct range_tag { };
+ struct const_range_tag { };
+ }
+
+// iterator range template class -----------------------------------------//
+
+ //! iterator_range class
+ /*!
+ An \c iterator_range delimits a range in a sequence by beginning and ending iterators.
+ An iterator_range can be passed to an algorithm which requires a sequence as an input.
+ For example, the \c toupper() function may be used most frequently on strings,
+ but can also be used on iterator_ranges:
+
+ \code
+ ndnboost::tolower( find( s, "UPPERCASE STRING" ) );
+ \endcode
+
+ Many algorithms working with sequences take a pair of iterators,
+ delimiting a working range, as an arguments. The \c iterator_range class is an
+ encapsulation of a range identified by a pair of iterators.
+ It provides a collection interface,
+ so it is possible to pass an instance to an algorithm requiring a collection as an input.
+ */
+ template<class IteratorT>
+ class iterator_range
+ {
+ typedef range_detail::safe_bool< IteratorT iterator_range<IteratorT>::* > safe_bool_t;
+ protected: // Used by sub_range
+ //! implementation class
+ typedef iterator_range_detail::iterator_range_impl<IteratorT> impl;
+ public:
+ //! this type
+ typedef iterator_range<IteratorT> type;
+ typedef BOOST_DEDUCED_TYPENAME safe_bool_t::unspecified_bool_type unspecified_bool_type;
+ //BOOST_BROKEN_COMPILER_TYPE_TRAITS_SPECIALIZATION(value_type);
+
+ //! Encapsulated value type
+ typedef BOOST_DEDUCED_TYPENAME
+ iterator_value<IteratorT>::type value_type;
+
+ //! Difference type
+ typedef BOOST_DEDUCED_TYPENAME
+ iterator_difference<IteratorT>::type difference_type;
+
+ //! Size type
+ typedef std::size_t size_type; // note: must be unsigned
+
+ //! This type
+ typedef iterator_range<IteratorT> this_type;
+
+ //! Reference type
+ //
+ // Needed because value-type is the same for
+ // const and non-const iterators
+ //
+ typedef BOOST_DEDUCED_TYPENAME
+ iterator_reference<IteratorT>::type reference;
+
+ //! const_iterator type
+ /*!
+ There is no distinction between const_iterator and iterator.
+ These typedefs are provides to fulfill container interface
+ */
+ typedef IteratorT const_iterator;
+ //! iterator type
+ typedef IteratorT iterator;
+
+ private: // for return value of operator()()
+ typedef BOOST_DEDUCED_TYPENAME
+ ndnboost::mpl::if_< ndnboost::mpl::or_< ndnboost::is_abstract< value_type >,
+ ndnboost::is_array< value_type > >,
+ reference, value_type >::type abstract_value_type;
+
+ public:
+ iterator_range() : m_Begin( iterator() ), m_End( iterator() )
+ { }
+
+ //! Constructor from a pair of iterators
+ template< class Iterator >
+ iterator_range( Iterator Begin, Iterator End ) :
+ m_Begin(Begin), m_End(End)
+ {}
+
+ //! Constructor from a Range
+ template< class Range >
+ iterator_range( const Range& r ) :
+ m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
+ {}
+
+ //! Constructor from a Range
+ template< class Range >
+ iterator_range( Range& r ) :
+ m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
+ {}
+
+ //! Constructor from a Range
+ template< class Range >
+ iterator_range( const Range& r, iterator_range_detail::const_range_tag ) :
+ m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
+ {}
+
+ //! Constructor from a Range
+ template< class Range >
+ iterator_range( Range& r, iterator_range_detail::range_tag ) :
+ m_Begin( impl::adl_begin( r ) ), m_End( impl::adl_end( r ) )
+ {}
+
+ #if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ this_type& operator=( const this_type& r )
+ {
+ m_Begin = r.begin();
+ m_End = r.end();
+ return *this;
+ }
+ #endif
+
+ template< class Iterator >
+ iterator_range& operator=( const iterator_range<Iterator>& r )
+ {
+ m_Begin = r.begin();
+ m_End = r.end();
+ return *this;
+ }
+
+ template< class ForwardRange >
+ iterator_range& operator=( ForwardRange& r )
+ {
+ m_Begin = impl::adl_begin( r );
+ m_End = impl::adl_end( r );
+ return *this;
+ }
+
+ template< class ForwardRange >
+ iterator_range& operator=( const ForwardRange& r )
+ {
+ m_Begin = impl::adl_begin( r );
+ m_End = impl::adl_end( r );
+ return *this;
+ }
+
+ IteratorT begin() const
+ {
+ return m_Begin;
+ }
+
+ IteratorT end() const
+ {
+ return m_End;
+ }
+
+ difference_type size() const
+ {
+ return m_End - m_Begin;
+ }
+
+ bool empty() const
+ {
+ return m_Begin == m_End;
+ }
+
+ operator unspecified_bool_type() const
+ {
+ return safe_bool_t::to_unspecified_bool(m_Begin != m_End, &iterator_range::m_Begin);
+ }
+
+ bool operator!() const
+ {
+ return empty();
+ }
+
+ bool equal( const iterator_range& r ) const
+ {
+ return m_Begin == r.m_Begin && m_End == r.m_End;
+ }
+
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ bool operator==( const iterator_range& r ) const
+ {
+ return ndnboost::equal( *this, r );
+ }
+
+ bool operator!=( const iterator_range& r ) const
+ {
+ return !operator==(r);
+ }
+
+ bool operator<( const iterator_range& r ) const
+ {
+ return iterator_range_detail::less_than( *this, r );
+ }
+
+ bool operator>( const iterator_range& r ) const
+ {
+ return iterator_range_detail::greater_than( *this, r );
+ }
+
+ bool operator<=( const iterator_range& r ) const
+ {
+ return iterator_range_detail::less_or_equal_than( *this, r );
+ }
+
+ bool operator>=( const iterator_range& r ) const
+ {
+ return iterator_range_detail::greater_or_equal_than( *this, r );
+ }
+
+#endif
+
+ public: // convenience
+ reference front() const
+ {
+ BOOST_ASSERT( !empty() );
+ return *m_Begin;
+ }
+
+ reference back() const
+ {
+ BOOST_ASSERT( !empty() );
+ IteratorT last( m_End );
+ return *--last;
+ }
+
+ // pop_front() - added to model the SinglePassRangePrimitiveConcept
+ void pop_front()
+ {
+ BOOST_ASSERT( !empty() );
+ ++m_Begin;
+ }
+
+ // pop_back() - added to model the BidirectionalRangePrimitiveConcept
+ void pop_back()
+ {
+ BOOST_ASSERT( !empty() );
+ --m_End;
+ }
+
+ reference operator[]( difference_type at ) const
+ {
+ BOOST_ASSERT( at >= 0 && at < size() );
+ return m_Begin[at];
+ }
+
+ //
+ // When storing transform iterators, operator[]()
+ // fails because it returns by reference. Therefore
+ // operator()() is provided for these cases.
+ //
+ abstract_value_type operator()( difference_type at ) const
+ {
+ BOOST_ASSERT( at >= 0 && at < size() );
+ return m_Begin[at];
+ }
+
+ iterator_range& advance_begin( difference_type n )
+ {
+ std::advance( m_Begin, n );
+ return *this;
+ }
+
+ iterator_range& advance_end( difference_type n )
+ {
+ std::advance( m_End, n );
+ return *this;
+ }
+
+ private:
+ // begin and end iterators
+ IteratorT m_Begin;
+ IteratorT m_End;
+
+ protected:
+ //
+ // Allow subclasses an easy way to access the
+ // base type
+ //
+ typedef iterator_range iterator_range_;
+ };
+
+// iterator range free-standing operators ---------------------------//
+
+ /////////////////////////////////////////////////////////////////////
+ // comparison operators
+ /////////////////////////////////////////////////////////////////////
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator==( const ForwardRange& l,
+ const iterator_range<IteratorT>& r )
+ {
+ return ndnboost::equal( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator!=( const ForwardRange& l,
+ const iterator_range<IteratorT>& r )
+ {
+ return !ndnboost::equal( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator<( const ForwardRange& l,
+ const iterator_range<IteratorT>& r )
+ {
+ return iterator_range_detail::less_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator<=( const ForwardRange& l,
+ const iterator_range<IteratorT>& r )
+ {
+ return iterator_range_detail::less_or_equal_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator>( const ForwardRange& l,
+ const iterator_range<IteratorT>& r )
+ {
+ return iterator_range_detail::greater_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator>=( const ForwardRange& l,
+ const iterator_range<IteratorT>& r )
+ {
+ return iterator_range_detail::greater_or_equal_than( l, r );
+ }
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+#else
+ template< class Iterator1T, class Iterator2T >
+ inline bool operator==( const iterator_range<Iterator1T>& l,
+ const iterator_range<Iterator2T>& r )
+ {
+ return ndnboost::equal( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator==( const iterator_range<IteratorT>& l,
+ const ForwardRange& r )
+ {
+ return ndnboost::equal( l, r );
+ }
+
+
+ template< class Iterator1T, class Iterator2T >
+ inline bool operator!=( const iterator_range<Iterator1T>& l,
+ const iterator_range<Iterator2T>& r )
+ {
+ return !ndnboost::equal( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator!=( const iterator_range<IteratorT>& l,
+ const ForwardRange& r )
+ {
+ return !ndnboost::equal( l, r );
+ }
+
+
+ template< class Iterator1T, class Iterator2T >
+ inline bool operator<( const iterator_range<Iterator1T>& l,
+ const iterator_range<Iterator2T>& r )
+ {
+ return iterator_range_detail::less_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator<( const iterator_range<IteratorT>& l,
+ const ForwardRange& r )
+ {
+ return iterator_range_detail::less_than( l, r );
+ }
+
+ template< class Iterator1T, class Iterator2T >
+ inline bool operator<=( const iterator_range<Iterator1T>& l,
+ const iterator_range<Iterator2T>& r )
+ {
+ return iterator_range_detail::less_or_equal_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator<=( const iterator_range<IteratorT>& l,
+ const ForwardRange& r )
+ {
+ return iterator_range_detail::less_or_equal_than( l, r );
+ }
+
+ template< class Iterator1T, class Iterator2T >
+ inline bool operator>( const iterator_range<Iterator1T>& l,
+ const iterator_range<Iterator2T>& r )
+ {
+ return iterator_range_detail::greater_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator>( const iterator_range<IteratorT>& l,
+ const ForwardRange& r )
+ {
+ return iterator_range_detail::greater_than( l, r );
+ }
+
+ template< class Iterator1T, class Iterator2T >
+ inline bool operator>=( const iterator_range<Iterator1T>& l,
+ const iterator_range<Iterator2T>& r )
+ {
+ return iterator_range_detail::greater_or_equal_than( l, r );
+ }
+
+ template< class IteratorT, class ForwardRange >
+ inline bool operator>=( const iterator_range<IteratorT>& l,
+ const ForwardRange& r )
+ {
+ return iterator_range_detail::greater_or_equal_than( l, r );
+ }
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+// iterator range utilities -----------------------------------------//
+
+ //! iterator_range construct helper
+ /*!
+ Construct an \c iterator_range from a pair of iterators
+
+ \param Begin A begin iterator
+ \param End An end iterator
+ \return iterator_range object
+ */
+ template< typename IteratorT >
+ inline iterator_range< IteratorT >
+ make_iterator_range( IteratorT Begin, IteratorT End )
+ {
+ return iterator_range<IteratorT>( Begin, End );
+ }
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ template< typename Range >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<Range>::type >
+ make_iterator_range( Range& r )
+ {
+ return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<Range>::type >
+ ( ndnboost::begin( r ), ndnboost::end( r ) );
+ }
+
+#else
+ //! iterator_range construct helper
+ /*!
+ Construct an \c iterator_range from a \c Range containing the begin
+ and end iterators.
+ */
+ template< class ForwardRange >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type >
+ make_iterator_range( ForwardRange& r )
+ {
+ return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type >
+ ( r, iterator_range_detail::range_tag() );
+ }
+
+ template< class ForwardRange >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type >
+ make_iterator_range( const ForwardRange& r )
+ {
+ return iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type >
+ ( r, iterator_range_detail::const_range_tag() );
+ }
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ namespace iterator_range_detail
+ {
+ template< class Range >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<Range>::type >
+ make_range_impl( Range& r,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
+ {
+ //
+ // Not worth the effort
+ //
+ //if( advance_begin == 0 && advance_end == 0 )
+ // return make_iterator_range( r );
+ //
+
+ BOOST_DEDUCED_TYPENAME range_iterator<Range>::type
+ new_begin = ndnboost::begin( r ),
+ new_end = ndnboost::end( r );
+ std::advance( new_begin, advance_begin );
+ std::advance( new_end, advance_end );
+ return make_iterator_range( new_begin, new_end );
+ }
+ }
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ template< class Range >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<Range>::type >
+ make_iterator_range( Range& r,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
+ {
+ //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" );
+ return iterator_range_detail::make_range_impl( r, advance_begin, advance_end );
+ }
+
+#else
+
+ template< class Range >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<Range>::type >
+ make_iterator_range( Range& r,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
+ {
+ //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" );
+ return iterator_range_detail::make_range_impl( r, advance_begin, advance_end );
+ }
+
+ template< class Range >
+ inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<const Range>::type >
+ make_iterator_range( const Range& r,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_begin,
+ BOOST_DEDUCED_TYPENAME range_difference<Range>::type advance_end )
+ {
+ //BOOST_ASSERT( advance_begin - advance_end <= size(r) && "creating invalid range" );
+ return iterator_range_detail::make_range_impl( r, advance_begin, advance_end );
+ }
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+ //! copy a range into a sequence
+ /*!
+ Construct a new sequence of the specified type from the elements
+ in the given range
+
+ \param Range An input range
+ \return New sequence
+ */
+ template< typename SeqT, typename Range >
+ inline SeqT copy_range( const Range& r )
+ {
+ return SeqT( ndnboost::begin( r ), ndnboost::end( r ) );
+ }
+
+} // namespace 'boost'
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
+ #pragma warning( pop )
+#endif
+
+#endif
+
diff --git a/ndnboost/range/iterator_range_io.hpp b/ndnboost/range/iterator_range_io.hpp
new file mode 100644
index 0000000..78ed7d6
--- /dev/null
+++ b/ndnboost/range/iterator_range_io.hpp
@@ -0,0 +1,93 @@
+// Boost.Range library
+//
+// Copyright Neil Groves 2009.
+// Use, modification and distribution is subject to the Boost Software
+// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+#ifndef BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED
+#define BOOST_RANGE_ITERATOR_RANGE_IO_HPP_INCLUDED
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
+ #pragma warning( push )
+ #pragma warning( disable : 4996 )
+#endif
+
+// From boost/dynamic_bitset.hpp; thanks to Matthias Troyer for Cray X1 patch.
+#ifndef BOOST_OLD_IOSTREAMS
+# if defined(__STL_CONFIG_H) && \
+ !defined (__STL_USE_NEW_IOSTREAMS) && !defined(__crayx1) \
+ /**/
+# define BOOST_OLD_IOSTREAMS
+# endif
+#endif // #ifndef BOOST_OLD_IOSTREAMS
+
+#ifndef _STLP_NO_IOSTREAMS
+# ifndef BOOST_OLD_IOSTREAMS
+# include <ostream>
+# else
+# include <ostream.h>
+# endif
+#endif // _STLP_NO_IOSTREAMS
+
+#include <ndnboost/range/iterator_range_core.hpp>
+#include <iterator>
+#include <algorithm>
+#include <cstddef>
+
+namespace ndnboost
+{
+
+#ifndef _STLP_NO_IOSTREAMS
+# ifndef BOOST_OLD_IOSTREAMS
+
+ //! iterator_range output operator
+ /*!
+ Output the range to an ostream. Elements are outputted
+ in a sequence without separators.
+ */
+ template< typename IteratorT, typename Elem, typename Traits >
+ inline std::basic_ostream<Elem,Traits>& operator<<(
+ std::basic_ostream<Elem, Traits>& Os,
+ const iterator_range<IteratorT>& r )
+ {
+ std::copy( r.begin(), r.end(),
+ std::ostream_iterator< BOOST_DEDUCED_TYPENAME
+ iterator_value<IteratorT>::type,
+ Elem, Traits>(Os) );
+ return Os;
+ }
+
+# else
+
+ //! iterator_range output operator
+ /*!
+ Output the range to an ostream. Elements are outputted
+ in a sequence without separators.
+ */
+ template< typename IteratorT >
+ inline std::ostream& operator<<(
+ std::ostream& Os,
+ const iterator_range<IteratorT>& r )
+ {
+ std::copy( r.begin(), r.end(), std::ostream_iterator<char>(Os));
+ return Os;
+ }
+
+# endif
+#endif // _STLP_NO_IOSTREAMS
+
+} // namespace ndnboost
+
+#undef BOOST_OLD_IOSTREAMS
+
+#if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1500))
+ #pragma warning(pop)
+#endif
+
+#endif // include guard
diff --git a/ndnboost/range/mutable_iterator.hpp b/ndnboost/range/mutable_iterator.hpp
new file mode 100644
index 0000000..e45d86d
--- /dev/null
+++ b/ndnboost/range/mutable_iterator.hpp
@@ -0,0 +1,67 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_MUTABLE_ITERATOR_HPP
+#define BOOST_RANGE_MUTABLE_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <ndnboost/range/detail/iterator.hpp>
+#else
+
+#include <ndnboost/range/detail/extract_optional_type.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+#include <cstddef>
+#include <utility>
+
+namespace ndnboost
+{
+ //////////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////////
+
+ namespace range_detail {
+ BOOST_RANGE_EXTRACT_OPTIONAL_TYPE( iterator )
+ }
+
+ template< typename C >
+ struct range_mutable_iterator : range_detail::extract_iterator<C>
+ {};
+
+ //////////////////////////////////////////////////////////////////////////
+ // pair
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename Iterator >
+ struct range_mutable_iterator< std::pair<Iterator,Iterator> >
+ {
+ typedef Iterator type;
+ };
+
+ //////////////////////////////////////////////////////////////////////////
+ // array
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename T, std::size_t sz >
+ struct range_mutable_iterator< T[sz] >
+ {
+ typedef T* type;
+ };
+
+} // namespace ndnboost
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+#endif
diff --git a/ndnboost/range/rbegin.hpp b/ndnboost/range/rbegin.hpp
new file mode 100644
index 0000000..8ab2456
--- /dev/null
+++ b/ndnboost/range/rbegin.hpp
@@ -0,0 +1,65 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_RBEGIN_HPP
+#define BOOST_RANGE_RBEGIN_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/reverse_iterator.hpp>
+
+namespace ndnboost
+{
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template< class C >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
+rbegin( C& c )
+{
+ return BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type( ndnboost::end( c ) );
+}
+
+#else
+
+template< class C >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
+rbegin( C& c )
+{
+ typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
+ iter_type;
+ return iter_type( ndnboost::end( c ) );
+}
+
+template< class C >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type
+rbegin( const C& c )
+{
+ typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type
+ iter_type;
+ return iter_type( ndnboost::end( c ) );
+}
+
+#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template< class T >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<const T>::type
+const_rbegin( const T& r )
+{
+ return ndnboost::rbegin( r );
+}
+
+} // namespace 'boost'
+
+#endif
+
diff --git a/ndnboost/range/rend.hpp b/ndnboost/range/rend.hpp
new file mode 100644
index 0000000..715ae6b
--- /dev/null
+++ b/ndnboost/range/rend.hpp
@@ -0,0 +1,65 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_REND_HPP
+#define BOOST_RANGE_REND_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/reverse_iterator.hpp>
+
+namespace ndnboost
+{
+
+#ifdef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template< class C >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
+rend( C& c )
+{
+ return BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type( ndnboost::begin( c ) );
+}
+
+#else
+
+template< class C >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
+rend( C& c )
+{
+ typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<C>::type
+ iter_type;
+ return iter_type( ndnboost::begin( c ) );
+}
+
+template< class C >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type
+rend( const C& c )
+{
+ typedef BOOST_DEDUCED_TYPENAME range_reverse_iterator<const C>::type
+ iter_type;
+ return iter_type( ndnboost::begin( c ) );
+}
+
+#endif
+
+template< class T >
+inline BOOST_DEDUCED_TYPENAME range_reverse_iterator<const T>::type
+const_rend( const T& r )
+{
+ return ndnboost::rend( r );
+}
+
+} // namespace 'boost'
+
+#endif
+
diff --git a/ndnboost/range/result_iterator.hpp b/ndnboost/range/result_iterator.hpp
new file mode 100644
index 0000000..5c0dd75
--- /dev/null
+++ b/ndnboost/range/result_iterator.hpp
@@ -0,0 +1,33 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_RESULT_ITERATOR_HPP
+#define BOOST_RANGE_RESULT_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/range/iterator.hpp>
+
+namespace ndnboost
+{
+ //
+ // This interface is deprecated, use range_iterator<T>
+ //
+
+ template< typename C >
+ struct range_result_iterator : range_iterator<C>
+ { };
+
+} // namespace ndnboost
+
+
+#endif
diff --git a/ndnboost/range/reverse_iterator.hpp b/ndnboost/range/reverse_iterator.hpp
new file mode 100644
index 0000000..68fe03d
--- /dev/null
+++ b/ndnboost/range/reverse_iterator.hpp
@@ -0,0 +1,40 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_REVERSE_ITERATOR_HPP
+#define BOOST_RANGE_REVERSE_ITERATOR_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/iterator/reverse_iterator.hpp>
+
+
+namespace ndnboost
+{
+ //////////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////////
+
+ template< typename C >
+ struct range_reverse_iterator
+ {
+ typedef reverse_iterator<
+ BOOST_DEDUCED_TYPENAME range_iterator<C>::type > type;
+ };
+
+
+} // namespace ndnboost
+
+
+#endif
diff --git a/ndnboost/range/size.hpp b/ndnboost/range/size.hpp
new file mode 100644
index 0000000..9164e02
--- /dev/null
+++ b/ndnboost/range/size.hpp
@@ -0,0 +1,52 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_SIZE_HPP
+#define BOOST_RANGE_SIZE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/size_type.hpp>
+#include <ndnboost/assert.hpp>
+
+namespace ndnboost
+{
+ namespace range_detail
+ {
+ template<class SinglePassRange>
+ inline BOOST_DEDUCED_TYPENAME range_size<const SinglePassRange>::type
+ range_calculate_size(const SinglePassRange& rng)
+ {
+ BOOST_ASSERT( (ndnboost::end(rng) - ndnboost::begin(rng)) >= 0 &&
+ "reachability invariant broken!" );
+ return ndnboost::end(rng) - ndnboost::begin(rng);
+ }
+ }
+
+ template<class SinglePassRange>
+ inline BOOST_DEDUCED_TYPENAME range_size<const SinglePassRange>::type
+ size(const SinglePassRange& rng)
+ {
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(__GNUC__, < 3) \
+ /**/
+ using namespace range_detail;
+#endif
+ return range_calculate_size(rng);
+ }
+
+} // namespace 'boost'
+
+#endif
diff --git a/ndnboost/range/size_type.hpp b/ndnboost/range/size_type.hpp
new file mode 100644
index 0000000..0ae8a87
--- /dev/null
+++ b/ndnboost/range/size_type.hpp
@@ -0,0 +1,89 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_SIZE_TYPE_HPP
+#define BOOST_RANGE_SIZE_TYPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/difference_type.hpp>
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <ndnboost/range/detail/size_type.hpp>
+#else
+
+#include <ndnboost/utility/enable_if.hpp>
+#include <ndnboost/type_traits/make_unsigned.hpp>
+#include <ndnboost/type_traits/remove_const.hpp>
+#include <cstddef>
+#include <utility>
+
+namespace ndnboost
+{
+ namespace detail
+ {
+
+ //////////////////////////////////////////////////////////////////////////
+ // default
+ //////////////////////////////////////////////////////////////////////////
+
+ template<typename T>
+ class has_size_type
+ {
+ typedef char no_type;
+ struct yes_type { char dummy[2]; };
+
+ template<typename C>
+ static yes_type test(BOOST_DEDUCED_TYPENAME C::size_type x);
+
+ template<typename C, typename Arg>
+ static no_type test(Arg x);
+
+ public:
+ static const bool value = sizeof(test<T>(0)) == sizeof(yes_type);
+ };
+
+ template<typename C, typename Enabler=void>
+ struct range_size
+ {
+ typedef BOOST_DEDUCED_TYPENAME make_unsigned<
+ BOOST_DEDUCED_TYPENAME range_difference<C>::type
+ >::type type;
+ };
+
+ template<typename C>
+ struct range_size<
+ C,
+ BOOST_DEDUCED_TYPENAME enable_if<has_size_type<C>, void>::type
+ >
+ {
+ typedef BOOST_DEDUCED_TYPENAME C::size_type type;
+ };
+
+ }
+
+ template< class T >
+ struct range_size :
+ detail::range_size<T>
+ { };
+
+ template< class T >
+ struct range_size<const T >
+ : detail::range_size<T>
+ { };
+
+} // namespace ndnboost
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+
+#endif
diff --git a/ndnboost/range/value_type.hpp b/ndnboost/range/value_type.hpp
new file mode 100644
index 0000000..855ed05
--- /dev/null
+++ b/ndnboost/range/value_type.hpp
@@ -0,0 +1,34 @@
+// Boost.Range library
+//
+// Copyright Thorsten Ottosen 2003-2004. Use, modification and
+// distribution is subject to the Boost Software License, Version
+// 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+//
+// For more information, see http://www.boost.org/libs/range/
+//
+
+#ifndef BOOST_RANGE_VALUE_TYPE_HPP
+#define BOOST_RANGE_VALUE_TYPE_HPP
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+#include <ndnboost/range/config.hpp>
+#include <ndnboost/range/iterator.hpp>
+
+//#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+//#include <ndnboost/range/detail/value_type.hpp>
+//#else
+
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+namespace ndnboost
+{
+ template< class T >
+ struct range_value : iterator_value< typename range_iterator<T>::type >
+ { };
+}
+
+#endif