Include bind in ndnboost.
diff --git a/ndn-cpp/common.hpp b/ndn-cpp/common.hpp
index 8908c3d..56b1aa4 100644
--- a/ndn-cpp/common.hpp
+++ b/ndn-cpp/common.hpp
@@ -21,7 +21,7 @@
#else
// Use the boost header files in this distribution that were extracted with:
// cd <INCLUDE DIRECTORY WITH boost SUBDIRECTORY>
-// dist/bin/bcp --namespace=ndnboost shared_ptr make_shared weak_ptr functional <NDN-CPP ROOT>
+// dist/bin/bcp --namespace=ndnboost shared_ptr make_shared weak_ptr function bind <NDN-CPP ROOT>
// cd <NDN-CPP ROOT>
// mv boost ndnboost
// cd ndnboost
@@ -39,10 +39,12 @@
namespace ndn { namespace func_lib = std; }
#elif HAVE_BOOST_FUNCTION
#include <boost/function.hpp>
+#include <boost/bind.hpp>
namespace ndn { namespace func_lib = boost; }
#else
// Use the boost header files in this distribution that were extracted as above:
#include <ndnboost/function.hpp>
+#include <ndnboost/bind.hpp>
namespace ndn { namespace func_lib = ndnboost; }
#endif
diff --git a/ndnboost/algorithm/string/compare.hpp b/ndnboost/algorithm/string/compare.hpp
new file mode 100644
index 0000000..e963120
--- /dev/null
+++ b/ndnboost/algorithm/string/compare.hpp
@@ -0,0 +1,199 @@
+// Boost string_algo library compare.hpp header file -------------------------//
+
+// Copyright Pavol Droba 2002-2006.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_COMPARE_HPP
+#define BOOST_STRING_COMPARE_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <locale>
+
+/*! \file
+ Defines element comparison predicates. Many algorithms in this library can
+ take an additional argument with a predicate used to compare elements.
+ This makes it possible, for instance, to have case insensitive versions
+ of the algorithms.
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+ // is_equal functor -----------------------------------------------//
+
+ //! is_equal functor
+ /*!
+ Standard STL equal_to only handle comparison between arguments
+ of the same type. This is a less restrictive version which wraps operator ==.
+ */
+ struct is_equal
+ {
+ //! Function operator
+ /*!
+ Compare two operands for equality
+ */
+ template< typename T1, typename T2 >
+ bool operator()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ return Arg1==Arg2;
+ }
+ };
+
+ //! case insensitive version of is_equal
+ /*!
+ Case insensitive comparison predicate. Comparison is done using
+ specified locales.
+ */
+ struct is_iequal
+ {
+ //! Constructor
+ /*!
+ \param Loc locales used for comparison
+ */
+ is_iequal( const std::locale& Loc=std::locale() ) :
+ m_Loc( Loc ) {}
+
+ //! Function operator
+ /*!
+ Compare two operands. Case is ignored.
+ */
+ template< typename T1, typename T2 >
+ bool operator()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
+ return std::toupper(Arg1)==std::toupper(Arg2);
+ #else
+ return std::toupper<T1>(Arg1,m_Loc)==std::toupper<T2>(Arg2,m_Loc);
+ #endif
+ }
+
+ private:
+ std::locale m_Loc;
+ };
+
+ // is_less functor -----------------------------------------------//
+
+ //! is_less functor
+ /*!
+ Convenient version of standard std::less. Operation is templated, therefore it is
+ not required to specify the exact types upon the construction
+ */
+ struct is_less
+ {
+ //! Functor operation
+ /*!
+ Compare two operands using > operator
+ */
+ template< typename T1, typename T2 >
+ bool operator()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ return Arg1<Arg2;
+ }
+ };
+
+
+ //! case insensitive version of is_less
+ /*!
+ Case insensitive comparison predicate. Comparison is done using
+ specified locales.
+ */
+ struct is_iless
+ {
+ //! Constructor
+ /*!
+ \param Loc locales used for comparison
+ */
+ is_iless( const std::locale& Loc=std::locale() ) :
+ m_Loc( Loc ) {}
+
+ //! Function operator
+ /*!
+ Compare two operands. Case is ignored.
+ */
+ template< typename T1, typename T2 >
+ bool operator()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
+ return std::toupper(Arg1)<std::toupper(Arg2);
+ #else
+ return std::toupper<T1>(Arg1,m_Loc)<std::toupper<T2>(Arg2,m_Loc);
+ #endif
+ }
+
+ private:
+ std::locale m_Loc;
+ };
+
+ // is_not_greater functor -----------------------------------------------//
+
+ //! is_not_greater functor
+ /*!
+ Convenient version of standard std::not_greater_to. Operation is templated, therefore it is
+ not required to specify the exact types upon the construction
+ */
+ struct is_not_greater
+ {
+ //! Functor operation
+ /*!
+ Compare two operands using > operator
+ */
+ template< typename T1, typename T2 >
+ bool operator()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ return Arg1<=Arg2;
+ }
+ };
+
+
+ //! case insensitive version of is_not_greater
+ /*!
+ Case insensitive comparison predicate. Comparison is done using
+ specified locales.
+ */
+ struct is_not_igreater
+ {
+ //! Constructor
+ /*!
+ \param Loc locales used for comparison
+ */
+ is_not_igreater( const std::locale& Loc=std::locale() ) :
+ m_Loc( Loc ) {}
+
+ //! Function operator
+ /*!
+ Compare two operands. Case is ignored.
+ */
+ template< typename T1, typename T2 >
+ bool operator()( const T1& Arg1, const T2& Arg2 ) const
+ {
+ #if defined(__BORLANDC__) && (__BORLANDC__ >= 0x560) && (__BORLANDC__ <= 0x564) && !defined(_USE_OLD_RW_STL)
+ return std::toupper(Arg1)<=std::toupper(Arg2);
+ #else
+ return std::toupper<T1>(Arg1,m_Loc)<=std::toupper<T2>(Arg2,m_Loc);
+ #endif
+ }
+
+ private:
+ std::locale m_Loc;
+ };
+
+
+ } // namespace algorithm
+
+ // pull names to the boost namespace
+ using algorithm::is_equal;
+ using algorithm::is_iequal;
+ using algorithm::is_less;
+ using algorithm::is_iless;
+ using algorithm::is_not_greater;
+ using algorithm::is_not_igreater;
+
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_COMPARE_HPP
diff --git a/ndnboost/algorithm/string/concept.hpp b/ndnboost/algorithm/string/concept.hpp
new file mode 100644
index 0000000..31faa80
--- /dev/null
+++ b/ndnboost/algorithm/string/concept.hpp
@@ -0,0 +1,83 @@
+// Boost string_algo library concept.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CONCEPT_HPP
+#define BOOST_STRING_CONCEPT_HPP
+
+#include <ndnboost/concept_check.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+
+/*! \file
+ Defines concepts used in string_algo library
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+ //! Finder concept
+ /*!
+ Defines the Finder concept. Finder is a functor which selects
+ an arbitrary part of a string. Search is performed on
+ the range specified by starting and ending iterators.
+
+ Result of the find operation must be convertible to iterator_range.
+ */
+ template<typename FinderT, typename IteratorT>
+ struct FinderConcept
+ {
+ private:
+ typedef iterator_range<IteratorT> range;
+ public:
+ void constraints()
+ {
+ // Operation
+ r=(*pF)(i,i);
+ }
+ private:
+ range r;
+ IteratorT i;
+ FinderT* pF;
+ }; // Finder_concept
+
+
+ //! Formatter concept
+ /*!
+ Defines the Formatter concept. Formatter is a functor, which
+ takes a result from a finder operation and transforms it
+ in a specific way.
+
+ Result must be a container supported by container_traits,
+ or a reference to it.
+ */
+ template<typename FormatterT, typename FinderT, typename IteratorT>
+ struct FormatterConcept
+ {
+ public:
+ void constraints()
+ {
+ // Operation
+ ::ndnboost::begin((*pFo)( (*pF)(i,i) ));
+ ::ndnboost::end((*pFo)( (*pF)(i,i) ));
+ }
+ private:
+ IteratorT i;
+ FinderT* pF;
+ FormatterT *pFo;
+ }; // FormatterConcept;
+
+ } // namespace algorithm
+} // namespace ndnboost
+
+
+
+
+#endif // BOOST_STRING_CONCEPT_HPP
diff --git a/ndnboost/algorithm/string/config.hpp b/ndnboost/algorithm/string/config.hpp
new file mode 100644
index 0000000..4ed3d05
--- /dev/null
+++ b/ndnboost/algorithm/string/config.hpp
@@ -0,0 +1,28 @@
+// Boost string_algo library config.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CONFIG_HPP
+#define BOOST_STRING_CONFIG_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#ifdef BOOST_STRING_DEDUCED_TYPENAME
+# error "macro already defined!"
+#endif
+
+#define BOOST_STRING_TYPENAME BOOST_DEDUCED_TYPENAME
+
+// Metrowerks workaround
+#if BOOST_WORKAROUND(__MWERKS__, <= 0x3003) // 8.x
+#pragma parse_func_templ off
+#endif
+
+#endif // BOOST_STRING_CONFIG_HPP
diff --git a/ndnboost/algorithm/string/constants.hpp b/ndnboost/algorithm/string/constants.hpp
new file mode 100644
index 0000000..232d0d8
--- /dev/null
+++ b/ndnboost/algorithm/string/constants.hpp
@@ -0,0 +1,36 @@
+// Boost string_algo library constants.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_CONSTANTS_HPP
+#define BOOST_STRING_CONSTANTS_HPP
+
+namespace ndnboost {
+ namespace algorithm {
+
+ //! Token compression mode
+ /*!
+ Specifies token compression mode for the token_finder.
+ */
+ enum token_compress_mode_type
+ {
+ token_compress_on, //!< Compress adjacent tokens
+ token_compress_off //!< Do not compress adjacent tokens
+ };
+
+ } // namespace algorithm
+
+ // pull the names to the boost namespace
+ using algorithm::token_compress_on;
+ using algorithm::token_compress_off;
+
+} // namespace ndnboost
+
+#endif // BOOST_STRING_CONSTANTS_HPP
+
diff --git a/ndnboost/algorithm/string/detail/find_format.hpp b/ndnboost/algorithm/string/detail/find_format.hpp
new file mode 100644
index 0000000..395beaf
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/find_format.hpp
@@ -0,0 +1,204 @@
+// Boost string_algo library find_format.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FIND_FORMAT_DETAIL_HPP
+#define BOOST_STRING_FIND_FORMAT_DETAIL_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/algorithm/string/detail/find_format_store.hpp>
+#include <ndnboost/algorithm/string/detail/replace_storage.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// find_format_copy (iterator variant) implementation -------------------------------//
+
+ template<
+ typename OutputIteratorT,
+ typename InputT,
+ typename FormatterT,
+ typename FindResultT,
+ typename FormatResultT >
+ inline OutputIteratorT find_format_copy_impl2(
+ OutputIteratorT Output,
+ const InputT& Input,
+ FormatterT Formatter,
+ const FindResultT& FindResult,
+ const FormatResultT& FormatResult )
+ {
+ typedef find_format_store<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<InputT>::type,
+ FormatterT,
+ FormatResultT > store_type;
+
+ // Create store for the find result
+ store_type M( FindResult, FormatResult, Formatter );
+
+ if ( !M )
+ {
+ // Match not found - return original sequence
+ Output = std::copy( ::ndnboost::begin(Input), ::ndnboost::end(Input), Output );
+ return Output;
+ }
+
+ // Copy the beginning of the sequence
+ Output = std::copy( ::ndnboost::begin(Input), ::ndnboost::begin(M), Output );
+ // Format find result
+ // Copy formatted result
+ Output = std::copy( ::ndnboost::begin(M.format_result()), ::ndnboost::end(M.format_result()), Output );
+ // Copy the rest of the sequence
+ Output = std::copy( M.end(), ::ndnboost::end(Input), Output );
+
+ return Output;
+ }
+
+ template<
+ typename OutputIteratorT,
+ typename InputT,
+ typename FormatterT,
+ typename FindResultT >
+ inline OutputIteratorT find_format_copy_impl(
+ OutputIteratorT Output,
+ const InputT& Input,
+ FormatterT Formatter,
+ const FindResultT& FindResult )
+ {
+ if( ::ndnboost::algorithm::detail::check_find_result(Input, FindResult) ) {
+ return ::ndnboost::algorithm::detail::find_format_copy_impl2(
+ Output,
+ Input,
+ Formatter,
+ FindResult,
+ Formatter(FindResult) );
+ } else {
+ return std::copy( ::ndnboost::begin(Input), ::ndnboost::end(Input), Output );
+ }
+ }
+
+
+// find_format_copy implementation --------------------------------------------------//
+
+ template<
+ typename InputT,
+ typename FormatterT,
+ typename FindResultT,
+ typename FormatResultT >
+ inline InputT find_format_copy_impl2(
+ const InputT& Input,
+ FormatterT Formatter,
+ const FindResultT& FindResult,
+ const FormatResultT& FormatResult)
+ {
+ typedef find_format_store<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<InputT>::type,
+ FormatterT,
+ FormatResultT > store_type;
+
+ // Create store for the find result
+ store_type M( FindResult, FormatResult, Formatter );
+
+ if ( !M )
+ {
+ // Match not found - return original sequence
+ return InputT( Input );
+ }
+
+ InputT Output;
+ // Copy the beginning of the sequence
+ ndnboost::algorithm::detail::insert( Output, ::ndnboost::end(Output), ::ndnboost::begin(Input), M.begin() );
+ // Copy formatted result
+ ndnboost::algorithm::detail::insert( Output, ::ndnboost::end(Output), M.format_result() );
+ // Copy the rest of the sequence
+ ndnboost::algorithm::detail::insert( Output, ::ndnboost::end(Output), M.end(), ::ndnboost::end(Input) );
+
+ return Output;
+ }
+
+ template<
+ typename InputT,
+ typename FormatterT,
+ typename FindResultT >
+ inline InputT find_format_copy_impl(
+ const InputT& Input,
+ FormatterT Formatter,
+ const FindResultT& FindResult)
+ {
+ if( ::ndnboost::algorithm::detail::check_find_result(Input, FindResult) ) {
+ return ::ndnboost::algorithm::detail::find_format_copy_impl2(
+ Input,
+ Formatter,
+ FindResult,
+ Formatter(FindResult) );
+ } else {
+ return Input;
+ }
+ }
+
+ // replace implementation ----------------------------------------------------//
+
+ template<
+ typename InputT,
+ typename FormatterT,
+ typename FindResultT,
+ typename FormatResultT >
+ inline void find_format_impl2(
+ InputT& Input,
+ FormatterT Formatter,
+ const FindResultT& FindResult,
+ const FormatResultT& FormatResult)
+ {
+ typedef find_format_store<
+ BOOST_STRING_TYPENAME
+ range_iterator<InputT>::type,
+ FormatterT,
+ FormatResultT > store_type;
+
+ // Create store for the find result
+ store_type M( FindResult, FormatResult, Formatter );
+
+ if ( !M )
+ {
+ // Search not found - return original sequence
+ return;
+ }
+
+ // Replace match
+ ::ndnboost::algorithm::detail::replace( Input, M.begin(), M.end(), M.format_result() );
+ }
+
+ template<
+ typename InputT,
+ typename FormatterT,
+ typename FindResultT >
+ inline void find_format_impl(
+ InputT& Input,
+ FormatterT Formatter,
+ const FindResultT& FindResult)
+ {
+ if( ::ndnboost::algorithm::detail::check_find_result(Input, FindResult) ) {
+ ::ndnboost::algorithm::detail::find_format_impl2(
+ Input,
+ Formatter,
+ FindResult,
+ Formatter(FindResult) );
+ }
+ }
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+#endif // BOOST_STRING_FIND_FORMAT_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/detail/find_format_all.hpp b/ndnboost/algorithm/string/detail/find_format_all.hpp
new file mode 100644
index 0000000..ee0312a
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/find_format_all.hpp
@@ -0,0 +1,273 @@
+// Boost string_algo library find_format_all.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP
+#define BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+#include <ndnboost/range/value_type.hpp>
+#include <ndnboost/algorithm/string/detail/find_format_store.hpp>
+#include <ndnboost/algorithm/string/detail/replace_storage.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// find_format_all_copy (iterator variant) implementation ---------------------------//
+
+ template<
+ typename OutputIteratorT,
+ typename InputT,
+ typename FinderT,
+ typename FormatterT,
+ typename FindResultT,
+ typename FormatResultT >
+ inline OutputIteratorT find_format_all_copy_impl2(
+ OutputIteratorT Output,
+ const InputT& Input,
+ FinderT Finder,
+ FormatterT Formatter,
+ const FindResultT& FindResult,
+ const FormatResultT& FormatResult )
+ {
+ typedef BOOST_STRING_TYPENAME
+ range_const_iterator<InputT>::type input_iterator_type;
+
+ typedef find_format_store<
+ input_iterator_type,
+ FormatterT,
+ FormatResultT > store_type;
+
+ // Create store for the find result
+ store_type M( FindResult, FormatResult, Formatter );
+
+ // Initialize last match
+ input_iterator_type LastMatch=::ndnboost::begin(Input);
+
+ // Iterate through all matches
+ while( M )
+ {
+ // Copy the beginning of the sequence
+ Output = std::copy( LastMatch, M.begin(), Output );
+ // Copy formatted result
+ Output = std::copy( ::ndnboost::begin(M.format_result()), ::ndnboost::end(M.format_result()), Output );
+
+ // Proceed to the next match
+ LastMatch=M.end();
+ M=Finder( LastMatch, ::ndnboost::end(Input) );
+ }
+
+ // Copy the rest of the sequence
+ Output = std::copy( LastMatch, ::ndnboost::end(Input), Output );
+
+ return Output;
+ }
+
+ template<
+ typename OutputIteratorT,
+ typename InputT,
+ typename FinderT,
+ typename FormatterT,
+ typename FindResultT >
+ inline OutputIteratorT find_format_all_copy_impl(
+ OutputIteratorT Output,
+ const InputT& Input,
+ FinderT Finder,
+ FormatterT Formatter,
+ const FindResultT& FindResult )
+ {
+ if( ::ndnboost::algorithm::detail::check_find_result(Input, FindResult) ) {
+ return ::ndnboost::algorithm::detail::find_format_all_copy_impl2(
+ Output,
+ Input,
+ Finder,
+ Formatter,
+ FindResult,
+ Formatter(FindResult) );
+ } else {
+ return std::copy( ::ndnboost::begin(Input), ::ndnboost::end(Input), Output );
+ }
+ }
+
+ // find_format_all_copy implementation ----------------------------------------------//
+
+ template<
+ typename InputT,
+ typename FinderT,
+ typename FormatterT,
+ typename FindResultT,
+ typename FormatResultT >
+ inline InputT find_format_all_copy_impl2(
+ const InputT& Input,
+ FinderT Finder,
+ FormatterT Formatter,
+ const FindResultT& FindResult,
+ const FormatResultT& FormatResult)
+ {
+ typedef BOOST_STRING_TYPENAME
+ range_const_iterator<InputT>::type input_iterator_type;
+
+ typedef find_format_store<
+ input_iterator_type,
+ FormatterT,
+ FormatResultT > store_type;
+
+ // Create store for the find result
+ store_type M( FindResult, FormatResult, Formatter );
+
+ // Initialize last match
+ input_iterator_type LastMatch=::ndnboost::begin(Input);
+
+ // Output temporary
+ InputT Output;
+
+ // Iterate through all matches
+ while( M )
+ {
+ // Copy the beginning of the sequence
+ ndnboost::algorithm::detail::insert( Output, ::ndnboost::end(Output), LastMatch, M.begin() );
+ // Copy formatted result
+ ndnboost::algorithm::detail::insert( Output, ::ndnboost::end(Output), M.format_result() );
+
+ // Proceed to the next match
+ LastMatch=M.end();
+ M=Finder( LastMatch, ::ndnboost::end(Input) );
+ }
+
+ // Copy the rest of the sequence
+ ::ndnboost::algorithm::detail::insert( Output, ::ndnboost::end(Output), LastMatch, ::ndnboost::end(Input) );
+
+ return Output;
+ }
+
+ template<
+ typename InputT,
+ typename FinderT,
+ typename FormatterT,
+ typename FindResultT >
+ inline InputT find_format_all_copy_impl(
+ const InputT& Input,
+ FinderT Finder,
+ FormatterT Formatter,
+ const FindResultT& FindResult)
+ {
+ if( ::ndnboost::algorithm::detail::check_find_result(Input, FindResult) ) {
+ return ::ndnboost::algorithm::detail::find_format_all_copy_impl2(
+ Input,
+ Finder,
+ Formatter,
+ FindResult,
+ Formatter(FindResult) );
+ } else {
+ return Input;
+ }
+ }
+
+ // find_format_all implementation ------------------------------------------------//
+
+ template<
+ typename InputT,
+ typename FinderT,
+ typename FormatterT,
+ typename FindResultT,
+ typename FormatResultT >
+ inline void find_format_all_impl2(
+ InputT& Input,
+ FinderT Finder,
+ FormatterT Formatter,
+ FindResultT FindResult,
+ FormatResultT FormatResult)
+ {
+ typedef BOOST_STRING_TYPENAME
+ range_iterator<InputT>::type input_iterator_type;
+ typedef find_format_store<
+ input_iterator_type,
+ FormatterT,
+ FormatResultT > store_type;
+
+ // Create store for the find result
+ store_type M( FindResult, FormatResult, Formatter );
+
+ // Instantiate replacement storage
+ std::deque<
+ BOOST_STRING_TYPENAME range_value<InputT>::type> Storage;
+
+ // Initialize replacement iterators
+ input_iterator_type InsertIt=::ndnboost::begin(Input);
+ input_iterator_type SearchIt=::ndnboost::begin(Input);
+
+ while( M )
+ {
+ // process the segment
+ InsertIt=process_segment(
+ Storage,
+ Input,
+ InsertIt,
+ SearchIt,
+ M.begin() );
+
+ // Adjust search iterator
+ SearchIt=M.end();
+
+ // Copy formatted replace to the storage
+ ::ndnboost::algorithm::detail::copy_to_storage( Storage, M.format_result() );
+
+ // Find range for a next match
+ M=Finder( SearchIt, ::ndnboost::end(Input) );
+ }
+
+ // process the last segment
+ InsertIt=::ndnboost::algorithm::detail::process_segment(
+ Storage,
+ Input,
+ InsertIt,
+ SearchIt,
+ ::ndnboost::end(Input) );
+
+ if ( Storage.empty() )
+ {
+ // Truncate input
+ ::ndnboost::algorithm::detail::erase( Input, InsertIt, ::ndnboost::end(Input) );
+ }
+ else
+ {
+ // Copy remaining data to the end of input
+ ::ndnboost::algorithm::detail::insert( Input, ::ndnboost::end(Input), Storage.begin(), Storage.end() );
+ }
+ }
+
+ template<
+ typename InputT,
+ typename FinderT,
+ typename FormatterT,
+ typename FindResultT >
+ inline void find_format_all_impl(
+ InputT& Input,
+ FinderT Finder,
+ FormatterT Formatter,
+ FindResultT FindResult)
+ {
+ if( ::ndnboost::algorithm::detail::check_find_result(Input, FindResult) ) {
+ ::ndnboost::algorithm::detail::find_format_all_impl2(
+ Input,
+ Finder,
+ Formatter,
+ FindResult,
+ Formatter(FindResult) );
+ }
+ }
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+#endif // BOOST_STRING_FIND_FORMAT_ALL_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/detail/find_format_store.hpp b/ndnboost/algorithm/string/detail/find_format_store.hpp
new file mode 100644
index 0000000..d0d38bf
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/find_format_store.hpp
@@ -0,0 +1,89 @@
+// Boost string_algo library find_format_store.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP
+#define BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// temporary format and find result storage --------------------------------//
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
+#pragma warning(disable:4512) //assignment operator could not be generated
+#endif
+ template<
+ typename ForwardIteratorT,
+ typename FormatterT,
+ typename FormatResultT >
+ class find_format_store :
+ public iterator_range<ForwardIteratorT>
+ {
+ public:
+ // typedefs
+ typedef iterator_range<ForwardIteratorT> base_type;
+ typedef FormatterT formatter_type;
+ typedef FormatResultT format_result_type;
+
+ public:
+ // Construction
+ find_format_store(
+ const base_type& FindResult,
+ const format_result_type& FormatResult,
+ const formatter_type& Formatter ) :
+ base_type(FindResult),
+ m_FormatResult(FormatResult),
+ m_Formatter(Formatter) {}
+
+ // Assignment
+ template< typename FindResultT >
+ find_format_store& operator=( FindResultT FindResult )
+ {
+ iterator_range<ForwardIteratorT>::operator=(FindResult);
+ if( !this->empty() ) {
+ m_FormatResult=m_Formatter(FindResult);
+ }
+
+ return *this;
+ }
+
+ // Retrieve format result
+ const format_result_type& format_result()
+ {
+ return m_FormatResult;
+ }
+
+ private:
+ format_result_type m_FormatResult;
+ const formatter_type& m_Formatter;
+ };
+
+ template<typename InputT, typename FindResultT>
+ bool check_find_result(InputT&, FindResultT& FindResult)
+ {
+ typedef BOOST_STRING_TYPENAME
+ range_const_iterator<InputT>::type input_iterator_type;
+ iterator_range<input_iterator_type> ResultRange(FindResult);
+ return !ResultRange.empty();
+ }
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+#endif // BOOST_STRING_FIND_FORMAT_STORE_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/detail/finder.hpp b/ndnboost/algorithm/string/detail/finder.hpp
new file mode 100644
index 0000000..330c7a5
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/finder.hpp
@@ -0,0 +1,646 @@
+// Boost string_algo library finder.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2006.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FINDER_DETAIL_HPP
+#define BOOST_STRING_FINDER_DETAIL_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <ndnboost/algorithm/string/constants.hpp>
+#include <ndnboost/detail/iterator.hpp>
+
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/empty.hpp>
+#include <ndnboost/range/as_literal.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+
+// find first functor -----------------------------------------------//
+
+ // find a subsequence in the sequence ( functor )
+ /*
+ Returns a pair <begin,end> marking the subsequence in the sequence.
+ If the find fails, functor returns <End,End>
+ */
+ template<typename SearchIteratorT,typename PredicateT>
+ struct first_finderF
+ {
+ typedef SearchIteratorT search_iterator_type;
+
+ // Construction
+ template< typename SearchT >
+ first_finderF( const SearchT& Search, PredicateT Comp ) :
+ m_Search(::ndnboost::begin(Search), ::ndnboost::end(Search)), m_Comp(Comp) {}
+ first_finderF(
+ search_iterator_type SearchBegin,
+ search_iterator_type SearchEnd,
+ PredicateT Comp ) :
+ m_Search(SearchBegin, SearchEnd), m_Comp(Comp) {}
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ operator()(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End ) const
+ {
+ typedef iterator_range<ForwardIteratorT> result_type;
+ typedef ForwardIteratorT input_iterator_type;
+
+ // Outer loop
+ for(input_iterator_type OuterIt=Begin;
+ OuterIt!=End;
+ ++OuterIt)
+ {
+ // Sanity check
+ if( ndnboost::empty(m_Search) )
+ return result_type( End, End );
+
+ input_iterator_type InnerIt=OuterIt;
+ search_iterator_type SubstrIt=m_Search.begin();
+ for(;
+ InnerIt!=End && SubstrIt!=m_Search.end();
+ ++InnerIt,++SubstrIt)
+ {
+ if( !( m_Comp(*InnerIt,*SubstrIt) ) )
+ break;
+ }
+
+ // Substring matching succeeded
+ if ( SubstrIt==m_Search.end() )
+ return result_type( OuterIt, InnerIt );
+ }
+
+ return result_type( End, End );
+ }
+
+ private:
+ iterator_range<search_iterator_type> m_Search;
+ PredicateT m_Comp;
+ };
+
+// find last functor -----------------------------------------------//
+
+ // find the last match a subsequence in the sequence ( functor )
+ /*
+ Returns a pair <begin,end> marking the subsequence in the sequence.
+ If the find fails, returns <End,End>
+ */
+ template<typename SearchIteratorT, typename PredicateT>
+ struct last_finderF
+ {
+ typedef SearchIteratorT search_iterator_type;
+ typedef first_finderF<
+ search_iterator_type,
+ PredicateT> first_finder_type;
+
+ // Construction
+ template< typename SearchT >
+ last_finderF( const SearchT& Search, PredicateT Comp ) :
+ m_Search(::ndnboost::begin(Search), ::ndnboost::end(Search)), m_Comp(Comp) {}
+ last_finderF(
+ search_iterator_type SearchBegin,
+ search_iterator_type SearchEnd,
+ PredicateT Comp ) :
+ m_Search(SearchBegin, SearchEnd), m_Comp(Comp) {}
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ operator()(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End ) const
+ {
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ if( ndnboost::empty(m_Search) )
+ return result_type( End, End );
+
+ typedef BOOST_STRING_TYPENAME ndnboost::detail::
+ iterator_traits<ForwardIteratorT>::iterator_category category;
+
+ return findit( Begin, End, category() );
+ }
+
+ private:
+ // forward iterator
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ findit(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ std::forward_iterator_tag ) const
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ first_finder_type first_finder(
+ m_Search.begin(), m_Search.end(), m_Comp );
+
+ result_type M=first_finder( Begin, End );
+ result_type Last=M;
+
+ while( M )
+ {
+ Last=M;
+ M=first_finder( ::ndnboost::end(M), End );
+ }
+
+ return Last;
+ }
+
+ // bidirectional iterator
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ findit(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ std::bidirectional_iterator_tag ) const
+ {
+ typedef iterator_range<ForwardIteratorT> result_type;
+ typedef ForwardIteratorT input_iterator_type;
+
+ // Outer loop
+ for(input_iterator_type OuterIt=End;
+ OuterIt!=Begin; )
+ {
+ input_iterator_type OuterIt2=--OuterIt;
+
+ input_iterator_type InnerIt=OuterIt2;
+ search_iterator_type SubstrIt=m_Search.begin();
+ for(;
+ InnerIt!=End && SubstrIt!=m_Search.end();
+ ++InnerIt,++SubstrIt)
+ {
+ if( !( m_Comp(*InnerIt,*SubstrIt) ) )
+ break;
+ }
+
+ // Substring matching succeeded
+ if( SubstrIt==m_Search.end() )
+ return result_type( OuterIt2, InnerIt );
+ }
+
+ return result_type( End, End );
+ }
+
+ private:
+ iterator_range<search_iterator_type> m_Search;
+ PredicateT m_Comp;
+ };
+
+// find n-th functor -----------------------------------------------//
+
+ // find the n-th match of a subsequence in the sequence ( functor )
+ /*
+ Returns a pair <begin,end> marking the subsequence in the sequence.
+ If the find fails, returns <End,End>
+ */
+ template<typename SearchIteratorT, typename PredicateT>
+ struct nth_finderF
+ {
+ typedef SearchIteratorT search_iterator_type;
+ typedef first_finderF<
+ search_iterator_type,
+ PredicateT> first_finder_type;
+ typedef last_finderF<
+ search_iterator_type,
+ PredicateT> last_finder_type;
+
+ // Construction
+ template< typename SearchT >
+ nth_finderF(
+ const SearchT& Search,
+ int Nth,
+ PredicateT Comp) :
+ m_Search(::ndnboost::begin(Search), ::ndnboost::end(Search)),
+ m_Nth(Nth),
+ m_Comp(Comp) {}
+ nth_finderF(
+ search_iterator_type SearchBegin,
+ search_iterator_type SearchEnd,
+ int Nth,
+ PredicateT Comp) :
+ m_Search(SearchBegin, SearchEnd),
+ m_Nth(Nth),
+ m_Comp(Comp) {}
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ operator()(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End ) const
+ {
+ if(m_Nth>=0)
+ {
+ return find_forward(Begin, End, m_Nth);
+ }
+ else
+ {
+ return find_backward(Begin, End, -m_Nth);
+ }
+
+ }
+
+ private:
+ // Implementation helpers
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_forward(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N) const
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ // Sanity check
+ if( ndnboost::empty(m_Search) )
+ return result_type( End, End );
+
+ // Instantiate find functor
+ first_finder_type first_finder(
+ m_Search.begin(), m_Search.end(), m_Comp );
+
+ result_type M( Begin, Begin );
+
+ for( unsigned int n=0; n<=N; ++n )
+ {
+ // find next match
+ M=first_finder( ::ndnboost::end(M), End );
+
+ if ( !M )
+ {
+ // Subsequence not found, return
+ return M;
+ }
+ }
+
+ return M;
+ }
+
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_backward(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N) const
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ // Sanity check
+ if( ndnboost::empty(m_Search) )
+ return result_type( End, End );
+
+ // Instantiate find functor
+ last_finder_type last_finder(
+ m_Search.begin(), m_Search.end(), m_Comp );
+
+ result_type M( End, End );
+
+ for( unsigned int n=1; n<=N; ++n )
+ {
+ // find next match
+ M=last_finder( Begin, ::ndnboost::begin(M) );
+
+ if ( !M )
+ {
+ // Subsequence not found, return
+ return M;
+ }
+ }
+
+ return M;
+ }
+
+
+ private:
+ iterator_range<search_iterator_type> m_Search;
+ int m_Nth;
+ PredicateT m_Comp;
+ };
+
+// find head/tail implementation helpers ---------------------------//
+
+ template<typename ForwardIteratorT>
+ iterator_range<ForwardIteratorT>
+ find_head_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N,
+ std::forward_iterator_tag )
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ input_iterator_type It=Begin;
+ for(
+ unsigned int Index=0;
+ Index<N && It!=End; ++Index,++It ) {};
+
+ return result_type( Begin, It );
+ }
+
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_head_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N,
+ std::random_access_iterator_tag )
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < N ) )
+ return result_type( Begin, End );
+
+ return result_type(Begin,Begin+N);
+ }
+
+ // Find head implementation
+ template<typename ForwardIteratorT>
+ iterator_range<ForwardIteratorT>
+ find_head_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N )
+ {
+ typedef BOOST_STRING_TYPENAME ndnboost::detail::
+ iterator_traits<ForwardIteratorT>::iterator_category category;
+
+ return ::ndnboost::algorithm::detail::find_head_impl( Begin, End, N, category() );
+ }
+
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_tail_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N,
+ std::forward_iterator_tag )
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ unsigned int Index=0;
+ input_iterator_type It=Begin;
+ input_iterator_type It2=Begin;
+
+ // Advance It2 by N increments
+ for( Index=0; Index<N && It2!=End; ++Index,++It2 ) {};
+
+ // Advance It, It2 to the end
+ for(; It2!=End; ++It,++It2 ) {};
+
+ return result_type( It, It2 );
+ }
+
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_tail_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N,
+ std::bidirectional_iterator_tag )
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ input_iterator_type It=End;
+ for(
+ unsigned int Index=0;
+ Index<N && It!=Begin; ++Index,--It ) {};
+
+ return result_type( It, End );
+ }
+
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_tail_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N,
+ std::random_access_iterator_tag )
+ {
+ typedef ForwardIteratorT input_iterator_type;
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < N ) )
+ return result_type( Begin, End );
+
+ return result_type( End-N, End );
+ }
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ find_tail_impl(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End,
+ unsigned int N )
+ {
+ typedef BOOST_STRING_TYPENAME ndnboost::detail::
+ iterator_traits<ForwardIteratorT>::iterator_category category;
+
+ return ::ndnboost::algorithm::detail::find_tail_impl( Begin, End, N, category() );
+ }
+
+
+
+// find head functor -----------------------------------------------//
+
+
+ // find a head in the sequence ( functor )
+ /*
+ This functor find a head of the specified range. For
+ a specified N, the head is a subsequence of N starting
+ elements of the range.
+ */
+ struct head_finderF
+ {
+ // Construction
+ head_finderF( int N ) : m_N(N) {}
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ operator()(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End ) const
+ {
+ if(m_N>=0)
+ {
+ return ::ndnboost::algorithm::detail::find_head_impl( Begin, End, m_N );
+ }
+ else
+ {
+ iterator_range<ForwardIteratorT> Res=
+ ::ndnboost::algorithm::detail::find_tail_impl( Begin, End, -m_N );
+
+ return ::ndnboost::make_iterator_range(Begin, Res.begin());
+ }
+ }
+
+ private:
+ int m_N;
+ };
+
+// find tail functor -----------------------------------------------//
+
+
+ // find a tail in the sequence ( functor )
+ /*
+ This functor find a tail of the specified range. For
+ a specified N, the head is a subsequence of N starting
+ elements of the range.
+ */
+ struct tail_finderF
+ {
+ // Construction
+ tail_finderF( int N ) : m_N(N) {}
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ operator()(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End ) const
+ {
+ if(m_N>=0)
+ {
+ return ::ndnboost::algorithm::detail::find_tail_impl( Begin, End, m_N );
+ }
+ else
+ {
+ iterator_range<ForwardIteratorT> Res=
+ ::ndnboost::algorithm::detail::find_head_impl( Begin, End, -m_N );
+
+ return ::ndnboost::make_iterator_range(Res.end(), End);
+ }
+ }
+
+ private:
+ int m_N;
+ };
+
+// find token functor -----------------------------------------------//
+
+ // find a token in a sequence ( functor )
+ /*
+ This find functor finds a token specified be a predicate
+ in a sequence. It is equivalent of std::find algorithm,
+ with an exception that it return range instead of a single
+ iterator.
+
+ If bCompress is set to true, adjacent matching tokens are
+ concatenated into one match.
+ */
+ template< typename PredicateT >
+ struct token_finderF
+ {
+ // Construction
+ token_finderF(
+ PredicateT Pred,
+ token_compress_mode_type eCompress=token_compress_off ) :
+ m_Pred(Pred), m_eCompress(eCompress) {}
+
+ // Operation
+ template< typename ForwardIteratorT >
+ iterator_range<ForwardIteratorT>
+ operator()(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End ) const
+ {
+ typedef iterator_range<ForwardIteratorT> result_type;
+
+ ForwardIteratorT It=std::find_if( Begin, End, m_Pred );
+
+ if( It==End )
+ {
+ return result_type( End, End );
+ }
+ else
+ {
+ ForwardIteratorT It2=It;
+
+ if( m_eCompress==token_compress_on )
+ {
+ // Find first non-matching character
+ while( It2!=End && m_Pred(*It2) ) ++It2;
+ }
+ else
+ {
+ // Advance by one position
+ ++It2;
+ }
+
+ return result_type( It, It2 );
+ }
+ }
+
+ private:
+ PredicateT m_Pred;
+ token_compress_mode_type m_eCompress;
+ };
+
+// find range functor -----------------------------------------------//
+
+ // find a range in the sequence ( functor )
+ /*
+ This functor actually does not perform any find operation.
+ It always returns given iterator range as a result.
+ */
+ template<typename ForwardIterator1T>
+ struct range_finderF
+ {
+ typedef ForwardIterator1T input_iterator_type;
+ typedef iterator_range<input_iterator_type> result_type;
+
+ // Construction
+ range_finderF(
+ input_iterator_type Begin,
+ input_iterator_type End ) : m_Range(Begin, End) {}
+
+ range_finderF(const iterator_range<input_iterator_type>& Range) :
+ m_Range(Range) {}
+
+ // Operation
+ template< typename ForwardIterator2T >
+ iterator_range<ForwardIterator2T>
+ operator()(
+ ForwardIterator2T,
+ ForwardIterator2T ) const
+ {
+#if BOOST_WORKAROUND( __MWERKS__, <= 0x3003 )
+ return iterator_range<const ForwardIterator2T>(this->m_Range);
+#elif BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ return iterator_range<ForwardIterator2T>(m_Range.begin(), m_Range.end());
+#else
+ return m_Range;
+#endif
+ }
+
+ private:
+ iterator_range<input_iterator_type> m_Range;
+ };
+
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+#endif // BOOST_STRING_FINDER_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/detail/formatter.hpp b/ndnboost/algorithm/string/detail/formatter.hpp
new file mode 100644
index 0000000..0307310
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/formatter.hpp
@@ -0,0 +1,119 @@
+// Boost string_algo library formatter.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FORMATTER_DETAIL_HPP
+#define BOOST_STRING_FORMATTER_DETAIL_HPP
+
+
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+
+#include <ndnboost/algorithm/string/detail/util.hpp>
+
+// generic replace functors -----------------------------------------------//
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// const format functor ----------------------------------------------------//
+
+ // constant format functor
+ template<typename RangeT>
+ struct const_formatF
+ {
+ private:
+ typedef BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type format_iterator;
+ typedef iterator_range<format_iterator> result_type;
+
+ public:
+ // Construction
+ const_formatF(const RangeT& Format) :
+ m_Format(::ndnboost::begin(Format), ::ndnboost::end(Format)) {}
+
+ // Operation
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ template<typename Range2T>
+ result_type& operator()(const Range2T&)
+ {
+ return m_Format;
+ }
+#endif
+
+ template<typename Range2T>
+ const result_type& operator()(const Range2T&) const
+ {
+ return m_Format;
+ }
+
+ private:
+ result_type m_Format;
+ };
+
+// identity format functor ----------------------------------------------------//
+
+ // identity format functor
+ template<typename RangeT>
+ struct identity_formatF
+ {
+ // Operation
+ template< typename Range2T >
+ const RangeT& operator()(const Range2T& Replace) const
+ {
+ return RangeT(::ndnboost::begin(Replace), ::ndnboost::end(Replace));
+ }
+ };
+
+// empty format functor ( used by erase ) ------------------------------------//
+
+ // empty format functor
+ template< typename CharT >
+ struct empty_formatF
+ {
+ template< typename ReplaceT >
+ empty_container<CharT> operator()(const ReplaceT&) const
+ {
+ return empty_container<CharT>();
+ }
+ };
+
+// dissect format functor ----------------------------------------------------//
+
+ // dissect format functor
+ template<typename FinderT>
+ struct dissect_formatF
+ {
+ public:
+ // Construction
+ dissect_formatF(FinderT Finder) :
+ m_Finder(Finder) {}
+
+ // Operation
+ template<typename RangeT>
+ inline iterator_range<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
+ operator()(const RangeT& Replace) const
+ {
+ return m_Finder(::ndnboost::begin(Replace), ::ndnboost::end(Replace));
+ }
+
+ private:
+ FinderT m_Finder;
+ };
+
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+#endif // BOOST_STRING_FORMATTER_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/detail/replace_storage.hpp b/ndnboost/algorithm/string/detail/replace_storage.hpp
new file mode 100644
index 0000000..6fb6c54
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/replace_storage.hpp
@@ -0,0 +1,159 @@
+// Boost string_algo library replace_storage.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
+#define BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <algorithm>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/algorithm/string/sequence_traits.hpp>
+#include <ndnboost/algorithm/string/detail/sequence.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// storage handling routines -----------------------------------------------//
+
+ template< typename StorageT, typename OutputIteratorT >
+ inline OutputIteratorT move_from_storage(
+ StorageT& Storage,
+ OutputIteratorT DestBegin,
+ OutputIteratorT DestEnd )
+ {
+ OutputIteratorT OutputIt=DestBegin;
+
+ while( !Storage.empty() && OutputIt!=DestEnd )
+ {
+ *OutputIt=Storage.front();
+ Storage.pop_front();
+ ++OutputIt;
+ }
+
+ return OutputIt;
+ }
+
+ template< typename StorageT, typename WhatT >
+ inline void copy_to_storage(
+ StorageT& Storage,
+ const WhatT& What )
+ {
+ Storage.insert( Storage.end(), ::ndnboost::begin(What), ::ndnboost::end(What) );
+ }
+
+
+// process segment routine -----------------------------------------------//
+
+ template< bool HasStableIterators >
+ struct process_segment_helper
+ {
+ // Optimized version of process_segment for generic sequence
+ template<
+ typename StorageT,
+ typename InputT,
+ typename ForwardIteratorT >
+ ForwardIteratorT operator()(
+ StorageT& Storage,
+ InputT& /*Input*/,
+ ForwardIteratorT InsertIt,
+ ForwardIteratorT SegmentBegin,
+ ForwardIteratorT SegmentEnd )
+ {
+ // Copy data from the storage until the beginning of the segment
+ ForwardIteratorT It=::ndnboost::algorithm::detail::move_from_storage( Storage, InsertIt, SegmentBegin );
+
+ // 3 cases are possible :
+ // a) Storage is empty, It==SegmentBegin
+ // b) Storage is empty, It!=SegmentBegin
+ // c) Storage is not empty
+
+ if( Storage.empty() )
+ {
+ if( It==SegmentBegin )
+ {
+ // Case a) everything is grand, just return end of segment
+ return SegmentEnd;
+ }
+ else
+ {
+ // Case b) move the segment backwards
+ return std::copy( SegmentBegin, SegmentEnd, It );
+ }
+ }
+ else
+ {
+ // Case c) -> shift the segment to the left and keep the overlap in the storage
+ while( It!=SegmentEnd )
+ {
+ // Store value into storage
+ Storage.push_back( *It );
+ // Get the top from the storage and put it here
+ *It=Storage.front();
+ Storage.pop_front();
+
+ // Advance
+ ++It;
+ }
+
+ return It;
+ }
+ }
+ };
+
+ template<>
+ struct process_segment_helper< true >
+ {
+ // Optimized version of process_segment for list-like sequence
+ template<
+ typename StorageT,
+ typename InputT,
+ typename ForwardIteratorT >
+ ForwardIteratorT operator()(
+ StorageT& Storage,
+ InputT& Input,
+ ForwardIteratorT InsertIt,
+ ForwardIteratorT SegmentBegin,
+ ForwardIteratorT SegmentEnd )
+
+ {
+ // Call replace to do the job
+ ::ndnboost::algorithm::detail::replace( Input, InsertIt, SegmentBegin, Storage );
+ // Empty the storage
+ Storage.clear();
+ // Iterators were not changed, simply return the end of segment
+ return SegmentEnd;
+ }
+ };
+
+ // Process one segment in the replace_all algorithm
+ template<
+ typename StorageT,
+ typename InputT,
+ typename ForwardIteratorT >
+ inline ForwardIteratorT process_segment(
+ StorageT& Storage,
+ InputT& Input,
+ ForwardIteratorT InsertIt,
+ ForwardIteratorT SegmentBegin,
+ ForwardIteratorT SegmentEnd )
+ {
+ return
+ process_segment_helper<
+ has_stable_iterators<InputT>::value>()(
+ Storage, Input, InsertIt, SegmentBegin, SegmentEnd );
+ }
+
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+#endif // BOOST_STRING_REPLACE_STORAGE_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/detail/sequence.hpp b/ndnboost/algorithm/string/detail/sequence.hpp
new file mode 100644
index 0000000..0b39a8b
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/sequence.hpp
@@ -0,0 +1,200 @@
+// Boost string_algo library sequence.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_DETAIL_SEQUENCE_HPP
+#define BOOST_STRING_DETAIL_SEQUENCE_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/logical.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+
+#include <ndnboost/algorithm/string/sequence_traits.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// insert helpers -------------------------------------------------//
+
+ template< typename InputT, typename ForwardIteratorT >
+ inline void insert(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator At,
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ Input.insert( At, Begin, End );
+ }
+
+ template< typename InputT, typename InsertT >
+ inline void insert(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator At,
+ const InsertT& Insert )
+ {
+ ::ndnboost::algorithm::detail::insert( Input, At, ::ndnboost::begin(Insert), ::ndnboost::end(Insert) );
+ }
+
+// erase helper ---------------------------------------------------//
+
+ // Erase a range in the sequence
+ /*
+ Returns the iterator pointing just after the erase subrange
+ */
+ template< typename InputT >
+ inline typename InputT::iterator erase(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To )
+ {
+ return Input.erase( From, To );
+ }
+
+// replace helper implementation ----------------------------------//
+
+ // Optimized version of replace for generic sequence containers
+ // Assumption: insert and erase are expensive
+ template< bool HasConstTimeOperations >
+ struct replace_const_time_helper
+ {
+ template< typename InputT, typename ForwardIteratorT >
+ void operator()(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To,
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ // Copy data to the container ( as much as possible )
+ ForwardIteratorT InsertIt=Begin;
+ BOOST_STRING_TYPENAME InputT::iterator InputIt=From;
+ for(; InsertIt!=End && InputIt!=To; InsertIt++, InputIt++ )
+ {
+ *InputIt=*InsertIt;
+ }
+
+ if ( InsertIt!=End )
+ {
+ // Replace sequence is longer, insert it
+ Input.insert( InputIt, InsertIt, End );
+ }
+ else
+ {
+ if ( InputIt!=To )
+ {
+ // Replace sequence is shorter, erase the rest
+ Input.erase( InputIt, To );
+ }
+ }
+ }
+ };
+
+ template<>
+ struct replace_const_time_helper< true >
+ {
+ // Const-time erase and insert methods -> use them
+ template< typename InputT, typename ForwardIteratorT >
+ void operator()(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To,
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ BOOST_STRING_TYPENAME InputT::iterator At=Input.erase( From, To );
+ if ( Begin!=End )
+ {
+ if(!Input.empty())
+ {
+ Input.insert( At, Begin, End );
+ }
+ else
+ {
+ Input.insert( Input.begin(), Begin, End );
+ }
+ }
+ }
+ };
+
+ // No native replace method
+ template< bool HasNative >
+ struct replace_native_helper
+ {
+ template< typename InputT, typename ForwardIteratorT >
+ void operator()(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To,
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ replace_const_time_helper<
+ ndnboost::mpl::and_<
+ has_const_time_insert<InputT>,
+ has_const_time_erase<InputT> >::value >()(
+ Input, From, To, Begin, End );
+ }
+ };
+
+ // Container has native replace method
+ template<>
+ struct replace_native_helper< true >
+ {
+ template< typename InputT, typename ForwardIteratorT >
+ void operator()(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To,
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ Input.replace( From, To, Begin, End );
+ }
+ };
+
+// replace helper -------------------------------------------------//
+
+ template< typename InputT, typename ForwardIteratorT >
+ inline void replace(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To,
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ replace_native_helper< has_native_replace<InputT>::value >()(
+ Input, From, To, Begin, End );
+ }
+
+ template< typename InputT, typename InsertT >
+ inline void replace(
+ InputT& Input,
+ BOOST_STRING_TYPENAME InputT::iterator From,
+ BOOST_STRING_TYPENAME InputT::iterator To,
+ const InsertT& Insert )
+ {
+ if(From!=To)
+ {
+ ::ndnboost::algorithm::detail::replace( Input, From, To, ::ndnboost::begin(Insert), ::ndnboost::end(Insert) );
+ }
+ else
+ {
+ ::ndnboost::algorithm::detail::insert( Input, From, ::ndnboost::begin(Insert), ::ndnboost::end(Insert) );
+ }
+ }
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_DETAIL_SEQUENCE_HPP
diff --git a/ndnboost/algorithm/string/detail/util.hpp b/ndnboost/algorithm/string/detail/util.hpp
new file mode 100644
index 0000000..fa34548
--- /dev/null
+++ b/ndnboost/algorithm/string/detail/util.hpp
@@ -0,0 +1,106 @@
+// Boost string_algo library util.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_UTIL_DETAIL_HPP
+#define BOOST_STRING_UTIL_DETAIL_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+#include <functional>
+#include <ndnboost/range/iterator_range.hpp>
+
+namespace ndnboost {
+ namespace algorithm {
+ namespace detail {
+
+// empty container -----------------------------------------------//
+
+ // empty_container
+ /*
+ This class represents always empty container,
+ containing elements of type CharT.
+
+ It is supposed to be used in a const version only
+ */
+ template< typename CharT >
+ struct empty_container
+ {
+ typedef empty_container<CharT> type;
+ typedef CharT value_type;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+ typedef const value_type& reference;
+ typedef const value_type& const_reference;
+ typedef const value_type* iterator;
+ typedef const value_type* const_iterator;
+
+
+ // Operations
+ const_iterator begin() const
+ {
+ return reinterpret_cast<const_iterator>(0);
+ }
+
+ const_iterator end() const
+ {
+ return reinterpret_cast<const_iterator>(0);
+ }
+
+ bool empty() const
+ {
+ return false;
+ }
+
+ size_type size() const
+ {
+ return 0;
+ }
+ };
+
+// bounded copy algorithm -----------------------------------------------//
+
+ // Bounded version of the std::copy algorithm
+ template<typename InputIteratorT, typename OutputIteratorT>
+ inline OutputIteratorT bounded_copy(
+ InputIteratorT First,
+ InputIteratorT Last,
+ OutputIteratorT DestFirst,
+ OutputIteratorT DestLast )
+ {
+ InputIteratorT InputIt=First;
+ OutputIteratorT OutputIt=DestFirst;
+ for(; InputIt!=Last && OutputIt!=DestLast; InputIt++, OutputIt++ )
+ {
+ *OutputIt=*InputIt;
+ }
+
+ return OutputIt;
+ }
+
+// iterator range utilities -----------------------------------------//
+
+ // copy range functor
+ template<
+ typename SeqT,
+ typename IteratorT=BOOST_STRING_TYPENAME SeqT::const_iterator >
+ struct copy_iterator_rangeF :
+ public std::unary_function< iterator_range<IteratorT>, SeqT >
+ {
+ SeqT operator()( const iterator_range<IteratorT>& Range ) const
+ {
+ return copy_range<SeqT>(Range);
+ }
+ };
+
+ } // namespace detail
+ } // namespace algorithm
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_UTIL_DETAIL_HPP
diff --git a/ndnboost/algorithm/string/find_format.hpp b/ndnboost/algorithm/string/find_format.hpp
new file mode 100644
index 0000000..5352eba
--- /dev/null
+++ b/ndnboost/algorithm/string/find_format.hpp
@@ -0,0 +1,287 @@
+// Boost string_algo library find_format.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FIND_FORMAT_HPP
+#define BOOST_STRING_FIND_FORMAT_HPP
+
+#include <deque>
+#include <ndnboost/detail/iterator.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+#include <ndnboost/range/as_literal.hpp>
+
+#include <ndnboost/algorithm/string/concept.hpp>
+#include <ndnboost/algorithm/string/detail/find_format.hpp>
+#include <ndnboost/algorithm/string/detail/find_format_all.hpp>
+
+/*! \file
+ Defines generic replace algorithms. Each algorithm replaces
+ part(s) of the input. The part to be replaced is looked up using a Finder object.
+ Result of finding is then used by a Formatter object to generate the replacement.
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+// generic replace -----------------------------------------------------------------//
+
+ //! Generic replace algorithm
+ /*!
+ Use the Finder to search for a substring. Use the Formatter to format
+ this substring and replace it in the input.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input sequence
+ \param Finder A Finder object used to search for a match to be replaced
+ \param Formatter A Formatter object used to format a match
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename RangeT,
+ typename FinderT,
+ typename FormatterT>
+ inline OutputIteratorT find_format_copy(
+ OutputIteratorT Output,
+ const RangeT& Input,
+ FinderT Finder,
+ FormatterT Formatter )
+ {
+ // Concept check
+ BOOST_CONCEPT_ASSERT((
+ FinderConcept<
+ FinderT,
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ FormatterConcept<
+ FormatterT,
+ FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
+ ));
+
+ iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::ndnboost::as_literal(Input));
+
+ return detail::find_format_copy_impl(
+ Output,
+ lit_input,
+ Formatter,
+ Finder( ::ndnboost::begin(lit_input), ::ndnboost::end(lit_input) ) );
+ }
+
+ //! Generic replace algorithm
+ /*!
+ \overload
+ */
+ template<
+ typename SequenceT,
+ typename FinderT,
+ typename FormatterT>
+ inline SequenceT find_format_copy(
+ const SequenceT& Input,
+ FinderT Finder,
+ FormatterT Formatter )
+ {
+ // Concept check
+ BOOST_CONCEPT_ASSERT((
+ FinderConcept<
+ FinderT,
+ BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ FormatterConcept<
+ FormatterT,
+ FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+
+ return detail::find_format_copy_impl(
+ Input,
+ Formatter,
+ Finder(::ndnboost::begin(Input), ::ndnboost::end(Input)));
+ }
+
+ //! Generic replace algorithm
+ /*!
+ Use the Finder to search for a substring. Use the Formatter to format
+ this substring and replace it in the input. The input is modified in-place.
+
+ \param Input An input sequence
+ \param Finder A Finder object used to search for a match to be replaced
+ \param Formatter A Formatter object used to format a match
+ */
+ template<
+ typename SequenceT,
+ typename FinderT,
+ typename FormatterT>
+ inline void find_format(
+ SequenceT& Input,
+ FinderT Finder,
+ FormatterT Formatter)
+ {
+ // Concept check
+ BOOST_CONCEPT_ASSERT((
+ FinderConcept<
+ FinderT,
+ BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ FormatterConcept<
+ FormatterT,
+ FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+
+ detail::find_format_impl(
+ Input,
+ Formatter,
+ Finder(::ndnboost::begin(Input), ::ndnboost::end(Input)));
+ }
+
+
+// find_format_all generic ----------------------------------------------------------------//
+
+ //! Generic replace all algorithm
+ /*!
+ Use the Finder to search for a substring. Use the Formatter to format
+ this substring and replace it in the input. Repeat this for all matching
+ substrings.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input sequence
+ \param Finder A Finder object used to search for a match to be replaced
+ \param Formatter A Formatter object used to format a match
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename RangeT,
+ typename FinderT,
+ typename FormatterT>
+ inline OutputIteratorT find_format_all_copy(
+ OutputIteratorT Output,
+ const RangeT& Input,
+ FinderT Finder,
+ FormatterT Formatter)
+ {
+ // Concept check
+ BOOST_CONCEPT_ASSERT((
+ FinderConcept<
+ FinderT,
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ FormatterConcept<
+ FormatterT,
+ FinderT,BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type>
+ ));
+
+ iterator_range<BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> lit_input(::ndnboost::as_literal(Input));
+
+ return detail::find_format_all_copy_impl(
+ Output,
+ lit_input,
+ Finder,
+ Formatter,
+ Finder(::ndnboost::begin(lit_input), ::ndnboost::end(lit_input)));
+ }
+
+ //! Generic replace all algorithm
+ /*!
+ \overload
+ */
+ template<
+ typename SequenceT,
+ typename FinderT,
+ typename FormatterT >
+ inline SequenceT find_format_all_copy(
+ const SequenceT& Input,
+ FinderT Finder,
+ FormatterT Formatter )
+ {
+ // Concept check
+ BOOST_CONCEPT_ASSERT((
+ FinderConcept<
+ FinderT,
+ BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ FormatterConcept<
+ FormatterT,
+ FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+
+ return detail::find_format_all_copy_impl(
+ Input,
+ Finder,
+ Formatter,
+ Finder( ::ndnboost::begin(Input), ::ndnboost::end(Input) ) );
+ }
+
+ //! Generic replace all algorithm
+ /*!
+ Use the Finder to search for a substring. Use the Formatter to format
+ this substring and replace it in the input. Repeat this for all matching
+ substrings.The input is modified in-place.
+
+ \param Input An input sequence
+ \param Finder A Finder object used to search for a match to be replaced
+ \param Formatter A Formatter object used to format a match
+ */
+ template<
+ typename SequenceT,
+ typename FinderT,
+ typename FormatterT >
+ inline void find_format_all(
+ SequenceT& Input,
+ FinderT Finder,
+ FormatterT Formatter )
+ {
+ // Concept check
+ BOOST_CONCEPT_ASSERT((
+ FinderConcept<
+ FinderT,
+ BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+ BOOST_CONCEPT_ASSERT((
+ FormatterConcept<
+ FormatterT,
+ FinderT,BOOST_STRING_TYPENAME range_const_iterator<SequenceT>::type>
+ ));
+
+ detail::find_format_all_impl(
+ Input,
+ Finder,
+ Formatter,
+ Finder(::ndnboost::begin(Input), ::ndnboost::end(Input)));
+
+ }
+
+ } // namespace algorithm
+
+ // pull the names to the boost namespace
+ using algorithm::find_format_copy;
+ using algorithm::find_format;
+ using algorithm::find_format_all_copy;
+ using algorithm::find_format_all;
+
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_FIND_FORMAT_HPP
diff --git a/ndnboost/algorithm/string/finder.hpp b/ndnboost/algorithm/string/finder.hpp
new file mode 100644
index 0000000..420e015
--- /dev/null
+++ b/ndnboost/algorithm/string/finder.hpp
@@ -0,0 +1,270 @@
+// Boost string_algo library finder.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2006.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FINDER_HPP
+#define BOOST_STRING_FINDER_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+
+#include <ndnboost/algorithm/string/constants.hpp>
+#include <ndnboost/algorithm/string/detail/finder.hpp>
+#include <ndnboost/algorithm/string/compare.hpp>
+
+/*! \file
+ Defines Finder generators. Finder object is a functor which is able to
+ find a substring matching a specific criteria in the input.
+ Finders are used as a pluggable components for replace, find
+ and split facilities. This header contains generator functions
+ for finders provided in this library.
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+// Finder generators ------------------------------------------//
+
+ //! "First" finder
+ /*!
+ Construct the \c first_finder. The finder searches for the first
+ occurrence of the string in a given input.
+ The result is given as an \c iterator_range delimiting the match.
+
+ \param Search A substring to be searched for.
+ \param Comp An element comparison predicate
+ \return An instance of the \c first_finder object
+ */
+ template<typename RangeT>
+ inline detail::first_finderF<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
+ is_equal>
+ first_finder( const RangeT& Search )
+ {
+ return
+ detail::first_finderF<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type,
+ is_equal>( ::ndnboost::as_literal(Search), is_equal() ) ;
+ }
+
+ //! "First" finder
+ /*!
+ \overload
+ */
+ template<typename RangeT,typename PredicateT>
+ inline detail::first_finderF<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
+ PredicateT>
+ first_finder(
+ const RangeT& Search, PredicateT Comp )
+ {
+ return
+ detail::first_finderF<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type,
+ PredicateT>( ::ndnboost::as_literal(Search), Comp );
+ }
+
+ //! "Last" finder
+ /*!
+ Construct the \c last_finder. The finder searches for the last
+ occurrence of the string in a given input.
+ The result is given as an \c iterator_range delimiting the match.
+
+ \param Search A substring to be searched for.
+ \param Comp An element comparison predicate
+ \return An instance of the \c last_finder object
+ */
+ template<typename RangeT>
+ inline detail::last_finderF<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
+ is_equal>
+ last_finder( const RangeT& Search )
+ {
+ return
+ detail::last_finderF<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type,
+ is_equal>( ::ndnboost::as_literal(Search), is_equal() );
+ }
+ //! "Last" finder
+ /*!
+ \overload
+ */
+ template<typename RangeT, typename PredicateT>
+ inline detail::last_finderF<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
+ PredicateT>
+ last_finder( const RangeT& Search, PredicateT Comp )
+ {
+ return
+ detail::last_finderF<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type,
+ PredicateT>( ::ndnboost::as_literal(Search), Comp ) ;
+ }
+
+ //! "Nth" finder
+ /*!
+ Construct the \c nth_finder. The finder searches for the n-th (zero-indexed)
+ occurrence of the string in a given input.
+ The result is given as an \c iterator_range delimiting the match.
+
+ \param Search A substring to be searched for.
+ \param Nth An index of the match to be find
+ \param Comp An element comparison predicate
+ \return An instance of the \c nth_finder object
+ */
+ template<typename RangeT>
+ inline detail::nth_finderF<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
+ is_equal>
+ nth_finder(
+ const RangeT& Search,
+ int Nth)
+ {
+ return
+ detail::nth_finderF<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type,
+ is_equal>( ::ndnboost::as_literal(Search), Nth, is_equal() ) ;
+ }
+ //! "Nth" finder
+ /*!
+ \overload
+ */
+ template<typename RangeT, typename PredicateT>
+ inline detail::nth_finderF<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type,
+ PredicateT>
+ nth_finder(
+ const RangeT& Search,
+ int Nth,
+ PredicateT Comp )
+ {
+ return
+ detail::nth_finderF<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<RangeT>::type,
+ PredicateT>( ::ndnboost::as_literal(Search), Nth, Comp );
+ }
+
+ //! "Head" finder
+ /*!
+ Construct the \c head_finder. The finder returns a head of a given
+ input. The head is a prefix of a string up to n elements in
+ size. If an input has less then n elements, whole input is
+ considered a head.
+ The result is given as an \c iterator_range delimiting the match.
+
+ \param N The size of the head
+ \return An instance of the \c head_finder object
+ */
+ inline detail::head_finderF
+ head_finder( int N )
+ {
+ return detail::head_finderF(N);
+ }
+
+ //! "Tail" finder
+ /*!
+ Construct the \c tail_finder. The finder returns a tail of a given
+ input. The tail is a suffix of a string up to n elements in
+ size. If an input has less then n elements, whole input is
+ considered a head.
+ The result is given as an \c iterator_range delimiting the match.
+
+ \param N The size of the head
+ \return An instance of the \c tail_finder object
+ */
+ inline detail::tail_finderF
+ tail_finder( int N )
+ {
+ return detail::tail_finderF(N);
+ }
+
+ //! "Token" finder
+ /*!
+ Construct the \c token_finder. The finder searches for a token
+ specified by a predicate. It is similar to std::find_if
+ algorithm, with an exception that it return a range of
+ instead of a single iterator.
+
+ If "compress token mode" is enabled, adjacent matching tokens are
+ concatenated into one match. Thus the finder can be used to
+ search for continuous segments of characters satisfying the
+ given predicate.
+
+ The result is given as an \c iterator_range delimiting the match.
+
+ \param Pred An element selection predicate
+ \param eCompress Compress flag
+ \return An instance of the \c token_finder object
+ */
+ template< typename PredicateT >
+ inline detail::token_finderF<PredicateT>
+ token_finder(
+ PredicateT Pred,
+ token_compress_mode_type eCompress=token_compress_off )
+ {
+ return detail::token_finderF<PredicateT>( Pred, eCompress );
+ }
+
+ //! "Range" finder
+ /*!
+ Construct the \c range_finder. The finder does not perform
+ any operation. It simply returns the given range for
+ any input.
+
+ \param Begin Beginning of the range
+ \param End End of the range
+ \param Range The range.
+ \return An instance of the \c range_finger object
+ */
+ template< typename ForwardIteratorT >
+ inline detail::range_finderF<ForwardIteratorT>
+ range_finder(
+ ForwardIteratorT Begin,
+ ForwardIteratorT End )
+ {
+ return detail::range_finderF<ForwardIteratorT>( Begin, End );
+ }
+
+ //! "Range" finder
+ /*!
+ \overload
+ */
+ template< typename ForwardIteratorT >
+ inline detail::range_finderF<ForwardIteratorT>
+ range_finder( iterator_range<ForwardIteratorT> Range )
+ {
+ return detail::range_finderF<ForwardIteratorT>( Range );
+ }
+
+ } // namespace algorithm
+
+ // pull the names to the boost namespace
+ using algorithm::first_finder;
+ using algorithm::last_finder;
+ using algorithm::nth_finder;
+ using algorithm::head_finder;
+ using algorithm::tail_finder;
+ using algorithm::token_finder;
+ using algorithm::range_finder;
+
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_FINDER_HPP
diff --git a/ndnboost/algorithm/string/formatter.hpp b/ndnboost/algorithm/string/formatter.hpp
new file mode 100644
index 0000000..5739b40
--- /dev/null
+++ b/ndnboost/algorithm/string/formatter.hpp
@@ -0,0 +1,120 @@
+// Boost string_algo library formatter.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_FORMATTER_HPP
+#define BOOST_STRING_FORMATTER_HPP
+
+#include <ndnboost/detail/iterator.hpp>
+#include <ndnboost/range/value_type.hpp>
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/as_literal.hpp>
+
+#include <ndnboost/algorithm/string/detail/formatter.hpp>
+
+/*! \file
+ Defines Formatter generators. Formatter is a functor which formats
+ a string according to given parameters. A Formatter works
+ in conjunction with a Finder. A Finder can provide additional information
+ for a specific Formatter. An example of such a cooperation is regex_finder
+ and regex_formatter.
+
+ Formatters are used as pluggable components for replace facilities.
+ This header contains generator functions for the Formatters provided in this library.
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+// generic formatters ---------------------------------------------------------------//
+
+ //! Constant formatter
+ /*!
+ Constructs a \c const_formatter. Const formatter always returns
+ the same value, regardless of the parameter.
+
+ \param Format A predefined value used as a result for formatting
+ \return An instance of the \c const_formatter object.
+ */
+ template<typename RangeT>
+ inline detail::const_formatF<
+ iterator_range<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >
+ const_formatter(const RangeT& Format)
+ {
+ return detail::const_formatF<
+ iterator_range<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >(::ndnboost::as_literal(Format));
+ }
+
+ //! Identity formatter
+ /*!
+ Constructs an \c identity_formatter. Identity formatter always returns
+ the parameter.
+
+ \return An instance of the \c identity_formatter object.
+ */
+ template<typename RangeT>
+ inline detail::identity_formatF<
+ iterator_range<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >
+ identity_formatter()
+ {
+ return detail::identity_formatF<
+ iterator_range<
+ BOOST_STRING_TYPENAME range_const_iterator<RangeT>::type> >();
+ }
+
+ //! Empty formatter
+ /*!
+ Constructs an \c empty_formatter. Empty formatter always returns an empty
+ sequence.
+
+ \param Input container used to select a correct value_type for the
+ resulting empty_container<>.
+ \return An instance of the \c empty_formatter object.
+ */
+ template<typename RangeT>
+ inline detail::empty_formatF<
+ BOOST_STRING_TYPENAME range_value<RangeT>::type>
+ empty_formatter(const RangeT&)
+ {
+ return detail::empty_formatF<
+ BOOST_STRING_TYPENAME range_value<RangeT>::type>();
+ }
+
+ //! Empty formatter
+ /*!
+ Constructs a \c dissect_formatter. Dissect formatter uses a specified finder
+ to extract a portion of the formatted sequence. The first finder's match is returned
+ as a result
+
+ \param Finder a finder used to select a portion of the formatted sequence
+ \return An instance of the \c dissect_formatter object.
+ */
+ template<typename FinderT>
+ inline detail::dissect_formatF< FinderT >
+ dissect_formatter(const FinderT& Finder)
+ {
+ return detail::dissect_formatF<FinderT>(Finder);
+ }
+
+
+ } // namespace algorithm
+
+ // pull the names to the boost namespace
+ using algorithm::const_formatter;
+ using algorithm::identity_formatter;
+ using algorithm::empty_formatter;
+ using algorithm::dissect_formatter;
+
+} // namespace ndnboost
+
+
+#endif // BOOST_FORMATTER_HPP
diff --git a/ndnboost/algorithm/string/replace.hpp b/ndnboost/algorithm/string/replace.hpp
new file mode 100644
index 0000000..11afce4
--- /dev/null
+++ b/ndnboost/algorithm/string/replace.hpp
@@ -0,0 +1,928 @@
+// Boost string_algo library replace.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2006.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_REPLACE_HPP
+#define BOOST_STRING_REPLACE_HPP
+
+#include <ndnboost/algorithm/string/config.hpp>
+
+#include <ndnboost/range/iterator_range.hpp>
+#include <ndnboost/range/begin.hpp>
+#include <ndnboost/range/end.hpp>
+#include <ndnboost/range/iterator.hpp>
+#include <ndnboost/range/const_iterator.hpp>
+
+#include <ndnboost/algorithm/string/find_format.hpp>
+#include <ndnboost/algorithm/string/finder.hpp>
+#include <ndnboost/algorithm/string/formatter.hpp>
+#include <ndnboost/algorithm/string/compare.hpp>
+
+/*! \file
+ Defines various replace algorithms. Each algorithm replaces
+ part(s) of the input according to set of searching and replace criteria.
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+// replace_range --------------------------------------------------------------------//
+
+ //! Replace range algorithm
+ /*!
+ Replace the given range in the input string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param SearchRange A range in the input to be substituted
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T>
+ inline OutputIteratorT replace_range_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const iterator_range<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<Range1T>::type>& SearchRange,
+ const Range2T& Format)
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::range_finder(SearchRange),
+ ::ndnboost::algorithm::const_formatter(Format));
+ }
+
+ //! Replace range algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename RangeT>
+ inline SequenceT replace_range_copy(
+ const SequenceT& Input,
+ const iterator_range<
+ BOOST_STRING_TYPENAME
+ range_const_iterator<SequenceT>::type>& SearchRange,
+ const RangeT& Format)
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::range_finder(SearchRange),
+ ::ndnboost::algorithm::const_formatter(Format));
+ }
+
+ //! Replace range algorithm
+ /*!
+ Replace the given range in the input string.
+ The input sequence is modified in-place.
+
+ \param Input An input string
+ \param SearchRange A range in the input to be substituted
+ \param Format A substitute string
+ */
+ template<typename SequenceT, typename RangeT>
+ inline void replace_range(
+ SequenceT& Input,
+ const iterator_range<
+ BOOST_STRING_TYPENAME
+ range_iterator<SequenceT>::type>& SearchRange,
+ const RangeT& Format)
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::range_finder(SearchRange),
+ ::ndnboost::algorithm::const_formatter(Format));
+ }
+
+// replace_first --------------------------------------------------------------------//
+
+ //! Replace first algorithm
+ /*!
+ Replace the first match of the search substring in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT replace_first_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ const Range3T& Format)
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::first_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace first algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT replace_first_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace first algorithm
+ /*!
+ replace the first match of the search substring in the input
+ with the format string. The input sequence is modified in-place.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void replace_first(
+ SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_first ( case insensitive ) ---------------------------------------------//
+
+ //! Replace first algorithm ( case insensitive )
+ /*!
+ Replace the first match of the search substring in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+ Searching is case insensitive.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT ireplace_first_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ const Range3T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::first_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace first algorithm ( case insensitive )
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range2T, typename Range1T>
+ inline SequenceT ireplace_first_copy(
+ const SequenceT& Input,
+ const Range2T& Search,
+ const Range1T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace first algorithm ( case insensitive )
+ /*!
+ Replace the first match of the search substring in the input
+ with the format string. Input sequence is modified in-place.
+ Searching is case insensitive.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void ireplace_first(
+ SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_last --------------------------------------------------------------------//
+
+ //! Replace last algorithm
+ /*!
+ Replace the last match of the search string in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT replace_last_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ const Range3T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::last_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace last algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT replace_last_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::last_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace last algorithm
+ /*!
+ Replace the last match of the search string in the input
+ with the format string. Input sequence is modified in-place.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void replace_last(
+ SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::last_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_last ( case insensitive ) -----------------------------------------------//
+
+ //! Replace last algorithm ( case insensitive )
+ /*!
+ Replace the last match of the search string in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+ Searching is case insensitive.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT ireplace_last_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ const Range3T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::last_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace last algorithm ( case insensitive )
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT ireplace_last_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::last_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace last algorithm ( case insensitive )
+ /*!
+ Replace the last match of the search string in the input
+ with the format string.The input sequence is modified in-place.
+ Searching is case insensitive.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ \return A reference to the modified input
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void ireplace_last(
+ SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::last_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_nth --------------------------------------------------------------------//
+
+ //! Replace nth algorithm
+ /*!
+ Replace an Nth (zero-indexed) match of the search string in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Nth An index of the match to be replaced. The index is 0-based.
+ For negative N, matches are counted from the end of string.
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT replace_nth_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ int Nth,
+ const Range3T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::nth_finder(Search, Nth),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace nth algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT replace_nth_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ int Nth,
+ const Range2T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::nth_finder(Search, Nth),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace nth algorithm
+ /*!
+ Replace an Nth (zero-indexed) match of the search string in the input
+ with the format string. Input sequence is modified in-place.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Nth An index of the match to be replaced. The index is 0-based.
+ For negative N, matches are counted from the end of string.
+ \param Format A substitute string
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void replace_nth(
+ SequenceT& Input,
+ const Range1T& Search,
+ int Nth,
+ const Range2T& Format )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::nth_finder(Search, Nth),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_nth ( case insensitive ) -----------------------------------------------//
+
+ //! Replace nth algorithm ( case insensitive )
+ /*!
+ Replace an Nth (zero-indexed) match of the search string in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+ Searching is case insensitive.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Nth An index of the match to be replaced. The index is 0-based.
+ For negative N, matches are counted from the end of string.
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT ireplace_nth_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ int Nth,
+ const Range3T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc) ),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace nth algorithm ( case insensitive )
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT ireplace_nth_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ int Nth,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace nth algorithm ( case insensitive )
+ /*!
+ Replace an Nth (zero-indexed) match of the search string in the input
+ with the format string. Input sequence is modified in-place.
+ Searching is case insensitive.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Nth An index of the match to be replaced. The index is 0-based.
+ For negative N, matches are counted from the end of string.
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void ireplace_nth(
+ SequenceT& Input,
+ const Range1T& Search,
+ int Nth,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::nth_finder(Search, Nth, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_all --------------------------------------------------------------------//
+
+ //! Replace all algorithm
+ /*!
+ Replace all occurrences of the search string in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT replace_all_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ const Range3T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_all_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::first_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace all algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT replace_all_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_all_copy(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace all algorithm
+ /*!
+ Replace all occurrences of the search string in the input
+ with the format string. The input sequence is modified in-place.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \return A reference to the modified input
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void replace_all(
+ SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format )
+ {
+ ::ndnboost::algorithm::find_format_all(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_all ( case insensitive ) -----------------------------------------------//
+
+ //! Replace all algorithm ( case insensitive )
+ /*!
+ Replace all occurrences of the search string in the input
+ with the format string.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+ Searching is case insensitive.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T,
+ typename Range3T>
+ inline OutputIteratorT ireplace_all_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ const Range2T& Search,
+ const Range3T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_all_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::first_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace all algorithm ( case insensitive )
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline SequenceT ireplace_all_copy(
+ const SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ return ::ndnboost::algorithm::find_format_all_copy(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace all algorithm ( case insensitive )
+ /*!
+ Replace all occurrences of the search string in the input
+ with the format string.The input sequence is modified in-place.
+ Searching is case insensitive.
+
+ \param Input An input string
+ \param Search A substring to be searched for
+ \param Format A substitute string
+ \param Loc A locale used for case insensitive comparison
+ */
+ template<typename SequenceT, typename Range1T, typename Range2T>
+ inline void ireplace_all(
+ SequenceT& Input,
+ const Range1T& Search,
+ const Range2T& Format,
+ const std::locale& Loc=std::locale() )
+ {
+ ::ndnboost::algorithm::find_format_all(
+ Input,
+ ::ndnboost::algorithm::first_finder(Search, is_iequal(Loc)),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_head --------------------------------------------------------------------//
+
+ //! Replace head algorithm
+ /*!
+ Replace the head of the input with the given format string.
+ The head is a prefix of a string of given size.
+ If the sequence is shorter then required, whole string if
+ considered to be the head.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param N Length of the head.
+ For N>=0, at most N characters are extracted.
+ For N<0, size(Input)-|N| characters are extracted.
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T>
+ inline OutputIteratorT replace_head_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ int N,
+ const Range2T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::head_finder(N),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace head algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename RangeT>
+ inline SequenceT replace_head_copy(
+ const SequenceT& Input,
+ int N,
+ const RangeT& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::head_finder(N),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace head algorithm
+ /*!
+ Replace the head of the input with the given format string.
+ The head is a prefix of a string of given size.
+ If the sequence is shorter then required, the whole string is
+ considered to be the head. The input sequence is modified in-place.
+
+ \param Input An input string
+ \param N Length of the head.
+ For N>=0, at most N characters are extracted.
+ For N<0, size(Input)-|N| characters are extracted.
+ \param Format A substitute string
+ */
+ template<typename SequenceT, typename RangeT>
+ inline void replace_head(
+ SequenceT& Input,
+ int N,
+ const RangeT& Format )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::head_finder(N),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+// replace_tail --------------------------------------------------------------------//
+
+ //! Replace tail algorithm
+ /*!
+ Replace the tail of the input with the given format string.
+ The tail is a suffix of a string of given size.
+ If the sequence is shorter then required, whole string is
+ considered to be the tail.
+ The result is a modified copy of the input. It is returned as a sequence
+ or copied to the output iterator.
+
+ \param Output An output iterator to which the result will be copied
+ \param Input An input string
+ \param N Length of the tail.
+ For N>=0, at most N characters are extracted.
+ For N<0, size(Input)-|N| characters are extracted.
+ \param Format A substitute string
+ \return An output iterator pointing just after the last inserted character or
+ a modified copy of the input
+
+ \note The second variant of this function provides the strong exception-safety guarantee
+ */
+ template<
+ typename OutputIteratorT,
+ typename Range1T,
+ typename Range2T>
+ inline OutputIteratorT replace_tail_copy(
+ OutputIteratorT Output,
+ const Range1T& Input,
+ int N,
+ const Range2T& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Output,
+ Input,
+ ::ndnboost::algorithm::tail_finder(N),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace tail algorithm
+ /*!
+ \overload
+ */
+ template<typename SequenceT, typename RangeT>
+ inline SequenceT replace_tail_copy(
+ const SequenceT& Input,
+ int N,
+ const RangeT& Format )
+ {
+ return ::ndnboost::algorithm::find_format_copy(
+ Input,
+ ::ndnboost::algorithm::tail_finder(N),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ //! Replace tail algorithm
+ /*!
+ Replace the tail of the input with the given format sequence.
+ The tail is a suffix of a string of given size.
+ If the sequence is shorter then required, the whole string is
+ considered to be the tail. The input sequence is modified in-place.
+
+ \param Input An input string
+ \param N Length of the tail.
+ For N>=0, at most N characters are extracted.
+ For N<0, size(Input)-|N| characters are extracted.
+ \param Format A substitute string
+ */
+ template<typename SequenceT, typename RangeT>
+ inline void replace_tail(
+ SequenceT& Input,
+ int N,
+ const RangeT& Format )
+ {
+ ::ndnboost::algorithm::find_format(
+ Input,
+ ::ndnboost::algorithm::tail_finder(N),
+ ::ndnboost::algorithm::const_formatter(Format) );
+ }
+
+ } // namespace algorithm
+
+ // pull names to the boost namespace
+ using algorithm::replace_range_copy;
+ using algorithm::replace_range;
+ using algorithm::replace_first_copy;
+ using algorithm::replace_first;
+ using algorithm::ireplace_first_copy;
+ using algorithm::ireplace_first;
+ using algorithm::replace_last_copy;
+ using algorithm::replace_last;
+ using algorithm::ireplace_last_copy;
+ using algorithm::ireplace_last;
+ using algorithm::replace_nth_copy;
+ using algorithm::replace_nth;
+ using algorithm::ireplace_nth_copy;
+ using algorithm::ireplace_nth;
+ using algorithm::replace_all_copy;
+ using algorithm::replace_all;
+ using algorithm::ireplace_all_copy;
+ using algorithm::ireplace_all;
+ using algorithm::replace_head_copy;
+ using algorithm::replace_head;
+ using algorithm::replace_tail_copy;
+ using algorithm::replace_tail;
+
+} // namespace ndnboost
+
+#endif // BOOST_REPLACE_HPP
diff --git a/ndnboost/algorithm/string/sequence_traits.hpp b/ndnboost/algorithm/string/sequence_traits.hpp
new file mode 100644
index 0000000..5ef46af
--- /dev/null
+++ b/ndnboost/algorithm/string/sequence_traits.hpp
@@ -0,0 +1,193 @@
+// Boost string_algo library sequence_traits.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_SEQUENCE_TRAITS_HPP
+#define BOOST_STRING_SEQUENCE_TRAITS_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/algorithm/string/yes_no_type.hpp>
+
+/*! \file
+ Traits defined in this header are used by various algorithms to achieve
+ better performance for specific containers.
+ Traits provide fail-safe defaults. If a container supports some of these
+ features, it is possible to specialize the specific trait for this container.
+ For lacking compilers, it is possible of define an override for a specific tester
+ function.
+
+ Due to a language restriction, it is not currently possible to define specializations for
+ stl containers without including the corresponding header. To decrease the overhead
+ needed by this inclusion, user can selectively include a specialization
+ header for a specific container. They are located in boost/algorithm/string/stl
+ directory. Alternatively she can include boost/algorithm/string/std_collection_traits.hpp
+ header which contains specializations for all stl containers.
+*/
+
+namespace ndnboost {
+ namespace algorithm {
+
+// sequence traits -----------------------------------------------//
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ //! Native replace tester
+ /*!
+ Declare an override of this tester function with return
+ type ndnboost::string_algo::yes_type for a sequence with this property.
+
+ \return yes_type if the container has basic_string like native replace
+ method.
+ */
+ no_type has_native_replace_tester(...);
+
+ //! Stable iterators tester
+ /*!
+ Declare an override of this tester function with return
+ type ndnboost::string_algo::yes_type for a sequence with this property.
+
+ \return yes_type if the sequence's insert/replace/erase methods do not invalidate
+ existing iterators.
+ */
+ no_type has_stable_iterators_tester(...);
+
+ //! const time insert tester
+ /*!
+ Declare an override of this tester function with return
+ type ndnboost::string_algo::yes_type for a sequence with this property.
+
+ \return yes_type if the sequence's insert method is working in constant time
+ */
+ no_type has_const_time_insert_tester(...);
+
+ //! const time erase tester
+ /*!
+ Declare an override of this tester function with return
+ type ndnboost::string_algo::yes_type for a sequence with this property.
+
+ \return yes_type if the sequence's erase method is working in constant time
+ */
+ no_type has_const_time_erase_tester(...);
+
+#endif //BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ //! Native replace trait
+ /*!
+ This trait specifies that the sequence has \c std::string like replace method
+ */
+ template< typename T >
+ class has_native_replace
+ {
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ private:
+ static T* t;
+ public:
+ BOOST_STATIC_CONSTANT(bool, value=(
+ sizeof(has_native_replace_tester(t))==sizeof(yes_type) ) );
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ public:
+# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+ enum { value = false };
+# else
+ BOOST_STATIC_CONSTANT(bool, value=false);
+# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+
+ typedef mpl::bool_<has_native_replace<T>::value> type;
+ };
+
+
+ //! Stable iterators trait
+ /*!
+ This trait specifies that the sequence has stable iterators. It means
+ that operations like insert/erase/replace do not invalidate iterators.
+ */
+ template< typename T >
+ class has_stable_iterators
+ {
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ private:
+ static T* t;
+ public:
+ BOOST_STATIC_CONSTANT(bool, value=(
+ sizeof(has_stable_iterators_tester(t))==sizeof(yes_type) ) );
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ public:
+# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+ enum { value = false };
+# else
+ BOOST_STATIC_CONSTANT(bool, value=false);
+# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ typedef mpl::bool_<has_stable_iterators<T>::value> type;
+ };
+
+
+ //! Const time insert trait
+ /*!
+ This trait specifies that the sequence's insert method has
+ constant time complexity.
+ */
+ template< typename T >
+ class has_const_time_insert
+ {
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ private:
+ static T* t;
+ public:
+ BOOST_STATIC_CONSTANT(bool, value=(
+ sizeof(has_const_time_insert_tester(t))==sizeof(yes_type) ) );
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ public:
+# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+ enum { value = false };
+# else
+ BOOST_STATIC_CONSTANT(bool, value=false);
+# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ typedef mpl::bool_<has_const_time_insert<T>::value> type;
+ };
+
+
+ //! Const time erase trait
+ /*!
+ This trait specifies that the sequence's erase method has
+ constant time complexity.
+ */
+ template< typename T >
+ class has_const_time_erase
+ {
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ private:
+ static T* t;
+ public:
+ BOOST_STATIC_CONSTANT(bool, value=(
+ sizeof(has_const_time_erase_tester(t))==sizeof(yes_type) ) );
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ public:
+# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+ enum { value = false };
+# else
+ BOOST_STATIC_CONSTANT(bool, value=false);
+# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ typedef mpl::bool_<has_const_time_erase<T>::value> type;
+ };
+
+ } // namespace algorithm
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_SEQUENCE_TRAITS_HPP
diff --git a/ndnboost/algorithm/string/yes_no_type.hpp b/ndnboost/algorithm/string/yes_no_type.hpp
new file mode 100644
index 0000000..740c7b1
--- /dev/null
+++ b/ndnboost/algorithm/string/yes_no_type.hpp
@@ -0,0 +1,33 @@
+// Boost string_algo library yes_no_type.hpp header file ---------------------------//
+
+// Copyright Pavol Droba 2002-2003.
+//
+// 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)
+
+// See http://www.boost.org/ for updates, documentation, and revision history.
+
+#ifndef BOOST_STRING_YES_NO_TYPE_DETAIL_HPP
+#define BOOST_STRING_YES_NO_TYPE_DETAIL_HPP
+
+namespace ndnboost {
+ namespace algorithm {
+
+ // taken from boost mailing-list
+ // when yes_no_type will become officially
+ // a part of boost distribution, this header
+ // will be deprecated
+ template<int I> struct size_descriptor
+ {
+ typedef char (& type)[I];
+ };
+
+ typedef size_descriptor<1>::type yes_type;
+ typedef size_descriptor<2>::type no_type;
+
+ } // namespace algorithm
+} // namespace ndnboost
+
+
+#endif // BOOST_STRING_YES_NO_TYPE_DETAIL_HPP
diff --git a/ndnboost/array.hpp b/ndnboost/array.hpp
new file mode 100644
index 0000000..ab70a47
--- /dev/null
+++ b/ndnboost/array.hpp
@@ -0,0 +1,446 @@
+/* The following code declares class array,
+ * an STL container (as wrapper) for arrays of constant size.
+ *
+ * See
+ * http://www.boost.org/libs/array/
+ * for documentation.
+ *
+ * The original author site is at: http://www.josuttis.com/
+ *
+ * (C) Copyright Nicolai M. Josuttis 2001.
+ *
+ * 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)
+ *
+ * 14 Apr 2012 - (mtc) Added support for ndnboost::hash
+ * 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility.
+ * 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
+ * See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
+ * Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
+ * 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
+ * 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
+ * 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
+ * 05 Aug 2001 - minor update (Nico Josuttis)
+ * 20 Jan 2001 - STLport fix (Beman Dawes)
+ * 29 Sep 2000 - Initial Revision (Nico Josuttis)
+ *
+ * Jan 29, 2004
+ */
+#ifndef BOOST_ARRAY_HPP
+#define BOOST_ARRAY_HPP
+
+#include <ndnboost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(push)
+# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
+# pragma warning(disable:4510) // ndnboost::array<T,N>' : default constructor could not be generated
+# pragma warning(disable:4610) // warning C4610: class 'ndnboost::array<T,N>' can never be instantiated - user defined constructor required
+#endif
+
+#include <cstddef>
+#include <stdexcept>
+#include <ndnboost/assert.hpp>
+#include <ndnboost/swap.hpp>
+
+// Handles broken standard libraries better than <iterator>
+#include <ndnboost/detail/iterator.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/functional/hash_fwd.hpp>
+#include <algorithm>
+
+// FIXES for broken compilers
+#include <ndnboost/config.hpp>
+
+
+namespace ndnboost {
+
+ template<class T, std::size_t N>
+ class array {
+ public:
+ T elems[N]; // fixed-size array of elements of type T
+
+ public:
+ // type definitions
+ typedef T value_type;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ // iterator support
+ iterator begin() { return elems; }
+ const_iterator begin() const { return elems; }
+ const_iterator cbegin() const { return elems; }
+
+ iterator end() { return elems+N; }
+ const_iterator end() const { return elems+N; }
+ const_iterator cend() const { return elems+N; }
+
+ // reverse iterator support
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
+ // workaround for broken reverse_iterator in VC7
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
+ reference, iterator, reference> > reverse_iterator;
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
+ const_reference, iterator, reference> > const_reverse_iterator;
+#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
+ value_type, reference, iterator, difference_type> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
+ value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
+#else
+ // workaround for broken reverse_iterator implementations
+ typedef std::reverse_iterator<iterator,T> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
+#endif
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator crbegin() const {
+ return const_reverse_iterator(end());
+ }
+
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+ const_reverse_iterator crend() const {
+ return const_reverse_iterator(begin());
+ }
+
+ // operator[]
+ reference operator[](size_type i)
+ {
+ BOOST_ASSERT_MSG( i < N, "out of range" );
+ return elems[i];
+ }
+
+ const_reference operator[](size_type i) const
+ {
+ BOOST_ASSERT_MSG( i < N, "out of range" );
+ return elems[i];
+ }
+
+ // at() with range check
+ reference at(size_type i) { rangecheck(i); return elems[i]; }
+ const_reference at(size_type i) const { rangecheck(i); return elems[i]; }
+
+ // front() and back()
+ reference front()
+ {
+ return elems[0];
+ }
+
+ const_reference front() const
+ {
+ return elems[0];
+ }
+
+ reference back()
+ {
+ return elems[N-1];
+ }
+
+ const_reference back() const
+ {
+ return elems[N-1];
+ }
+
+ // size is constant
+ static size_type size() { return N; }
+ static bool empty() { return false; }
+ static size_type max_size() { return N; }
+ enum { static_size = N };
+
+ // swap (note: linear complexity)
+ void swap (array<T,N>& y) {
+ for (size_type i = 0; i < N; ++i)
+ ndnboost::swap(elems[i],y.elems[i]);
+ }
+
+ // direct access to data (read-only)
+ const T* data() const { return elems; }
+ T* data() { return elems; }
+
+ // use array as C array (direct read/write access to data)
+ T* c_array() { return elems; }
+
+ // assignment with type conversion
+ template <typename T2>
+ array<T,N>& operator= (const array<T2,N>& rhs) {
+ std::copy(rhs.begin(),rhs.end(), begin());
+ return *this;
+ }
+
+ // assign one value to all elements
+ void assign (const T& value) { fill ( value ); } // A synonym for fill
+ void fill (const T& value)
+ {
+ std::fill_n(begin(),size(),value);
+ }
+
+ // check range (may be private because it is static)
+ static void rangecheck (size_type i) {
+ if (i >= size()) {
+ std::out_of_range e("array<>: index out of range");
+ ndnboost::throw_exception(e);
+ }
+ }
+
+ };
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ template< class T >
+ class array< T, 0 > {
+
+ public:
+ // type definitions
+ typedef T value_type;
+ typedef T* iterator;
+ typedef const T* const_iterator;
+ typedef T& reference;
+ typedef const T& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ // iterator support
+ iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); }
+ const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
+ const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); }
+
+ iterator end() { return begin(); }
+ const_iterator end() const { return begin(); }
+ const_iterator cend() const { return cbegin(); }
+
+ // reverse iterator support
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS)
+ typedef std::reverse_iterator<iterator> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator> const_reverse_iterator;
+#elif defined(_MSC_VER) && (_MSC_VER == 1300) && defined(BOOST_DINKUMWARE_STDLIB) && (BOOST_DINKUMWARE_STDLIB == 310)
+ // workaround for broken reverse_iterator in VC7
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, iterator,
+ reference, iterator, reference> > reverse_iterator;
+ typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
+ const_reference, iterator, reference> > const_reverse_iterator;
+#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
+ typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
+ value_type, reference, iterator, difference_type> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
+ value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
+#else
+ // workaround for broken reverse_iterator implementations
+ typedef std::reverse_iterator<iterator,T> reverse_iterator;
+ typedef std::reverse_iterator<const_iterator,T> const_reverse_iterator;
+#endif
+
+ reverse_iterator rbegin() { return reverse_iterator(end()); }
+ const_reverse_iterator rbegin() const {
+ return const_reverse_iterator(end());
+ }
+ const_reverse_iterator crbegin() const {
+ return const_reverse_iterator(end());
+ }
+
+ reverse_iterator rend() { return reverse_iterator(begin()); }
+ const_reverse_iterator rend() const {
+ return const_reverse_iterator(begin());
+ }
+ const_reverse_iterator crend() const {
+ return const_reverse_iterator(begin());
+ }
+
+ // operator[]
+ reference operator[](size_type /*i*/)
+ {
+ return failed_rangecheck();
+ }
+
+ const_reference operator[](size_type /*i*/) const
+ {
+ return failed_rangecheck();
+ }
+
+ // at() with range check
+ reference at(size_type /*i*/) { return failed_rangecheck(); }
+ const_reference at(size_type /*i*/) const { return failed_rangecheck(); }
+
+ // front() and back()
+ reference front()
+ {
+ return failed_rangecheck();
+ }
+
+ const_reference front() const
+ {
+ return failed_rangecheck();
+ }
+
+ reference back()
+ {
+ return failed_rangecheck();
+ }
+
+ const_reference back() const
+ {
+ return failed_rangecheck();
+ }
+
+ // size is constant
+ static size_type size() { return 0; }
+ static bool empty() { return true; }
+ static size_type max_size() { return 0; }
+ enum { static_size = 0 };
+
+ void swap (array<T,0>& /*y*/) {
+ }
+
+ // direct access to data (read-only)
+ const T* data() const { return 0; }
+ T* data() { return 0; }
+
+ // use array as C array (direct read/write access to data)
+ T* c_array() { return 0; }
+
+ // assignment with type conversion
+ template <typename T2>
+ array<T,0>& operator= (const array<T2,0>& ) {
+ return *this;
+ }
+
+ // assign one value to all elements
+ void assign (const T& value) { fill ( value ); }
+ void fill (const T& ) {}
+
+ // check range (may be private because it is static)
+ static reference failed_rangecheck () {
+ std::out_of_range e("attempt to access element of an empty array");
+ ndnboost::throw_exception(e);
+#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
+ //
+ // We need to return something here to keep
+ // some compilers happy: however we will never
+ // actually get here....
+ //
+ static T placeholder;
+ return placeholder;
+#endif
+ }
+ };
+#endif
+
+ // comparisons
+ template<class T, std::size_t N>
+ bool operator== (const array<T,N>& x, const array<T,N>& y) {
+ return std::equal(x.begin(), x.end(), y.begin());
+ }
+ template<class T, std::size_t N>
+ bool operator< (const array<T,N>& x, const array<T,N>& y) {
+ return std::lexicographical_compare(x.begin(),x.end(),y.begin(),y.end());
+ }
+ template<class T, std::size_t N>
+ bool operator!= (const array<T,N>& x, const array<T,N>& y) {
+ return !(x==y);
+ }
+ template<class T, std::size_t N>
+ bool operator> (const array<T,N>& x, const array<T,N>& y) {
+ return y<x;
+ }
+ template<class T, std::size_t N>
+ bool operator<= (const array<T,N>& x, const array<T,N>& y) {
+ return !(y<x);
+ }
+ template<class T, std::size_t N>
+ bool operator>= (const array<T,N>& x, const array<T,N>& y) {
+ return !(x<y);
+ }
+
+ // global swap()
+ template<class T, std::size_t N>
+ inline void swap (array<T,N>& x, array<T,N>& y) {
+ x.swap(y);
+ }
+
+#if defined(__SUNPRO_CC)
+// Trac ticket #4757; the Sun Solaris compiler can't handle
+// syntax like 'T(&get_c_array(ndnboost::array<T,N>& arg))[N]'
+//
+// We can't just use this for all compilers, because the
+// borland compilers can't handle this form.
+ namespace detail {
+ template <typename T, std::size_t N> struct c_array
+ {
+ typedef T type[N];
+ };
+ }
+
+ // Specific for ndnboost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ typename detail::c_array<T,N>::type& get_c_array(ndnboost::array<T,N>& arg)
+ {
+ return arg.elems;
+ }
+
+ // Specific for ndnboost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ typename const detail::c_array<T,N>::type& get_c_array(const ndnboost::array<T,N>& arg)
+ {
+ return arg.elems;
+ }
+#else
+// Specific for ndnboost::array: simply returns its elems data member.
+ template <typename T, std::size_t N>
+ T(&get_c_array(ndnboost::array<T,N>& arg))[N]
+ {
+ return arg.elems;
+ }
+
+ // Const version.
+ template <typename T, std::size_t N>
+ const T(&get_c_array(const ndnboost::array<T,N>& arg))[N]
+ {
+ return arg.elems;
+ }
+#endif
+
+#if 0
+ // Overload for std::array, assuming that std::array will have
+ // explicit conversion functions as discussed at the WG21 meeting
+ // in Summit, March 2009.
+ template <typename T, std::size_t N>
+ T(&get_c_array(std::array<T,N>& arg))[N]
+ {
+ return static_cast<T(&)[N]>(arg);
+ }
+
+ // Const version.
+ template <typename T, std::size_t N>
+ const T(&get_c_array(const std::array<T,N>& arg))[N]
+ {
+ return static_cast<T(&)[N]>(arg);
+ }
+#endif
+
+
+ template<class T, std::size_t N>
+ std::size_t hash_value(const array<T,N>& arr)
+ {
+ return ndnboost::hash_range(arr.begin(), arr.end());
+ }
+
+} /* namespace ndnboost */
+
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+# pragma warning(pop)
+#endif
+
+#endif /*BOOST_ARRAY_HPP*/
diff --git a/ndnboost/bind.hpp b/ndnboost/bind.hpp
new file mode 100644
index 0000000..4421619
--- /dev/null
+++ b/ndnboost/bind.hpp
@@ -0,0 +1,24 @@
+#ifndef BOOST_BIND_HPP_INCLUDED
+#define BOOST_BIND_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind.hpp - binds function objects to arguments
+//
+// Copyright (c) 2009 Peter Dimov
+//
+// 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
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <ndnboost/bind/bind.hpp>
+
+#endif // #ifndef BOOST_BIND_HPP_INCLUDED
diff --git a/ndnboost/bind/apply.hpp b/ndnboost/bind/apply.hpp
new file mode 100644
index 0000000..8519c06
--- /dev/null
+++ b/ndnboost/bind/apply.hpp
@@ -0,0 +1,74 @@
+#ifndef BOOST_BIND_APPLY_HPP_INCLUDED
+#define BOOST_BIND_APPLY_HPP_INCLUDED
+
+//
+// apply.hpp
+//
+// Copyright (c) 2002, 2003 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+
+namespace ndnboost
+{
+
+template<class R> struct apply
+{
+ typedef R result_type;
+
+ template<class F> result_type operator()(F & f) const
+ {
+ return f();
+ }
+
+ template<class F, class A1> result_type operator()(F & f, A1 & a1) const
+ {
+ return f(a1);
+ }
+
+ template<class F, class A1, class A2> result_type operator()(F & f, A1 & a1, A2 & a2) const
+ {
+ return f(a1, a2);
+ }
+
+ template<class F, class A1, class A2, class A3> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3) const
+ {
+ return f(a1, a2, a3);
+ }
+
+ template<class F, class A1, class A2, class A3, class A4> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+ {
+ return f(a1, a2, a3, a4);
+ }
+
+ template<class F, class A1, class A2, class A3, class A4, class A5> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+ {
+ return f(a1, a2, a3, a4, a5);
+ }
+
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+ {
+ return f(a1, a2, a3, a4, a5, a6);
+ }
+
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+ {
+ return f(a1, a2, a3, a4, a5, a6, a7);
+ }
+
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+ {
+ return f(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+
+ template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(F & f, A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+ {
+ return f(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+};
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_BIND_APPLY_HPP_INCLUDED
diff --git a/ndnboost/bind/arg.hpp b/ndnboost/bind/arg.hpp
new file mode 100644
index 0000000..7551575
--- /dev/null
+++ b/ndnboost/bind/arg.hpp
@@ -0,0 +1,62 @@
+#ifndef BOOST_BIND_ARG_HPP_INCLUDED
+#define BOOST_BIND_ARG_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind/arg.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/is_placeholder.hpp>
+
+namespace ndnboost
+{
+
+template< int I > struct arg
+{
+ arg()
+ {
+ }
+
+ template< class T > arg( T const & /* t */ )
+ {
+ // static assert I == is_placeholder<T>::value
+ typedef char T_must_be_placeholder[ I == is_placeholder<T>::value? 1: -1 ];
+ }
+};
+
+template< int I > bool operator==( arg<I> const &, arg<I> const & )
+{
+ return true;
+}
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template< int I > struct is_placeholder< arg<I> >
+{
+ enum _vt { value = I };
+};
+
+template< int I > struct is_placeholder< arg<I> (*) () >
+{
+ enum _vt { value = I };
+};
+
+#endif
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_BIND_ARG_HPP_INCLUDED
diff --git a/ndnboost/bind/bind.hpp b/ndnboost/bind/bind.hpp
new file mode 100644
index 0000000..db16788
--- /dev/null
+++ b/ndnboost/bind/bind.hpp
@@ -0,0 +1,1751 @@
+#ifndef BOOST_BIND_BIND_HPP_INCLUDED
+#define BOOST_BIND_BIND_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind.hpp - binds function objects to arguments
+//
+// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2001 David Abrahams
+// Copyright (c) 2005 Peter Dimov
+//
+// 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/ref.hpp>
+#include <ndnboost/mem_fn.hpp>
+#include <ndnboost/type.hpp>
+#include <ndnboost/is_placeholder.hpp>
+#include <ndnboost/bind/arg.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/visit_each.hpp>
+
+// Borland-specific bug, visit_each() silently fails to produce code
+
+#if defined(__BORLANDC__)
+# define BOOST_BIND_VISIT_EACH ndnboost::visit_each
+#else
+# define BOOST_BIND_VISIT_EACH visit_each
+#endif
+
+#include <ndnboost/bind/storage.hpp>
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4512) // assignment operator could not be generated
+#endif
+
+namespace ndnboost
+{
+
+template<class T> class weak_ptr;
+
+namespace _bi // implementation details
+{
+
+// result_traits
+
+template<class R, class F> struct result_traits
+{
+ typedef R type;
+};
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+struct unspecified {};
+
+template<class F> struct result_traits<unspecified, F>
+{
+ typedef typename F::result_type type;
+};
+
+template<class F> struct result_traits< unspecified, reference_wrapper<F> >
+{
+ typedef typename F::result_type type;
+};
+
+#endif
+
+// ref_compare
+
+template<class T> bool ref_compare( T const & a, T const & b, long )
+{
+ return a == b;
+}
+
+template<int I> bool ref_compare( arg<I> const &, arg<I> const &, int )
+{
+ return true;
+}
+
+template<int I> bool ref_compare( arg<I> (*) (), arg<I> (*) (), int )
+{
+ return true;
+}
+
+template<class T> bool ref_compare( reference_wrapper<T> const & a, reference_wrapper<T> const & b, int )
+{
+ return a.get_pointer() == b.get_pointer();
+}
+
+// bind_t forward declaration for listN
+
+template<class R, class F, class L> class bind_t;
+
+template<class R, class F, class L> bool ref_compare( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
+{
+ return a.compare( b );
+}
+
+// value
+
+template<class T> class value
+{
+public:
+
+ value(T const & t): t_(t) {}
+
+ T & get() { return t_; }
+ T const & get() const { return t_; }
+
+ bool operator==(value const & rhs) const
+ {
+ return t_ == rhs.t_;
+ }
+
+private:
+
+ T t_;
+};
+
+// ref_compare for weak_ptr
+
+template<class T> bool ref_compare( value< weak_ptr<T> > const & a, value< weak_ptr<T> > const & b, int )
+{
+ return !(a.get() < b.get()) && !(b.get() < a.get());
+}
+
+// type
+
+template<class T> class type {};
+
+// unwrap
+
+template<class F> struct unwrapper
+{
+ static inline F & unwrap( F & f, long )
+ {
+ return f;
+ }
+
+ template<class F2> static inline F2 & unwrap( reference_wrapper<F2> rf, int )
+ {
+ return rf.get();
+ }
+
+ template<class R, class T> static inline _mfi::dm<R, T> unwrap( R T::* pm, int )
+ {
+ return _mfi::dm<R, T>( pm );
+ }
+};
+
+// listN
+
+class list0
+{
+public:
+
+ list0() {}
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A &, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)();
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A &, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)();
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A &, int)
+ {
+ unwrapper<F>::unwrap(f, 0)();
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A &, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)();
+ }
+
+ template<class V> void accept(V &) const
+ {
+ }
+
+ bool operator==(list0 const &) const
+ {
+ return true;
+ }
+};
+
+#ifdef BOOST_MSVC
+// MSVC is bright enough to realise that the parameter rhs
+// in operator==may be unused for some template argument types:
+#pragma warning(push)
+#pragma warning(disable:4100)
+#endif
+
+template< class A1 > class list1: private storage1< A1 >
+{
+private:
+
+ typedef storage1< A1 > base_type;
+
+public:
+
+ explicit list1( A1 a1 ): base_type( a1 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+
+ template<class T> T & operator[] ( _bi::value<T> & v ) const { return v.get(); }
+
+ template<class T> T const & operator[] ( _bi::value<T> const & v ) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list1 const & rhs) const
+ {
+ return ref_compare(base_type::a1_, rhs.a1_, 0);
+ }
+};
+
+struct logical_and;
+struct logical_or;
+
+template< class A1, class A2 > class list2: private storage2< A1, A2 >
+{
+private:
+
+ typedef storage2< A1, A2 > base_type;
+
+public:
+
+ list2( A1 a1, A2 a2 ): base_type( a1, a2 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_]);
+ }
+
+ template<class A> bool operator()( type<bool>, logical_and & /*f*/, A & a, int )
+ {
+ return a[ base_type::a1_ ] && a[ base_type::a2_ ];
+ }
+
+ template<class A> bool operator()( type<bool>, logical_and const & /*f*/, A & a, int ) const
+ {
+ return a[ base_type::a1_ ] && a[ base_type::a2_ ];
+ }
+
+ template<class A> bool operator()( type<bool>, logical_or & /*f*/, A & a, int )
+ {
+ return a[ base_type::a1_ ] || a[ base_type::a2_ ];
+ }
+
+ template<class A> bool operator()( type<bool>, logical_or const & /*f*/, A & a, int ) const
+ {
+ return a[ base_type::a1_ ] || a[ base_type::a2_ ];
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list2 const & rhs) const
+ {
+ return ref_compare(base_type::a1_, rhs.a1_, 0) && ref_compare(base_type::a2_, rhs.a2_, 0);
+ }
+};
+
+template< class A1, class A2, class A3 > class list3: private storage3< A1, A2, A3 >
+{
+private:
+
+ typedef storage3< A1, A2, A3 > base_type;
+
+public:
+
+ list3( A1 a1, A2 a2, A3 a3 ): base_type( a1, a2, a3 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list3 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 );
+ }
+};
+
+template< class A1, class A2, class A3, class A4 > class list4: private storage4< A1, A2, A3, A4 >
+{
+private:
+
+ typedef storage4< A1, A2, A3, A4 > base_type;
+
+public:
+
+ list4( A1 a1, A2 a2, A3 a3, A4 a4 ): base_type( a1, a2, a3, a4 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4>) const { return base_type::a4_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4> (*) ()) const { return base_type::a4_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list4 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 );
+ }
+};
+
+template< class A1, class A2, class A3, class A4, class A5 > class list5: private storage5< A1, A2, A3, A4, A5 >
+{
+private:
+
+ typedef storage5< A1, A2, A3, A4, A5 > base_type;
+
+public:
+
+ list5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): base_type( a1, a2, a3, a4, a5 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5>) const { return base_type::a5_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5> (*) ()) const { return base_type::a5_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list5 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 );
+ }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> class list6: private storage6< A1, A2, A3, A4, A5, A6 >
+{
+private:
+
+ typedef storage6< A1, A2, A3, A4, A5, A6 > base_type;
+
+public:
+
+ list6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): base_type( a1, a2, a3, a4, a5, a6 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6>) const { return base_type::a6_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6> (*) ()) const { return base_type::a6_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list6 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 );
+ }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> class list7: private storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+private:
+
+ typedef storage7< A1, A2, A3, A4, A5, A6, A7 > base_type;
+
+public:
+
+ list7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): base_type( a1, a2, a3, a4, a5, a6, a7 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6>) const { return base_type::a6_; }
+ A7 operator[] (ndnboost::arg<7>) const { return base_type::a7_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6> (*) ()) const { return base_type::a6_; }
+ A7 operator[] (ndnboost::arg<7> (*) ()) const { return base_type::a7_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list7 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
+ ref_compare( base_type::a7_, rhs.a7_, 0 );
+ }
+};
+
+template< class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 > class list8: private storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+private:
+
+ typedef storage8< A1, A2, A3, A4, A5, A6, A7, A8 > base_type;
+
+public:
+
+ list8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6>) const { return base_type::a6_; }
+ A7 operator[] (ndnboost::arg<7>) const { return base_type::a7_; }
+ A8 operator[] (ndnboost::arg<8>) const { return base_type::a8_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6> (*) ()) const { return base_type::a6_; }
+ A7 operator[] (ndnboost::arg<7> (*) ()) const { return base_type::a7_; }
+ A8 operator[] (ndnboost::arg<8> (*) ()) const { return base_type::a8_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list8 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
+ ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
+ ref_compare( base_type::a8_, rhs.a8_, 0 );
+ }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> class list9: private storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 >
+{
+private:
+
+ typedef storage9< A1, A2, A3, A4, A5, A6, A7, A8, A9 > base_type;
+
+public:
+
+ list9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): base_type( a1, a2, a3, a4, a5, a6, a7, a8, a9 ) {}
+
+ A1 operator[] (ndnboost::arg<1>) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2>) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3>) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4>) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5>) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6>) const { return base_type::a6_; }
+ A7 operator[] (ndnboost::arg<7>) const { return base_type::a7_; }
+ A8 operator[] (ndnboost::arg<8>) const { return base_type::a8_; }
+ A9 operator[] (ndnboost::arg<9>) const { return base_type::a9_; }
+
+ A1 operator[] (ndnboost::arg<1> (*) ()) const { return base_type::a1_; }
+ A2 operator[] (ndnboost::arg<2> (*) ()) const { return base_type::a2_; }
+ A3 operator[] (ndnboost::arg<3> (*) ()) const { return base_type::a3_; }
+ A4 operator[] (ndnboost::arg<4> (*) ()) const { return base_type::a4_; }
+ A5 operator[] (ndnboost::arg<5> (*) ()) const { return base_type::a5_; }
+ A6 operator[] (ndnboost::arg<6> (*) ()) const { return base_type::a6_; }
+ A7 operator[] (ndnboost::arg<7> (*) ()) const { return base_type::a7_; }
+ A8 operator[] (ndnboost::arg<8> (*) ()) const { return base_type::a8_; }
+ A9 operator[] (ndnboost::arg<9> (*) ()) const { return base_type::a9_; }
+
+ template<class T> T & operator[] (_bi::value<T> & v) const { return v.get(); }
+
+ template<class T> T const & operator[] (_bi::value<T> const & v) const { return v.get(); }
+
+ template<class T> T & operator[] (reference_wrapper<T> const & v) const { return v.get(); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> & b) const { return b.eval(*this); }
+
+ template<class R, class F, class L> typename result_traits<R, F>::type operator[] (bind_t<R, F, L> const & b) const { return b.eval(*this); }
+
+ template<class R, class F, class A> R operator()(type<R>, F & f, A & a, long)
+ {
+ return unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class R, class F, class A> R operator()(type<R>, F const & f, A & a, long) const
+ {
+ return unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F & f, A & a, int)
+ {
+ unwrapper<F>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class F, class A> void operator()(type<void>, F const & f, A & a, int) const
+ {
+ unwrapper<F const>::unwrap(f, 0)(a[base_type::a1_], a[base_type::a2_], a[base_type::a3_], a[base_type::a4_], a[base_type::a5_], a[base_type::a6_], a[base_type::a7_], a[base_type::a8_], a[base_type::a9_]);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+ base_type::accept(v);
+ }
+
+ bool operator==(list9 const & rhs) const
+ {
+ return
+
+ ref_compare( base_type::a1_, rhs.a1_, 0 ) &&
+ ref_compare( base_type::a2_, rhs.a2_, 0 ) &&
+ ref_compare( base_type::a3_, rhs.a3_, 0 ) &&
+ ref_compare( base_type::a4_, rhs.a4_, 0 ) &&
+ ref_compare( base_type::a5_, rhs.a5_, 0 ) &&
+ ref_compare( base_type::a6_, rhs.a6_, 0 ) &&
+ ref_compare( base_type::a7_, rhs.a7_, 0 ) &&
+ ref_compare( base_type::a8_, rhs.a8_, 0 ) &&
+ ref_compare( base_type::a9_, rhs.a9_, 0 );
+ }
+};
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+// bind_t
+
+#ifndef BOOST_NO_VOID_RETURNS
+
+template<class R, class F, class L> class bind_t
+{
+public:
+
+ typedef bind_t this_type;
+
+ bind_t(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_RETURN return
+#include <ndnboost/bind/bind_template.hpp>
+#undef BOOST_BIND_RETURN
+
+};
+
+#else
+
+template<class R> struct bind_t_generator
+{
+
+template<class F, class L> class implementation
+{
+public:
+
+ typedef implementation this_type;
+
+ implementation(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_RETURN return
+#include <ndnboost/bind/bind_template.hpp>
+#undef BOOST_BIND_RETURN
+
+};
+
+};
+
+template<> struct bind_t_generator<void>
+{
+
+template<class F, class L> class implementation
+{
+private:
+
+ typedef void R;
+
+public:
+
+ typedef implementation this_type;
+
+ implementation(F f, L const & l): f_(f), l_(l) {}
+
+#define BOOST_BIND_RETURN
+#include <ndnboost/bind/bind_template.hpp>
+#undef BOOST_BIND_RETURN
+
+};
+
+};
+
+template<class R2, class F, class L> class bind_t: public bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>
+{
+public:
+
+ bind_t(F f, L const & l): bind_t_generator<R2>::BOOST_NESTED_TEMPLATE implementation<F, L>(f, l) {}
+
+};
+
+#endif
+
+// function_equal
+
+#ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+// put overloads in _bi, rely on ADL
+
+# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template<class R, class F, class L> bool function_equal( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b )
+{
+ return a.compare(b);
+}
+
+# else
+
+template<class R, class F, class L> bool function_equal_impl( bind_t<R, F, L> const & a, bind_t<R, F, L> const & b, int )
+{
+ return a.compare(b);
+}
+
+# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+#else // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+// put overloads in boost
+
+} // namespace _bi
+
+# ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+template<class R, class F, class L> bool function_equal( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b )
+{
+ return a.compare(b);
+}
+
+# else
+
+template<class R, class F, class L> bool function_equal_impl( _bi::bind_t<R, F, L> const & a, _bi::bind_t<R, F, L> const & b, int )
+{
+ return a.compare(b);
+}
+
+# endif // #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
+
+namespace _bi
+{
+
+#endif // BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
+
+// add_value
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || (__SUNPRO_CC >= 0x530)
+
+#if defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x582) )
+
+template<class T> struct add_value
+{
+ typedef _bi::value<T> type;
+};
+
+#else
+
+template< class T, int I > struct add_value_2
+{
+ typedef ndnboost::arg<I> type;
+};
+
+template< class T > struct add_value_2< T, 0 >
+{
+ typedef _bi::value< T > type;
+};
+
+template<class T> struct add_value
+{
+ typedef typename add_value_2< T, ndnboost::is_placeholder< T >::value >::type type;
+};
+
+#endif
+
+template<class T> struct add_value< value<T> >
+{
+ typedef _bi::value<T> type;
+};
+
+template<class T> struct add_value< reference_wrapper<T> >
+{
+ typedef reference_wrapper<T> type;
+};
+
+template<int I> struct add_value< arg<I> >
+{
+ typedef ndnboost::arg<I> type;
+};
+
+template<int I> struct add_value< arg<I> (*) () >
+{
+ typedef ndnboost::arg<I> (*type) ();
+};
+
+template<class R, class F, class L> struct add_value< bind_t<R, F, L> >
+{
+ typedef bind_t<R, F, L> type;
+};
+
+#else
+
+template<int I> struct _avt_0;
+
+template<> struct _avt_0<1>
+{
+ template<class T> struct inner
+ {
+ typedef T type;
+ };
+};
+
+template<> struct _avt_0<2>
+{
+ template<class T> struct inner
+ {
+ typedef value<T> type;
+ };
+};
+
+typedef char (&_avt_r1) [1];
+typedef char (&_avt_r2) [2];
+
+template<class T> _avt_r1 _avt_f(value<T>);
+template<class T> _avt_r1 _avt_f(reference_wrapper<T>);
+template<int I> _avt_r1 _avt_f(arg<I>);
+template<int I> _avt_r1 _avt_f(arg<I> (*) ());
+template<class R, class F, class L> _avt_r1 _avt_f(bind_t<R, F, L>);
+
+_avt_r2 _avt_f(...);
+
+template<class T> struct add_value
+{
+ static T t();
+ typedef typename _avt_0<sizeof(_avt_f(t()))>::template inner<T>::type type;
+};
+
+#endif
+
+// list_av_N
+
+template<class A1> struct list_av_1
+{
+ typedef typename add_value<A1>::type B1;
+ typedef list1<B1> type;
+};
+
+template<class A1, class A2> struct list_av_2
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef list2<B1, B2> type;
+};
+
+template<class A1, class A2, class A3> struct list_av_3
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef list3<B1, B2, B3> type;
+};
+
+template<class A1, class A2, class A3, class A4> struct list_av_4
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef list4<B1, B2, B3, B4> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5> struct list_av_5
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef list5<B1, B2, B3, B4, B5> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> struct list_av_6
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef list6<B1, B2, B3, B4, B5, B6> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct list_av_7
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef typename add_value<A7>::type B7;
+ typedef list7<B1, B2, B3, B4, B5, B6, B7> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct list_av_8
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef typename add_value<A7>::type B7;
+ typedef typename add_value<A8>::type B8;
+ typedef list8<B1, B2, B3, B4, B5, B6, B7, B8> type;
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct list_av_9
+{
+ typedef typename add_value<A1>::type B1;
+ typedef typename add_value<A2>::type B2;
+ typedef typename add_value<A3>::type B3;
+ typedef typename add_value<A4>::type B4;
+ typedef typename add_value<A5>::type B5;
+ typedef typename add_value<A6>::type B6;
+ typedef typename add_value<A7>::type B7;
+ typedef typename add_value<A8>::type B8;
+ typedef typename add_value<A9>::type B9;
+ typedef list9<B1, B2, B3, B4, B5, B6, B7, B8, B9> type;
+};
+
+// operator!
+
+struct logical_not
+{
+ template<class V> bool operator()(V const & v) const { return !v; }
+};
+
+template<class R, class F, class L>
+ bind_t< bool, logical_not, list1< bind_t<R, F, L> > >
+ operator! (bind_t<R, F, L> const & f)
+{
+ typedef list1< bind_t<R, F, L> > list_type;
+ return bind_t<bool, logical_not, list_type> ( logical_not(), list_type(f) );
+}
+
+// relational operators
+
+#define BOOST_BIND_OPERATOR( op, name ) \
+\
+struct name \
+{ \
+ template<class V, class W> bool operator()(V const & v, W const & w) const { return v op w; } \
+}; \
+ \
+template<class R, class F, class L, class A2> \
+ bind_t< bool, name, list2< bind_t<R, F, L>, typename add_value<A2>::type > > \
+ operator op (bind_t<R, F, L> const & f, A2 a2) \
+{ \
+ typedef typename add_value<A2>::type B2; \
+ typedef list2< bind_t<R, F, L>, B2> list_type; \
+ return bind_t<bool, name, list_type> ( name(), list_type(f, a2) ); \
+}
+
+BOOST_BIND_OPERATOR( ==, equal )
+BOOST_BIND_OPERATOR( !=, not_equal )
+
+BOOST_BIND_OPERATOR( <, less )
+BOOST_BIND_OPERATOR( <=, less_equal )
+
+BOOST_BIND_OPERATOR( >, greater )
+BOOST_BIND_OPERATOR( >=, greater_equal )
+
+BOOST_BIND_OPERATOR( &&, logical_and )
+BOOST_BIND_OPERATOR( ||, logical_or )
+
+#undef BOOST_BIND_OPERATOR
+
+#if defined(__GNUC__) && BOOST_WORKAROUND(__GNUC__, < 3)
+
+// resolve ambiguity with rel_ops
+
+#define BOOST_BIND_OPERATOR( op, name ) \
+\
+template<class R, class F, class L> \
+ bind_t< bool, name, list2< bind_t<R, F, L>, bind_t<R, F, L> > > \
+ operator op (bind_t<R, F, L> const & f, bind_t<R, F, L> const & g) \
+{ \
+ typedef list2< bind_t<R, F, L>, bind_t<R, F, L> > list_type; \
+ return bind_t<bool, name, list_type> ( name(), list_type(f, g) ); \
+}
+
+BOOST_BIND_OPERATOR( !=, not_equal )
+BOOST_BIND_OPERATOR( <=, less_equal )
+BOOST_BIND_OPERATOR( >, greater )
+BOOST_BIND_OPERATOR( >=, greater_equal )
+
+#endif
+
+// visit_each, ADL
+
+#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ ) \
+ && !(defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
+
+template<class V, class T> void visit_each( V & v, value<T> const & t, int )
+{
+ using ndnboost::visit_each;
+ BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
+}
+
+template<class V, class R, class F, class L> void visit_each( V & v, bind_t<R, F, L> const & t, int )
+{
+ t.accept( v );
+}
+
+#endif
+
+} // namespace _bi
+
+// visit_each, no ADL
+
+#if defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) || defined( __BORLANDC__ ) \
+ || (defined(__GNUC__) && __GNUC__ == 3 && __GNUC_MINOR__ <= 3)
+
+template<class V, class T> void visit_each( V & v, _bi::value<T> const & t, int )
+{
+ BOOST_BIND_VISIT_EACH( v, t.get(), 0 );
+}
+
+template<class V, class R, class F, class L> void visit_each( V & v, _bi::bind_t<R, F, L> const & t, int )
+{
+ t.accept( v );
+}
+
+#endif
+
+// is_bind_expression
+
+template< class T > struct is_bind_expression
+{
+ enum _vt { value = 0 };
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template< class R, class F, class L > struct is_bind_expression< _bi::bind_t< R, F, L > >
+{
+ enum _vt { value = 1 };
+};
+
+#endif
+
+// bind
+
+#ifndef BOOST_BIND
+#define BOOST_BIND bind
+#endif
+
+// generic function objects
+
+template<class R, class F>
+ _bi::bind_t<R, F, _bi::list0>
+ BOOST_BIND(F f)
+{
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class F, class A1>
+ _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(F f, A1 a1)
+{
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class F, class A1, class A2>
+ _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2)
+{
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R, class F, class A1, class A2, class A3>
+ _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
+{
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+// generic function objects, alternative syntax
+
+template<class R, class F>
+ _bi::bind_t<R, F, _bi::list0>
+ BOOST_BIND(ndnboost::type<R>, F f)
+{
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class F, class A1>
+ _bi::bind_t<R, F, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1)
+{
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class F, class A1, class A2>
+ _bi::bind_t<R, F, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2)
+{
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R, class F, class A1, class A2, class A3>
+ _bi::bind_t<R, F, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3)
+{
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(ndnboost::type<R>, F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+// adaptable function objects
+
+template<class F>
+ _bi::bind_t<_bi::unspecified, F, _bi::list0>
+ BOOST_BIND(F f)
+{
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type());
+}
+
+template<class F, class A1>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(F f, A1 a1)
+{
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1));
+}
+
+template<class F, class A1, class A2>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2)
+{
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class F, class A1, class A2, class A3>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3)
+{
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class F, class A1, class A2, class A3, class A4>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class F, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<_bi::unspecified, F, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(F f, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<_bi::unspecified, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
+
+// function pointers
+
+#define BOOST_BIND_CC
+#define BOOST_BIND_ST
+
+#include <ndnboost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#ifdef BOOST_BIND_ENABLE_STDCALL
+
+#define BOOST_BIND_CC __stdcall
+#define BOOST_BIND_ST
+
+#include <ndnboost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#endif
+
+#ifdef BOOST_BIND_ENABLE_FASTCALL
+
+#define BOOST_BIND_CC __fastcall
+#define BOOST_BIND_ST
+
+#include <ndnboost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_CC
+#undef BOOST_BIND_ST
+
+#endif
+
+#ifdef BOOST_BIND_ENABLE_PASCAL
+
+#define BOOST_BIND_ST pascal
+#define BOOST_BIND_CC
+
+#include <ndnboost/bind/bind_cc.hpp>
+
+#undef BOOST_BIND_ST
+#undef BOOST_BIND_CC
+
+#endif
+
+// member function pointers
+
+#define BOOST_BIND_MF_NAME(X) X
+#define BOOST_BIND_MF_CC
+
+#include <ndnboost/bind/bind_mf_cc.hpp>
+#include <ndnboost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_BIND_MF_NAME(X) X##_cdecl
+#define BOOST_BIND_MF_CC __cdecl
+
+#include <ndnboost/bind/bind_mf_cc.hpp>
+#include <ndnboost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_BIND_MF_NAME(X) X##_stdcall
+#define BOOST_BIND_MF_CC __stdcall
+
+#include <ndnboost/bind/bind_mf_cc.hpp>
+#include <ndnboost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_BIND_MF_NAME(X) X##_fastcall
+#define BOOST_BIND_MF_CC __fastcall
+
+#include <ndnboost/bind/bind_mf_cc.hpp>
+#include <ndnboost/bind/bind_mf2_cc.hpp>
+
+#undef BOOST_BIND_MF_NAME
+#undef BOOST_BIND_MF_CC
+
+#endif
+
+// data member pointers
+
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) || defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ || ( defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x620 ) ) )
+
+template<class R, class T, class A1>
+_bi::bind_t< R, _mfi::dm<R, T>, typename _bi::list_av_1<A1>::type >
+ BOOST_BIND(R T::*f, A1 a1)
+{
+ typedef _mfi::dm<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>( F(f), list_type(a1) );
+}
+
+#else
+
+namespace _bi
+{
+
+template< class Pm, int I > struct add_cref;
+
+template< class M, class T > struct add_cref< M T::*, 0 >
+{
+ typedef M type;
+};
+
+template< class M, class T > struct add_cref< M T::*, 1 >
+{
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4180)
+#endif
+ typedef M const & type;
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+};
+
+template< class R, class T > struct add_cref< R (T::*) (), 1 >
+{
+ typedef void type;
+};
+
+#if !defined(__IBMCPP__) || __IBMCPP_FUNC_CV_TMPL_ARG_DEDUCTION
+
+template< class R, class T > struct add_cref< R (T::*) () const, 1 >
+{
+ typedef void type;
+};
+
+#endif // __IBMCPP__
+
+template<class R> struct isref
+{
+ enum value_type { value = 0 };
+};
+
+template<class R> struct isref< R& >
+{
+ enum value_type { value = 1 };
+};
+
+template<class R> struct isref< R* >
+{
+ enum value_type { value = 1 };
+};
+
+template<class Pm, class A1> struct dm_result
+{
+ typedef typename add_cref< Pm, 1 >::type type;
+};
+
+template<class Pm, class R, class F, class L> struct dm_result< Pm, bind_t<R, F, L> >
+{
+ typedef typename bind_t<R, F, L>::result_type result_type;
+ typedef typename add_cref< Pm, isref< result_type >::value >::type type;
+};
+
+} // namespace _bi
+
+template< class A1, class M, class T >
+
+_bi::bind_t<
+ typename _bi::dm_result< M T::*, A1 >::type,
+ _mfi::dm<M, T>,
+ typename _bi::list_av_1<A1>::type
+>
+
+BOOST_BIND( M T::*f, A1 a1 )
+{
+ typedef typename _bi::dm_result< M T::*, A1 >::type result_type;
+ typedef _mfi::dm<M, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t< result_type, F, list_type >( F( f ), list_type( a1 ) );
+}
+
+#endif
+
+} // namespace ndnboost
+
+#ifndef BOOST_BIND_NO_PLACEHOLDERS
+
+# include <ndnboost/bind/placeholders.hpp>
+
+#endif
+
+#ifdef BOOST_MSVC
+# pragma warning(default: 4512) // assignment operator could not be generated
+# pragma warning(pop)
+#endif
+
+#endif // #ifndef BOOST_BIND_BIND_HPP_INCLUDED
diff --git a/ndnboost/bind/bind_cc.hpp b/ndnboost/bind/bind_cc.hpp
new file mode 100644
index 0000000..35f8ece
--- /dev/null
+++ b/ndnboost/bind/bind_cc.hpp
@@ -0,0 +1,117 @@
+//
+// bind/bind_cc.hpp - support for different calling conventions
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+template<class R>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (), _bi::list0>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) ())
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) ();
+ typedef _bi::list0 list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type());
+}
+
+template<class R, class B1, class A1>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1), typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1), A1 a1)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1);
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1));
+}
+
+template<class R, class B1, class B2, class A1, class A2>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2), typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2), A1 a1, A2 a2)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2);
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type> (f, list_type(a1, a2));
+}
+
+template<class R,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3), typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3), A1 a1, A2 a2, A3 a3)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3);
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4), typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4);
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5), typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5);
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6), typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6);
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7), typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7);
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8), typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8);
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8, class B9,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, BOOST_BIND_ST R (BOOST_BIND_CC *) (B1, B2, B3, B4, B5, B6, B7, B8, B9), typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(BOOST_BIND_ST R (BOOST_BIND_CC *f) (B1, B2, B3, B4, B5, B6, B7, B8, B9), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef BOOST_BIND_ST R (BOOST_BIND_CC *F) (B1, B2, B3, B4, B5, B6, B7, B8, B9);
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(f, list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
diff --git a/ndnboost/bind/bind_mf2_cc.hpp b/ndnboost/bind/bind_mf2_cc.hpp
new file mode 100644
index 0000000..efb8b25
--- /dev/null
+++ b/ndnboost/bind/bind_mf2_cc.hpp
@@ -0,0 +1,228 @@
+//
+// bind/bind_mf2_cc.hpp - member functions, type<> syntax
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2008 Peter Dimov
+//
+// 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
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+// 0
+
+template<class Rt2, class R, class T,
+ class A1>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
+}
+
+template<class Rt2, class R, class T,
+ class A1>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1));
+}
+
+// 1
+
+template<class Rt2, class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class Rt2, class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2));
+}
+
+// 2
+
+template<class Rt2, class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+// 3
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+// 4
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+// 5
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+// 6
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+// 7
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+// 8
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class Rt2, class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<Rt2, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(ndnboost::type<Rt2>, R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<Rt2, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
diff --git a/ndnboost/bind/bind_mf_cc.hpp b/ndnboost/bind/bind_mf_cc.hpp
new file mode 100644
index 0000000..88be822
--- /dev/null
+++ b/ndnboost/bind/bind_mf_cc.hpp
@@ -0,0 +1,227 @@
+//
+// bind/bind_mf_cc.hpp - support for different calling conventions
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+// 0
+
+template<class R, class T,
+ class A1>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (), A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+template<class R, class T,
+ class A1>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T>, typename _bi::list_av_1<A1>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) () const, A1 a1)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf0)<R, T> F;
+ typedef typename _bi::list_av_1<A1>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1));
+}
+
+// 1
+
+template<class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1), A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
+}
+
+template<class R, class T,
+ class B1,
+ class A1, class A2>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1>, typename _bi::list_av_2<A1, A2>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1) const, A1 a1, A2 a2)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf1)<R, T, B1> F;
+ typedef typename _bi::list_av_2<A1, A2>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2));
+}
+
+// 2
+
+template<class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2), A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+template<class R, class T,
+ class B1, class B2,
+ class A1, class A2, class A3>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2>, typename _bi::list_av_3<A1, A2, A3>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2) const, A1 a1, A2 a2, A3 a3)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf2)<R, T, B1, B2> F;
+ typedef typename _bi::list_av_3<A1, A2, A3>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3));
+}
+
+// 3
+
+template<class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3), A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3,
+ class A1, class A2, class A3, class A4>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3>, typename _bi::list_av_4<A1, A2, A3, A4>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3) const, A1 a1, A2 a2, A3 a3, A4 a4)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf3)<R, T, B1, B2, B3> F;
+ typedef typename _bi::list_av_4<A1, A2, A3, A4>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4));
+}
+
+// 4
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4,
+ class A1, class A2, class A3, class A4, class A5>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4>, typename _bi::list_av_5<A1, A2, A3, A4, A5>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf4)<R, T, B1, B2, B3, B4> F;
+ typedef typename _bi::list_av_5<A1, A2, A3, A4, A5>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5));
+}
+
+// 5
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5,
+ class A1, class A2, class A3, class A4, class A5, class A6>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5>, typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf5)<R, T, B1, B2, B3, B4, B5> F;
+ typedef typename _bi::list_av_6<A1, A2, A3, A4, A5, A6>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6));
+}
+
+// 6
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6>, typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf6)<R, T, B1, B2, B3, B4, B5, B6> F;
+ typedef typename _bi::list_av_7<A1, A2, A3, A4, A5, A6, A7>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7));
+}
+
+// 7
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7>, typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf7)<R, T, B1, B2, B3, B4, B5, B6, B7> F;
+ typedef typename _bi::list_av_8<A1, A2, A3, A4, A5, A6, A7, A8>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8));
+}
+
+// 8
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8), A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(mf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
+
+template<class R, class T,
+ class B1, class B2, class B3, class B4, class B5, class B6, class B7, class B8,
+ class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ _bi::bind_t<R, _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8>, typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type>
+ BOOST_BIND(R (BOOST_BIND_MF_CC T::*f) (B1, B2, B3, B4, B5, B6, B7, B8) const, A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9)
+{
+ typedef _mfi::BOOST_BIND_MF_NAME(cmf8)<R, T, B1, B2, B3, B4, B5, B6, B7, B8> F;
+ typedef typename _bi::list_av_9<A1, A2, A3, A4, A5, A6, A7, A8, A9>::type list_type;
+ return _bi::bind_t<R, F, list_type>(F(f), list_type(a1, a2, a3, a4, a5, a6, a7, a8, a9));
+}
diff --git a/ndnboost/bind/bind_template.hpp b/ndnboost/bind/bind_template.hpp
new file mode 100644
index 0000000..6946aa9
--- /dev/null
+++ b/ndnboost/bind/bind_template.hpp
@@ -0,0 +1,345 @@
+//
+// bind/bind_template.hpp
+//
+// Do not include this header directly.
+//
+// Copyright (c) 2001-2004 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+ typedef typename result_traits<R, F>::type result_type;
+
+ result_type operator()()
+ {
+ list0 a;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ result_type operator()() const
+ {
+ list0 a;
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1> result_type operator()(A1 & a1)
+ {
+ list1<A1 &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1> result_type operator()(A1 & a1) const
+ {
+ list1<A1 &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1> result_type operator()(A1 const & a1)
+ {
+ list1<A1 const &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1> result_type operator()(A1 const & a1) const
+ {
+ list1<A1 const &> a(a1);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
+ {
+ list2<A1 &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
+ {
+ list2<A1 &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
+ {
+ list2<A1 const &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
+ {
+ list2<A1 const &, A2 &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
+ {
+ list2<A1 &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
+ {
+ list2<A1 &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
+ {
+ list2<A1 const &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
+ {
+ list2<A1 const &, A2 const &> a(a1, a2);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
+ {
+ list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
+ {
+ list3<A1 &, A2 &, A3 &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3)
+ {
+ list3<A1 const &, A2 const &, A3 const &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const
+ {
+ list3<A1 const &, A2 const &, A3 const &> a(a1, a2, a3);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
+ {
+ list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+ {
+ list4<A1 &, A2 &, A3 &, A4 &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4)
+ {
+ list4<A1 const &, A2 const &, A3 const &, A4 const &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const
+ {
+ list4<A1 const &, A2 const &, A3 const &, A4 const &> a(a1, a2, a3, a4);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
+ {
+ list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+ {
+ list5<A1 &, A2 &, A3 &, A4 &, A5 &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5)
+ {
+ list5<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const
+ {
+ list5<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &> a(a1, a2, a3, a4, a5);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
+ {
+ list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+ {
+ list6<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6)
+ {
+ list6<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const
+ {
+ list6<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &> a(a1, a2, a3, a4, a5, a6);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
+ {
+ list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+ {
+ list7<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7)
+ {
+ list7<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const
+ {
+ list7<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &> a(a1, a2, a3, a4, a5, a6, a7);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
+ {
+ list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+ {
+ list8<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8)
+ {
+ list8<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const
+ {
+ list8<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &> a(a1, a2, a3, a4, a5, a6, a7, a8);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
+ {
+ list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+ {
+ list9<A1 &, A2 &, A3 &, A4 &, A5 &, A6 &, A7 &, A8 &, A9 &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9)
+ {
+ list9<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &, A9 const &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const
+ {
+ list9<A1 const &, A2 const &, A3 const &, A4 const &, A5 const &, A6 const &, A7 const &, A8 const &, A9 const &> a(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+#endif
+
+ template<class A> result_type eval(A & a)
+ {
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class A> result_type eval(A & a) const
+ {
+ BOOST_BIND_RETURN l_(type<result_type>(), f_, a, 0);
+ }
+
+ template<class V> void accept(V & v) const
+ {
+#if !defined( BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP ) && !defined( __BORLANDC__ )
+
+ using ndnboost::visit_each;
+
+#endif
+ BOOST_BIND_VISIT_EACH(v, f_, 0);
+ l_.accept(v);
+ }
+
+ bool compare(this_type const & rhs) const
+ {
+ return ref_compare(f_, rhs.f_, 0) && l_ == rhs.l_;
+ }
+
+private:
+
+ F f_;
+ L l_;
diff --git a/ndnboost/bind/make_adaptable.hpp b/ndnboost/bind/make_adaptable.hpp
new file mode 100644
index 0000000..77742f0
--- /dev/null
+++ b/ndnboost/bind/make_adaptable.hpp
@@ -0,0 +1,187 @@
+#ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
+#define BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
+
+//
+// make_adaptable.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+
+namespace ndnboost
+{
+
+namespace _bi
+{
+
+template<class R, class F> class af0
+{
+public:
+
+ typedef R result_type;
+
+ explicit af0(F f): f_(f)
+ {
+ }
+
+ result_type operator()()
+ {
+ return f_();
+ }
+
+ result_type operator()() const
+ {
+ return f_();
+ }
+
+private:
+
+ F f_;
+};
+
+template<class R, class A1, class F> class af1
+{
+public:
+
+ typedef R result_type;
+ typedef A1 argument_type;
+ typedef A1 arg1_type;
+
+ explicit af1(F f): f_(f)
+ {
+ }
+
+ result_type operator()(A1 a1)
+ {
+ return f_(a1);
+ }
+
+ result_type operator()(A1 a1) const
+ {
+ return f_(a1);
+ }
+
+private:
+
+ F f_;
+};
+
+template<class R, class A1, class A2, class F> class af2
+{
+public:
+
+ typedef R result_type;
+ typedef A1 first_argument_type;
+ typedef A2 second_argument_type;
+ typedef A1 arg1_type;
+ typedef A2 arg2_type;
+
+ explicit af2(F f): f_(f)
+ {
+ }
+
+ result_type operator()(A1 a1, A2 a2)
+ {
+ return f_(a1, a2);
+ }
+
+ result_type operator()(A1 a1, A2 a2) const
+ {
+ return f_(a1, a2);
+ }
+
+private:
+
+ F f_;
+};
+
+template<class R, class A1, class A2, class A3, class F> class af3
+{
+public:
+
+ typedef R result_type;
+ typedef A1 arg1_type;
+ typedef A2 arg2_type;
+ typedef A3 arg3_type;
+
+ explicit af3(F f): f_(f)
+ {
+ }
+
+ result_type operator()(A1 a1, A2 a2, A3 a3)
+ {
+ return f_(a1, a2, a3);
+ }
+
+ result_type operator()(A1 a1, A2 a2, A3 a3) const
+ {
+ return f_(a1, a2, a3);
+ }
+
+private:
+
+ F f_;
+};
+
+template<class R, class A1, class A2, class A3, class A4, class F> class af4
+{
+public:
+
+ typedef R result_type;
+ typedef A1 arg1_type;
+ typedef A2 arg2_type;
+ typedef A3 arg3_type;
+ typedef A4 arg4_type;
+
+ explicit af4(F f): f_(f)
+ {
+ }
+
+ result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4)
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
+ result_type operator()(A1 a1, A2 a2, A3 a3, A4 a4) const
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
+private:
+
+ F f_;
+};
+
+} // namespace _bi
+
+template<class R, class F> _bi::af0<R, F> make_adaptable(F f)
+{
+ return _bi::af0<R, F>(f);
+}
+
+template<class R, class A1, class F> _bi::af1<R, A1, F> make_adaptable(F f)
+{
+ return _bi::af1<R, A1, F>(f);
+}
+
+template<class R, class A1, class A2, class F> _bi::af2<R, A1, A2, F> make_adaptable(F f)
+{
+ return _bi::af2<R, A1, A2, F>(f);
+}
+
+template<class R, class A1, class A2, class A3, class F> _bi::af3<R, A1, A2, A3, F> make_adaptable(F f)
+{
+ return _bi::af3<R, A1, A2, A3, F>(f);
+}
+
+template<class R, class A1, class A2, class A3, class A4, class F> _bi::af4<R, A1, A2, A3, A4, F> make_adaptable(F f)
+{
+ return _bi::af4<R, A1, A2, A3, A4, F>(f);
+}
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_BIND_MAKE_ADAPTABLE_HPP_INCLUDED
diff --git a/ndnboost/bind/placeholders.hpp b/ndnboost/bind/placeholders.hpp
new file mode 100644
index 0000000..0b9f0fc
--- /dev/null
+++ b/ndnboost/bind/placeholders.hpp
@@ -0,0 +1,69 @@
+#ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
+#define BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind/placeholders.hpp - _N definitions
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+//
+// 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)
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <ndnboost/bind/arg.hpp>
+#include <ndnboost/config.hpp>
+
+namespace
+{
+
+#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
+
+static inline ndnboost::arg<1> _1() { return ndnboost::arg<1>(); }
+static inline ndnboost::arg<2> _2() { return ndnboost::arg<2>(); }
+static inline ndnboost::arg<3> _3() { return ndnboost::arg<3>(); }
+static inline ndnboost::arg<4> _4() { return ndnboost::arg<4>(); }
+static inline ndnboost::arg<5> _5() { return ndnboost::arg<5>(); }
+static inline ndnboost::arg<6> _6() { return ndnboost::arg<6>(); }
+static inline ndnboost::arg<7> _7() { return ndnboost::arg<7>(); }
+static inline ndnboost::arg<8> _8() { return ndnboost::arg<8>(); }
+static inline ndnboost::arg<9> _9() { return ndnboost::arg<9>(); }
+
+#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__) || \
+ defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
+
+static ndnboost::arg<1> _1;
+static ndnboost::arg<2> _2;
+static ndnboost::arg<3> _3;
+static ndnboost::arg<4> _4;
+static ndnboost::arg<5> _5;
+static ndnboost::arg<6> _6;
+static ndnboost::arg<7> _7;
+static ndnboost::arg<8> _8;
+static ndnboost::arg<9> _9;
+
+#else
+
+ndnboost::arg<1> _1;
+ndnboost::arg<2> _2;
+ndnboost::arg<3> _3;
+ndnboost::arg<4> _4;
+ndnboost::arg<5> _5;
+ndnboost::arg<6> _6;
+ndnboost::arg<7> _7;
+ndnboost::arg<8> _8;
+ndnboost::arg<9> _9;
+
+#endif
+
+} // unnamed namespace
+
+#endif // #ifndef BOOST_BIND_PLACEHOLDERS_HPP_INCLUDED
diff --git a/ndnboost/bind/protect.hpp b/ndnboost/bind/protect.hpp
new file mode 100644
index 0000000..4d70f84
--- /dev/null
+++ b/ndnboost/bind/protect.hpp
@@ -0,0 +1,304 @@
+#ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
+#define BOOST_BIND_PROTECT_HPP_INCLUDED
+
+//
+// protect.hpp
+//
+// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2009 Steven Watanabe
+//
+// 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)
+//
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+namespace ndnboost
+{
+
+namespace _bi
+{
+
+template<class F> class protected_bind_t
+{
+public:
+
+ typedef typename F::result_type result_type;
+
+ explicit protected_bind_t(F f): f_(f)
+ {
+ }
+
+ result_type operator()()
+ {
+ return f_();
+ }
+
+ result_type operator()() const
+ {
+ return f_();
+ }
+
+ template<class A1> result_type operator()(A1 & a1)
+ {
+ return f_(a1);
+ }
+
+ template<class A1> result_type operator()(A1 & a1) const
+ {
+ return f_(a1);
+ }
+
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1> result_type operator()(const A1 & a1)
+ {
+ return f_(a1);
+ }
+
+ template<class A1> result_type operator()(const A1 & a1) const
+ {
+ return f_(a1);
+ }
+
+#endif
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2)
+ {
+ return f_(a1, a2);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 & a2) const
+ {
+ return f_(a1, a2);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2)
+ {
+ return f_(a1, a2);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 & a2) const
+ {
+ return f_(a1, a2);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2)
+ {
+ return f_(a1, a2);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 & a1, A2 const & a2) const
+ {
+ return f_(a1, a2);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2)
+ {
+ return f_(a1, a2);
+ }
+
+ template<class A1, class A2> result_type operator()(A1 const & a1, A2 const & a2) const
+ {
+ return f_(a1, a2);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3)
+ {
+ return f_(a1, a2, a3);
+ }
+
+ template<class A1, class A2, class A3> result_type operator()(A1 & a1, A2 & a2, A3 & a3) const
+ {
+ return f_(a1, a2, a3);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3)
+ {
+ return f_(a1, a2, a3);
+ }
+
+ template<class A1, class A2, class A3> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3) const
+ {
+ return f_(a1, a2, a3);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4)
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4) const
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4)
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
+ template<class A1, class A2, class A3, class A4> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4) const
+ {
+ return f_(a1, a2, a3, a4);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5)
+ {
+ return f_(a1, a2, a3, a4, a5);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5) const
+ {
+ return f_(a1, a2, a3, a4, a5);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5)
+ {
+ return f_(a1, a2, a3, a4, a5);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5) const
+ {
+ return f_(a1, a2, a3, a4, a5);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6)
+ {
+ return f_(a1, a2, a3, a4, a5, a6);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6)
+ {
+ return f_(a1, a2, a3, a4, a5, a6);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7)
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7)
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8)
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8)
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+
+#endif
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9)
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 & a1, A2 & a2, A3 & a3, A4 & a4, A5 & a5, A6 & a6, A7 & a7, A8 & a8, A9 & a9) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+
+#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING) \
+ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238)
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9)
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> result_type operator()(A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9) const
+ {
+ return f_(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+
+#endif
+
+private:
+
+ F f_;
+};
+
+} // namespace _bi
+
+template<class F> _bi::protected_bind_t<F> protect(F f)
+{
+ return _bi::protected_bind_t<F>(f);
+}
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_BIND_PROTECT_HPP_INCLUDED
diff --git a/ndnboost/bind/storage.hpp b/ndnboost/bind/storage.hpp
new file mode 100644
index 0000000..5a97f4a
--- /dev/null
+++ b/ndnboost/bind/storage.hpp
@@ -0,0 +1,475 @@
+#ifndef BOOST_BIND_STORAGE_HPP_INCLUDED
+#define BOOST_BIND_STORAGE_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// bind/storage.hpp
+//
+// boost/bind.hpp support header, optimized storage
+//
+// Copyright (c) 2006 Peter Dimov
+//
+// 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
+//
+// See http://www.boost.org/libs/bind/bind.html for documentation.
+//
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/bind/arg.hpp>
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4512) // assignment operator could not be generated
+#endif
+
+namespace ndnboost
+{
+
+namespace _bi
+{
+
+// 1
+
+template<class A1> struct storage1
+{
+ explicit storage1( A1 a1 ): a1_( a1 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ BOOST_BIND_VISIT_EACH(v, a1_, 0);
+ }
+
+ A1 a1_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION ) && !defined( __BORLANDC__ )
+
+template<int I> struct storage1< ndnboost::arg<I> >
+{
+ explicit storage1( ndnboost::arg<I> ) {}
+
+ template<class V> void accept(V &) const { }
+
+ static ndnboost::arg<I> a1_() { return ndnboost::arg<I>(); }
+};
+
+template<int I> struct storage1< ndnboost::arg<I> (*) () >
+{
+ explicit storage1( ndnboost::arg<I> (*) () ) {}
+
+ template<class V> void accept(V &) const { }
+
+ static ndnboost::arg<I> a1_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 2
+
+template<class A1, class A2> struct storage2: public storage1<A1>
+{
+ typedef storage1<A1> inherited;
+
+ storage2( A1 a1, A2 a2 ): storage1<A1>( a1 ), a2_( a2 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a2_, 0);
+ }
+
+ A2 a2_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, int I> struct storage2< A1, ndnboost::arg<I> >: public storage1<A1>
+{
+ typedef storage1<A1> inherited;
+
+ storage2( A1 a1, ndnboost::arg<I> ): storage1<A1>( a1 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a2_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, int I> struct storage2< A1, ndnboost::arg<I> (*) () >: public storage1<A1>
+{
+ typedef storage1<A1> inherited;
+
+ storage2( A1 a1, ndnboost::arg<I> (*) () ): storage1<A1>( a1 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a2_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 3
+
+template<class A1, class A2, class A3> struct storage3: public storage2< A1, A2 >
+{
+ typedef storage2<A1, A2> inherited;
+
+ storage3( A1 a1, A2 a2, A3 a3 ): storage2<A1, A2>( a1, a2 ), a3_( a3 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a3_, 0);
+ }
+
+ A3 a3_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, int I> struct storage3< A1, A2, ndnboost::arg<I> >: public storage2< A1, A2 >
+{
+ typedef storage2<A1, A2> inherited;
+
+ storage3( A1 a1, A2 a2, ndnboost::arg<I> ): storage2<A1, A2>( a1, a2 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a3_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, int I> struct storage3< A1, A2, ndnboost::arg<I> (*) () >: public storage2< A1, A2 >
+{
+ typedef storage2<A1, A2> inherited;
+
+ storage3( A1 a1, A2 a2, ndnboost::arg<I> (*) () ): storage2<A1, A2>( a1, a2 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a3_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 4
+
+template<class A1, class A2, class A3, class A4> struct storage4: public storage3< A1, A2, A3 >
+{
+ typedef storage3<A1, A2, A3> inherited;
+
+ storage4( A1 a1, A2 a2, A3 a3, A4 a4 ): storage3<A1, A2, A3>( a1, a2, a3 ), a4_( a4 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a4_, 0);
+ }
+
+ A4 a4_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, ndnboost::arg<I> >: public storage3< A1, A2, A3 >
+{
+ typedef storage3<A1, A2, A3> inherited;
+
+ storage4( A1 a1, A2 a2, A3 a3, ndnboost::arg<I> ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a4_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, int I> struct storage4< A1, A2, A3, ndnboost::arg<I> (*) () >: public storage3< A1, A2, A3 >
+{
+ typedef storage3<A1, A2, A3> inherited;
+
+ storage4( A1 a1, A2 a2, A3 a3, ndnboost::arg<I> (*) () ): storage3<A1, A2, A3>( a1, a2, a3 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a4_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 5
+
+template<class A1, class A2, class A3, class A4, class A5> struct storage5: public storage4< A1, A2, A3, A4 >
+{
+ typedef storage4<A1, A2, A3, A4> inherited;
+
+ storage5( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5 ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ), a5_( a5 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a5_, 0);
+ }
+
+ A5 a5_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, ndnboost::arg<I> >: public storage4< A1, A2, A3, A4 >
+{
+ typedef storage4<A1, A2, A3, A4> inherited;
+
+ storage5( A1 a1, A2 a2, A3 a3, A4 a4, ndnboost::arg<I> ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a5_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, int I> struct storage5< A1, A2, A3, A4, ndnboost::arg<I> (*) () >: public storage4< A1, A2, A3, A4 >
+{
+ typedef storage4<A1, A2, A3, A4> inherited;
+
+ storage5( A1 a1, A2 a2, A3 a3, A4 a4, ndnboost::arg<I> (*) () ): storage4<A1, A2, A3, A4>( a1, a2, a3, a4 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a5_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 6
+
+template<class A1, class A2, class A3, class A4, class A5, class A6> struct storage6: public storage5< A1, A2, A3, A4, A5 >
+{
+ typedef storage5<A1, A2, A3, A4, A5> inherited;
+
+ storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6 ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ), a6_( a6 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a6_, 0);
+ }
+
+ A6 a6_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, ndnboost::arg<I> >: public storage5< A1, A2, A3, A4, A5 >
+{
+ typedef storage5<A1, A2, A3, A4, A5> inherited;
+
+ storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, ndnboost::arg<I> ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a6_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, int I> struct storage6< A1, A2, A3, A4, A5, ndnboost::arg<I> (*) () >: public storage5< A1, A2, A3, A4, A5 >
+{
+ typedef storage5<A1, A2, A3, A4, A5> inherited;
+
+ storage6( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, ndnboost::arg<I> (*) () ): storage5<A1, A2, A3, A4, A5>( a1, a2, a3, a4, a5 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a6_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 7
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7> struct storage7: public storage6< A1, A2, A3, A4, A5, A6 >
+{
+ typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
+
+ storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7 ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ), a7_( a7 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a7_, 0);
+ }
+
+ A7 a7_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, ndnboost::arg<I> >: public storage6< A1, A2, A3, A4, A5, A6 >
+{
+ typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
+
+ storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, ndnboost::arg<I> ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a7_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, int I> struct storage7< A1, A2, A3, A4, A5, A6, ndnboost::arg<I> (*) () >: public storage6< A1, A2, A3, A4, A5, A6 >
+{
+ typedef storage6<A1, A2, A3, A4, A5, A6> inherited;
+
+ storage7( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, ndnboost::arg<I> (*) () ): storage6<A1, A2, A3, A4, A5, A6>( a1, a2, a3, a4, a5, a6 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a7_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 8
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8> struct storage8: public storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+ typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
+
+ storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8 ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ), a8_( a8 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a8_, 0);
+ }
+
+ A8 a8_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, ndnboost::arg<I> >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+ typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
+
+ storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, ndnboost::arg<I> ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a8_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, int I> struct storage8< A1, A2, A3, A4, A5, A6, A7, ndnboost::arg<I> (*) () >: public storage7< A1, A2, A3, A4, A5, A6, A7 >
+{
+ typedef storage7<A1, A2, A3, A4, A5, A6, A7> inherited;
+
+ storage8( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, ndnboost::arg<I> (*) () ): storage7<A1, A2, A3, A4, A5, A6, A7>( a1, a2, a3, a4, a5, a6, a7 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a8_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+// 9
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9> struct storage9: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+ typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
+
+ storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, A9 a9 ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ), a9_( a9 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ BOOST_BIND_VISIT_EACH(v, a9_, 0);
+ }
+
+ A9 a9_;
+};
+
+#if !defined( BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION )
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, ndnboost::arg<I> >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+ typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
+
+ storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, ndnboost::arg<I> ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a9_() { return ndnboost::arg<I>(); }
+};
+
+template<class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, int I> struct storage9< A1, A2, A3, A4, A5, A6, A7, A8, ndnboost::arg<I> (*) () >: public storage8< A1, A2, A3, A4, A5, A6, A7, A8 >
+{
+ typedef storage8<A1, A2, A3, A4, A5, A6, A7, A8> inherited;
+
+ storage9( A1 a1, A2 a2, A3 a3, A4 a4, A5 a5, A6 a6, A7 a7, A8 a8, ndnboost::arg<I> (*) () ): storage8<A1, A2, A3, A4, A5, A6, A7, A8>( a1, a2, a3, a4, a5, a6, a7, a8 ) {}
+
+ template<class V> void accept(V & v) const
+ {
+ inherited::accept(v);
+ }
+
+ static ndnboost::arg<I> a9_() { return ndnboost::arg<I>(); }
+};
+
+#endif
+
+} // namespace _bi
+
+} // namespace ndnboost
+
+#ifdef BOOST_MSVC
+# pragma warning(default: 4512) // assignment operator could not be generated
+# pragma warning(pop)
+#endif
+
+#endif // #ifndef BOOST_BIND_STORAGE_HPP_INCLUDED
diff --git a/ndnboost/concept/assert.hpp b/ndnboost/concept/assert.hpp
new file mode 100644
index 0000000..148c5ad
--- /dev/null
+++ b/ndnboost/concept/assert.hpp
@@ -0,0 +1,46 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_ASSERT_DWA2006430_HPP
+# define BOOST_CONCEPT_ASSERT_DWA2006430_HPP
+
+# include <ndnboost/config.hpp>
+# include <ndnboost/detail/workaround.hpp>
+
+// The old protocol used a constraints() member function in concept
+// checking classes. If the compiler supports SFINAE, we can detect
+// that function and seamlessly support the old concept checking
+// classes. In this release, backward compatibility with the old
+// concept checking classes is enabled by default, where available.
+// The old protocol is deprecated, though, and backward compatibility
+// will no longer be the default in the next release.
+
+# if !defined(BOOST_NO_OLD_CONCEPT_SUPPORT) \
+ && !defined(BOOST_NO_SFINAE) \
+ \
+ && !(BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4)) \
+ && !(BOOST_WORKAROUND(__GNUC__, == 2))
+
+// Note: gcc-2.96 through 3.3.x have some SFINAE, but no ability to
+// check for the presence of particularmember functions.
+
+# define BOOST_OLD_CONCEPT_SUPPORT
+
+# endif
+
+# ifdef BOOST_MSVC
+# include <ndnboost/concept/detail/msvc.hpp>
+# elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+# include <ndnboost/concept/detail/borland.hpp>
+# else
+# include <ndnboost/concept/detail/general.hpp>
+# endif
+
+ // Usage, in class or function context:
+ //
+ // BOOST_CONCEPT_ASSERT((UnaryFunctionConcept<F,bool,int>));
+ //
+# define BOOST_CONCEPT_ASSERT(ModelInParens) \
+ BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
+
+#endif // BOOST_CONCEPT_ASSERT_DWA2006430_HPP
diff --git a/ndnboost/concept/detail/backward_compatibility.hpp b/ndnboost/concept/detail/backward_compatibility.hpp
new file mode 100644
index 0000000..f284564
--- /dev/null
+++ b/ndnboost/concept/detail/backward_compatibility.hpp
@@ -0,0 +1,16 @@
+// Copyright David Abrahams 2009. 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)
+#ifndef BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
+# define BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
+
+namespace ndnboost
+{
+ namespace concepts {}
+
+# if defined(BOOST_HAS_CONCEPTS) && !defined(BOOST_CONCEPT_NO_BACKWARD_KEYWORD)
+ namespace concept = concepts;
+# endif
+} // namespace ndnboost::concept
+
+#endif // BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
diff --git a/ndnboost/concept/detail/borland.hpp b/ndnboost/concept/detail/borland.hpp
new file mode 100644
index 0000000..ade28ca
--- /dev/null
+++ b/ndnboost/concept/detail/borland.hpp
@@ -0,0 +1,30 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP
+# define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP
+
+# include <ndnboost/preprocessor/cat.hpp>
+# include <ndnboost/concept/detail/backward_compatibility.hpp>
+
+namespace ndnboost { namespace concepts {
+
+template <class ModelFnPtr>
+struct require;
+
+template <class Model>
+struct require<void(*)(Model)>
+{
+ enum { instantiate = sizeof((((Model*)0)->~Model()), 3) };
+};
+
+# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
+ enum \
+ { \
+ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
+ ndnboost::concepts::require<ModelFnPtr>::instantiate \
+ }
+
+}} // namespace ndnboost::concept
+
+#endif // BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP
diff --git a/ndnboost/concept/detail/concept_def.hpp b/ndnboost/concept/detail/concept_def.hpp
new file mode 100644
index 0000000..59da034
--- /dev/null
+++ b/ndnboost/concept/detail/concept_def.hpp
@@ -0,0 +1,51 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_DETAIL_CONCEPT_DEF_DWA200651_HPP
+# define BOOST_CONCEPT_DETAIL_CONCEPT_DEF_DWA200651_HPP
+# include <ndnboost/preprocessor/seq/for_each_i.hpp>
+# include <ndnboost/preprocessor/seq/enum.hpp>
+# include <ndnboost/preprocessor/comma_if.hpp>
+# include <ndnboost/preprocessor/cat.hpp>
+#endif // BOOST_CONCEPT_DETAIL_CONCEPT_DEF_DWA200651_HPP
+
+// BOOST_concept(SomeName, (p1)(p2)...(pN))
+//
+// Expands to "template <class p1, class p2, ...class pN> struct SomeName"
+//
+// Also defines an equivalent SomeNameConcept for backward compatibility.
+// Maybe in the next release we can kill off the "Concept" suffix for good.
+#if BOOST_WORKAROUND(__GNUC__, <= 3)
+# define BOOST_concept(name, params) \
+ template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
+ struct name; /* forward declaration */ \
+ \
+ template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
+ struct BOOST_PP_CAT(name,Concept) \
+ : name< BOOST_PP_SEQ_ENUM(params) > \
+ { \
+ /* at least 2.96 and 3.4.3 both need this */ \
+ BOOST_PP_CAT(name,Concept)(); \
+ }; \
+ \
+ template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
+ struct name
+#else
+# define BOOST_concept(name, params) \
+ template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
+ struct name; /* forward declaration */ \
+ \
+ template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
+ struct BOOST_PP_CAT(name,Concept) \
+ : name< BOOST_PP_SEQ_ENUM(params) > \
+ { \
+ }; \
+ \
+ template < BOOST_PP_SEQ_FOR_EACH_I(BOOST_CONCEPT_typename,~,params) > \
+ struct name
+#endif
+
+// Helper for BOOST_concept, above.
+# define BOOST_CONCEPT_typename(r, ignored, index, t) \
+ BOOST_PP_COMMA_IF(index) typename t
+
diff --git a/ndnboost/concept/detail/concept_undef.hpp b/ndnboost/concept/detail/concept_undef.hpp
new file mode 100644
index 0000000..713db89
--- /dev/null
+++ b/ndnboost/concept/detail/concept_undef.hpp
@@ -0,0 +1,5 @@
+// Copyright David Abrahams 2006. 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)
+# undef BOOST_concept_typename
+# undef BOOST_concept
diff --git a/ndnboost/concept/detail/general.hpp b/ndnboost/concept/detail/general.hpp
new file mode 100644
index 0000000..defbf03
--- /dev/null
+++ b/ndnboost/concept/detail/general.hpp
@@ -0,0 +1,75 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
+# define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
+
+# include <ndnboost/preprocessor/cat.hpp>
+# include <ndnboost/concept/detail/backward_compatibility.hpp>
+
+# ifdef BOOST_OLD_CONCEPT_SUPPORT
+# include <ndnboost/concept/detail/has_constraints.hpp>
+# include <ndnboost/mpl/if.hpp>
+# endif
+
+// This implementation works on Comeau and GCC, all the way back to
+// 2.95
+namespace ndnboost { namespace concepts {
+
+template <class ModelFn>
+struct requirement_;
+
+namespace detail
+{
+ template <void(*)()> struct instantiate {};
+}
+
+template <class Model>
+struct requirement
+{
+ static void failed() { ((Model*)0)->~Model(); }
+};
+
+struct failed {};
+
+template <class Model>
+struct requirement<failed ************ Model::************>
+{
+ static void failed() { ((Model*)0)->~Model(); }
+};
+
+# ifdef BOOST_OLD_CONCEPT_SUPPORT
+
+template <class Model>
+struct constraint
+{
+ static void failed() { ((Model*)0)->constraints(); }
+};
+
+template <class Model>
+struct requirement_<void(*)(Model)>
+ : mpl::if_<
+ concepts::not_satisfied<Model>
+ , constraint<Model>
+ , requirement<failed ************ Model::************>
+ >::type
+{};
+
+# else
+
+// For GCC-2.x, these can't have exactly the same name
+template <class Model>
+struct requirement_<void(*)(Model)>
+ : requirement<failed ************ Model::************>
+{};
+
+# endif
+
+# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
+ typedef ::ndnboost::concepts::detail::instantiate< \
+ &::ndnboost::concepts::requirement_<ModelFnPtr>::failed> \
+ BOOST_PP_CAT(boost_concept_check,__LINE__)
+
+}}
+
+#endif // BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
diff --git a/ndnboost/concept/detail/has_constraints.hpp b/ndnboost/concept/detail/has_constraints.hpp
new file mode 100644
index 0000000..d70515e
--- /dev/null
+++ b/ndnboost/concept/detail/has_constraints.hpp
@@ -0,0 +1,50 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
+# define BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
+
+# include <ndnboost/mpl/bool.hpp>
+# include <ndnboost/detail/workaround.hpp>
+# include <ndnboost/concept/detail/backward_compatibility.hpp>
+
+namespace ndnboost { namespace concepts {
+
+namespace detail
+{
+
+// Here we implement the metafunction that detects whether a
+// constraints metafunction exists
+ typedef char yes;
+ typedef char (&no)[2];
+
+ template <class Model, void (Model::*)()>
+ struct wrap_constraints {};
+
+#if BOOST_WORKAROUND(__SUNPRO_CC, <= 0x580) || defined(__CUDACC__)
+ // Work around the following bogus error in Sun Studio 11, by
+ // turning off the has_constraints function entirely:
+ // Error: complex expression not allowed in dependent template
+ // argument expression
+ inline no has_constraints_(...);
+#else
+ template <class Model>
+ inline yes has_constraints_(Model*, wrap_constraints<Model,&Model::constraints>* = 0);
+ inline no has_constraints_(...);
+#endif
+}
+
+// This would be called "detail::has_constraints," but it has a strong
+// tendency to show up in error messages.
+template <class Model>
+struct not_satisfied
+{
+ BOOST_STATIC_CONSTANT(
+ bool
+ , value = sizeof( detail::has_constraints_((Model*)0) ) == sizeof(detail::yes) );
+ typedef mpl::bool_<value> type;
+};
+
+}} // namespace ndnboost::concepts::detail
+
+#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
diff --git a/ndnboost/concept/detail/msvc.hpp b/ndnboost/concept/detail/msvc.hpp
new file mode 100644
index 0000000..c11e949
--- /dev/null
+++ b/ndnboost/concept/detail/msvc.hpp
@@ -0,0 +1,114 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
+# define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
+
+# include <ndnboost/preprocessor/cat.hpp>
+# include <ndnboost/concept/detail/backward_compatibility.hpp>
+
+# ifdef BOOST_OLD_CONCEPT_SUPPORT
+# include <ndnboost/concept/detail/has_constraints.hpp>
+# include <ndnboost/mpl/if.hpp>
+# endif
+
+
+namespace ndnboost { namespace concepts {
+
+
+template <class Model>
+struct check
+{
+ virtual void failed(Model* x)
+ {
+ x->~Model();
+ }
+};
+
+# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
+struct failed {};
+template <class Model>
+struct check<failed ************ Model::************>
+{
+ virtual void failed(Model* x)
+ {
+ x->~Model();
+ }
+};
+# endif
+
+# ifdef BOOST_OLD_CONCEPT_SUPPORT
+
+namespace detail
+{
+ // No need for a virtual function here, since evaluating
+ // not_satisfied below will have already instantiated the
+ // constraints() member.
+ struct constraint {};
+}
+
+template <class Model>
+struct require
+ : mpl::if_c<
+ not_satisfied<Model>::value
+ , detail::constraint
+# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
+ , check<Model>
+# else
+ , check<failed ************ Model::************>
+# endif
+ >::type
+{};
+
+# else
+
+template <class Model>
+struct require
+# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
+ : check<Model>
+# else
+ : check<failed ************ Model::************>
+# endif
+{};
+
+# endif
+
+# if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+
+//
+// The iterator library sees some really strange errors unless we
+// do things this way.
+//
+template <class Model>
+struct require<void(*)(Model)>
+{
+ virtual void failed(Model*)
+ {
+ require<Model>();
+ }
+};
+
+# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
+enum \
+{ \
+ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
+ sizeof(::ndnboost::concepts::require<ModelFnPtr>) \
+}
+
+# else // Not vc-7.1
+
+template <class Model>
+require<Model>
+require_(void(*)(Model));
+
+# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
+enum \
+{ \
+ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
+ sizeof(::ndnboost::concepts::require_((ModelFnPtr)0)) \
+}
+
+# endif
+}}
+
+#endif // BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
diff --git a/ndnboost/concept/usage.hpp b/ndnboost/concept/usage.hpp
new file mode 100644
index 0000000..085cdd9
--- /dev/null
+++ b/ndnboost/concept/usage.hpp
@@ -0,0 +1,44 @@
+// Copyright David Abrahams 2006. 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)
+#ifndef BOOST_CONCEPT_USAGE_DWA2006919_HPP
+# define BOOST_CONCEPT_USAGE_DWA2006919_HPP
+
+# include <ndnboost/concept/assert.hpp>
+# include <ndnboost/detail/workaround.hpp>
+# include <ndnboost/concept/detail/backward_compatibility.hpp>
+
+namespace ndnboost { namespace concepts {
+
+# if BOOST_WORKAROUND(__GNUC__, == 2)
+
+# define BOOST_CONCEPT_USAGE(model) ~model()
+
+# else
+
+template <class Model>
+struct usage_requirements
+{
+ ~usage_requirements() { ((Model*)0)->~Model(); }
+};
+
+# if BOOST_WORKAROUND(__GNUC__, <= 3)
+
+# define BOOST_CONCEPT_USAGE(model) \
+ model(); /* at least 2.96 and 3.4.3 both need this :( */ \
+ BOOST_CONCEPT_ASSERT((ndnboost::concepts::usage_requirements<model>)); \
+ ~model()
+
+# else
+
+# define BOOST_CONCEPT_USAGE(model) \
+ BOOST_CONCEPT_ASSERT((ndnboost::concepts::usage_requirements<model>)); \
+ ~model()
+
+# endif
+
+# endif
+
+}} // namespace ndnboost::concepts
+
+#endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP
diff --git a/ndnboost/concept_check.hpp b/ndnboost/concept_check.hpp
new file mode 100644
index 0000000..0b7bf54
--- /dev/null
+++ b/ndnboost/concept_check.hpp
@@ -0,0 +1,1083 @@
+//
+// (C) Copyright Jeremy Siek 2000.
+// Copyright 2002 The Trustees of Indiana University.
+//
+// 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)
+//
+// Revision History:
+// 05 May 2001: Workarounds for HP aCC from Thomas Matelich. (Jeremy Siek)
+// 02 April 2001: Removed limits header altogether. (Jeremy Siek)
+// 01 April 2001: Modified to use new <ndnboost/limits.hpp> header. (JMaddock)
+//
+
+// See http://www.boost.org/libs/concept_check for documentation.
+
+#ifndef BOOST_CONCEPT_CHECKS_HPP
+# define BOOST_CONCEPT_CHECKS_HPP
+
+# include <ndnboost/concept/assert.hpp>
+
+# include <ndnboost/iterator.hpp>
+# include <ndnboost/type_traits/conversion_traits.hpp>
+# include <utility>
+# include <ndnboost/type_traits/is_same.hpp>
+# include <ndnboost/type_traits/is_void.hpp>
+# include <ndnboost/mpl/assert.hpp>
+# include <ndnboost/mpl/bool.hpp>
+# include <ndnboost/detail/workaround.hpp>
+# include <ndnboost/detail/iterator.hpp>
+
+# include <ndnboost/concept/usage.hpp>
+# include <ndnboost/concept/detail/concept_def.hpp>
+
+namespace ndnboost
+{
+
+ //
+ // Backward compatibility
+ //
+
+ template <class Model>
+ inline void function_requires(Model* = 0)
+ {
+ BOOST_CONCEPT_ASSERT((Model));
+ }
+ template <class T> inline void ignore_unused_variable_warning(T const&) {}
+
+# define BOOST_CLASS_REQUIRE(type_var, ns, concept) \
+ BOOST_CONCEPT_ASSERT((ns::concept<type_var>))
+
+# define BOOST_CLASS_REQUIRE2(type_var1, type_var2, ns, concept) \
+ BOOST_CONCEPT_ASSERT((ns::concept<type_var1,type_var2>))
+
+# define BOOST_CLASS_REQUIRE3(tv1, tv2, tv3, ns, concept) \
+ BOOST_CONCEPT_ASSERT((ns::concept<tv1,tv2,tv3>))
+
+# define BOOST_CLASS_REQUIRE4(tv1, tv2, tv3, tv4, ns, concept) \
+ BOOST_CONCEPT_ASSERT((ns::concept<tv1,tv2,tv3,tv4>))
+
+
+ //
+ // Begin concept definitions
+ //
+ BOOST_concept(Integer, (T))
+ {
+ BOOST_CONCEPT_USAGE(Integer)
+ {
+ x.error_type_must_be_an_integer_type();
+ }
+ private:
+ T x;
+ };
+
+ template <> struct Integer<char> {};
+ template <> struct Integer<signed char> {};
+ template <> struct Integer<unsigned char> {};
+ template <> struct Integer<short> {};
+ template <> struct Integer<unsigned short> {};
+ template <> struct Integer<int> {};
+ template <> struct Integer<unsigned int> {};
+ template <> struct Integer<long> {};
+ template <> struct Integer<unsigned long> {};
+# if defined(BOOST_HAS_LONG_LONG)
+ template <> struct Integer< ::ndnboost::long_long_type> {};
+ template <> struct Integer< ::ndnboost::ulong_long_type> {};
+# elif defined(BOOST_HAS_MS_INT64)
+ template <> struct Integer<__int64> {};
+ template <> struct Integer<unsigned __int64> {};
+# endif
+
+ BOOST_concept(SignedInteger,(T)) {
+ BOOST_CONCEPT_USAGE(SignedInteger) {
+ x.error_type_must_be_a_signed_integer_type();
+ }
+ private:
+ T x;
+ };
+ template <> struct SignedInteger<signed char> { };
+ template <> struct SignedInteger<short> {};
+ template <> struct SignedInteger<int> {};
+ template <> struct SignedInteger<long> {};
+# if defined(BOOST_HAS_LONG_LONG)
+ template <> struct SignedInteger< ::ndnboost::long_long_type> {};
+# elif defined(BOOST_HAS_MS_INT64)
+ template <> struct SignedInteger<__int64> {};
+# endif
+
+ BOOST_concept(UnsignedInteger,(T)) {
+ BOOST_CONCEPT_USAGE(UnsignedInteger) {
+ x.error_type_must_be_an_unsigned_integer_type();
+ }
+ private:
+ T x;
+ };
+
+ template <> struct UnsignedInteger<unsigned char> {};
+ template <> struct UnsignedInteger<unsigned short> {};
+ template <> struct UnsignedInteger<unsigned int> {};
+ template <> struct UnsignedInteger<unsigned long> {};
+# if defined(BOOST_HAS_LONG_LONG)
+ template <> struct UnsignedInteger< ::ndnboost::ulong_long_type> {};
+# elif defined(BOOST_HAS_MS_INT64)
+ template <> struct UnsignedInteger<unsigned __int64> {};
+# endif
+
+ //===========================================================================
+ // Basic Concepts
+
+ BOOST_concept(DefaultConstructible,(TT))
+ {
+ BOOST_CONCEPT_USAGE(DefaultConstructible) {
+ TT a; // require default constructor
+ ignore_unused_variable_warning(a);
+ }
+ };
+
+ BOOST_concept(Assignable,(TT))
+ {
+ BOOST_CONCEPT_USAGE(Assignable) {
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = b; // require assignment operator
+#endif
+ const_constraints(b);
+ }
+ private:
+ void const_constraints(const TT& x) {
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = x; // const required for argument to assignment
+#else
+ ignore_unused_variable_warning(x);
+#endif
+ }
+ private:
+ TT a;
+ TT b;
+ };
+
+
+ BOOST_concept(CopyConstructible,(TT))
+ {
+ BOOST_CONCEPT_USAGE(CopyConstructible) {
+ TT a(b); // require copy constructor
+ TT* ptr = &a; // require address of operator
+ const_constraints(a);
+ ignore_unused_variable_warning(ptr);
+ }
+ private:
+ void const_constraints(const TT& a) {
+ TT c(a); // require const copy constructor
+ const TT* ptr = &a; // require const address of operator
+ ignore_unused_variable_warning(c);
+ ignore_unused_variable_warning(ptr);
+ }
+ TT b;
+ };
+
+#if (defined _MSC_VER)
+# pragma warning( push )
+# pragma warning( disable : 4510 ) // default constructor could not be generated
+# pragma warning( disable : 4610 ) // object 'class' can never be instantiated - user-defined constructor required
+#endif
+ // The SGI STL version of Assignable requires copy constructor and operator=
+ BOOST_concept(SGIAssignable,(TT))
+ {
+ BOOST_CONCEPT_USAGE(SGIAssignable) {
+ TT c(a);
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = b; // require assignment operator
+#endif
+ const_constraints(b);
+ ignore_unused_variable_warning(c);
+ }
+ private:
+ void const_constraints(const TT& x) {
+ TT c(x);
+#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
+ a = x; // const required for argument to assignment
+#endif
+ ignore_unused_variable_warning(c);
+ }
+ TT a;
+ TT b;
+ };
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#endif
+
+ BOOST_concept(Convertible,(X)(Y))
+ {
+ BOOST_CONCEPT_USAGE(Convertible) {
+ Y y = x;
+ ignore_unused_variable_warning(y);
+ }
+ private:
+ X x;
+ };
+
+ // The C++ standard requirements for many concepts talk about return
+ // types that must be "convertible to bool". The problem with this
+ // requirement is that it leaves the door open for evil proxies that
+ // define things like operator|| with strange return types. Two
+ // possible solutions are:
+ // 1) require the return type to be exactly bool
+ // 2) stay with convertible to bool, and also
+ // specify stuff about all the logical operators.
+ // For now we just test for convertible to bool.
+ template <class TT>
+ void require_boolean_expr(const TT& t) {
+ bool x = t;
+ ignore_unused_variable_warning(x);
+ }
+
+ BOOST_concept(EqualityComparable,(TT))
+ {
+ BOOST_CONCEPT_USAGE(EqualityComparable) {
+ require_boolean_expr(a == b);
+ require_boolean_expr(a != b);
+ }
+ private:
+ TT a, b;
+ };
+
+ BOOST_concept(LessThanComparable,(TT))
+ {
+ BOOST_CONCEPT_USAGE(LessThanComparable) {
+ require_boolean_expr(a < b);
+ }
+ private:
+ TT a, b;
+ };
+
+ // This is equivalent to SGI STL's LessThanComparable.
+ BOOST_concept(Comparable,(TT))
+ {
+ BOOST_CONCEPT_USAGE(Comparable) {
+ require_boolean_expr(a < b);
+ require_boolean_expr(a > b);
+ require_boolean_expr(a <= b);
+ require_boolean_expr(a >= b);
+ }
+ private:
+ TT a, b;
+ };
+
+#define BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(OP,NAME) \
+ BOOST_concept(NAME, (First)(Second)) \
+ { \
+ BOOST_CONCEPT_USAGE(NAME) { (void)constraints_(); } \
+ private: \
+ bool constraints_() { return a OP b; } \
+ First a; \
+ Second b; \
+ }
+
+#define BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(OP,NAME) \
+ BOOST_concept(NAME, (Ret)(First)(Second)) \
+ { \
+ BOOST_CONCEPT_USAGE(NAME) { (void)constraints_(); } \
+ private: \
+ Ret constraints_() { return a OP b; } \
+ First a; \
+ Second b; \
+ }
+
+ BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(==, EqualOp);
+ BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(!=, NotEqualOp);
+ BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<, LessThanOp);
+ BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(<=, LessEqualOp);
+ BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>, GreaterThanOp);
+ BOOST_DEFINE_BINARY_PREDICATE_OP_CONSTRAINT(>=, GreaterEqualOp);
+
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(+, PlusOp);
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(*, TimesOp);
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(/, DivideOp);
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(-, SubtractOp);
+ BOOST_DEFINE_BINARY_OPERATOR_CONSTRAINT(%, ModOp);
+
+ //===========================================================================
+ // Function Object Concepts
+
+ BOOST_concept(Generator,(Func)(Return))
+ {
+ BOOST_CONCEPT_USAGE(Generator) { test(is_void<Return>()); }
+
+ private:
+ void test(ndnboost::mpl::false_)
+ {
+ // Do we really want a reference here?
+ const Return& r = f();
+ ignore_unused_variable_warning(r);
+ }
+
+ void test(ndnboost::mpl::true_)
+ {
+ f();
+ }
+
+ Func f;
+ };
+
+ BOOST_concept(UnaryFunction,(Func)(Return)(Arg))
+ {
+ BOOST_CONCEPT_USAGE(UnaryFunction) { test(is_void<Return>()); }
+
+ private:
+ void test(ndnboost::mpl::false_)
+ {
+ f(arg); // "priming the pump" this way keeps msvc6 happy (ICE)
+ Return r = f(arg);
+ ignore_unused_variable_warning(r);
+ }
+
+ void test(ndnboost::mpl::true_)
+ {
+ f(arg);
+ }
+
+#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
+ && BOOST_WORKAROUND(__GNUC__, > 3)))
+ // Declare a dummy construktor to make gcc happy.
+ // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
+ // (warning: non-static reference "const double& ndnboost::UnaryFunction<YourClassHere>::arg"
+ // in class without a constructor [-Wuninitialized])
+ UnaryFunction();
+#endif
+
+ Func f;
+ Arg arg;
+ };
+
+ BOOST_concept(BinaryFunction,(Func)(Return)(First)(Second))
+ {
+ BOOST_CONCEPT_USAGE(BinaryFunction) { test(is_void<Return>()); }
+ private:
+ void test(ndnboost::mpl::false_)
+ {
+ f(first,second);
+ Return r = f(first, second); // require operator()
+ (void)r;
+ }
+
+ void test(ndnboost::mpl::true_)
+ {
+ f(first,second);
+ }
+
+#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
+ && BOOST_WORKAROUND(__GNUC__, > 3)))
+ // Declare a dummy constructor to make gcc happy.
+ // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
+ // (warning: non-static reference "const double& ndnboost::BinaryFunction<YourClassHere>::arg"
+ // in class without a constructor [-Wuninitialized])
+ BinaryFunction();
+#endif
+
+ Func f;
+ First first;
+ Second second;
+ };
+
+ BOOST_concept(UnaryPredicate,(Func)(Arg))
+ {
+ BOOST_CONCEPT_USAGE(UnaryPredicate) {
+ require_boolean_expr(f(arg)); // require operator() returning bool
+ }
+ private:
+#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
+ && BOOST_WORKAROUND(__GNUC__, > 3)))
+ // Declare a dummy constructor to make gcc happy.
+ // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
+ // (warning: non-static reference "const double& ndnboost::UnaryPredicate<YourClassHere>::arg"
+ // in class without a constructor [-Wuninitialized])
+ UnaryPredicate();
+#endif
+
+ Func f;
+ Arg arg;
+ };
+
+ BOOST_concept(BinaryPredicate,(Func)(First)(Second))
+ {
+ BOOST_CONCEPT_USAGE(BinaryPredicate) {
+ require_boolean_expr(f(a, b)); // require operator() returning bool
+ }
+ private:
+#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
+ && BOOST_WORKAROUND(__GNUC__, > 3)))
+ // Declare a dummy constructor to make gcc happy.
+ // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
+ // (warning: non-static reference "const double& ndnboost::BinaryPredicate<YourClassHere>::arg"
+ // in class without a constructor [-Wuninitialized])
+ BinaryPredicate();
+#endif
+ Func f;
+ First a;
+ Second b;
+ };
+
+ // use this when functor is used inside a container class like std::set
+ BOOST_concept(Const_BinaryPredicate,(Func)(First)(Second))
+ : BinaryPredicate<Func, First, Second>
+ {
+ BOOST_CONCEPT_USAGE(Const_BinaryPredicate) {
+ const_constraints(f);
+ }
+ private:
+ void const_constraints(const Func& fun) {
+ // operator() must be a const member function
+ require_boolean_expr(fun(a, b));
+ }
+#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
+ && BOOST_WORKAROUND(__GNUC__, > 3)))
+ // Declare a dummy constructor to make gcc happy.
+ // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type.
+ // (warning: non-static reference "const double& ndnboost::Const_BinaryPredicate<YourClassHere>::arg"
+ // in class without a constructor [-Wuninitialized])
+ Const_BinaryPredicate();
+#endif
+
+ Func f;
+ First a;
+ Second b;
+ };
+
+ BOOST_concept(AdaptableGenerator,(Func)(Return))
+ : Generator<Func, typename Func::result_type>
+ {
+ typedef typename Func::result_type result_type;
+
+ BOOST_CONCEPT_USAGE(AdaptableGenerator)
+ {
+ BOOST_CONCEPT_ASSERT((Convertible<result_type, Return>));
+ }
+ };
+
+ BOOST_concept(AdaptableUnaryFunction,(Func)(Return)(Arg))
+ : UnaryFunction<Func, typename Func::result_type, typename Func::argument_type>
+ {
+ typedef typename Func::argument_type argument_type;
+ typedef typename Func::result_type result_type;
+
+ ~AdaptableUnaryFunction()
+ {
+ BOOST_CONCEPT_ASSERT((Convertible<result_type, Return>));
+ BOOST_CONCEPT_ASSERT((Convertible<Arg, argument_type>));
+ }
+ };
+
+ BOOST_concept(AdaptableBinaryFunction,(Func)(Return)(First)(Second))
+ : BinaryFunction<
+ Func
+ , typename Func::result_type
+ , typename Func::first_argument_type
+ , typename Func::second_argument_type
+ >
+ {
+ typedef typename Func::first_argument_type first_argument_type;
+ typedef typename Func::second_argument_type second_argument_type;
+ typedef typename Func::result_type result_type;
+
+ ~AdaptableBinaryFunction()
+ {
+ BOOST_CONCEPT_ASSERT((Convertible<result_type, Return>));
+ BOOST_CONCEPT_ASSERT((Convertible<First, first_argument_type>));
+ BOOST_CONCEPT_ASSERT((Convertible<Second, second_argument_type>));
+ }
+ };
+
+ BOOST_concept(AdaptablePredicate,(Func)(Arg))
+ : UnaryPredicate<Func, Arg>
+ , AdaptableUnaryFunction<Func, bool, Arg>
+ {
+ };
+
+ BOOST_concept(AdaptableBinaryPredicate,(Func)(First)(Second))
+ : BinaryPredicate<Func, First, Second>
+ , AdaptableBinaryFunction<Func, bool, First, Second>
+ {
+ };
+
+ //===========================================================================
+ // Iterator Concepts
+
+ BOOST_concept(InputIterator,(TT))
+ : Assignable<TT>
+ , EqualityComparable<TT>
+ {
+ typedef typename ndnboost::detail::iterator_traits<TT>::value_type value_type;
+ typedef typename ndnboost::detail::iterator_traits<TT>::difference_type difference_type;
+ typedef typename ndnboost::detail::iterator_traits<TT>::reference reference;
+ typedef typename ndnboost::detail::iterator_traits<TT>::pointer pointer;
+ typedef typename ndnboost::detail::iterator_traits<TT>::iterator_category iterator_category;
+
+ BOOST_CONCEPT_USAGE(InputIterator)
+ {
+ BOOST_CONCEPT_ASSERT((SignedInteger<difference_type>));
+ BOOST_CONCEPT_ASSERT((Convertible<iterator_category, std::input_iterator_tag>));
+
+ TT j(i);
+ (void)*i; // require dereference operator
+ ++j; // require preincrement operator
+ i++; // require postincrement operator
+ }
+ private:
+ TT i;
+ };
+
+ BOOST_concept(OutputIterator,(TT)(ValueT))
+ : Assignable<TT>
+ {
+ BOOST_CONCEPT_USAGE(OutputIterator) {
+
+ ++i; // require preincrement operator
+ i++; // require postincrement operator
+ *i++ = t; // require postincrement and assignment
+ }
+ private:
+ TT i, j;
+ ValueT t;
+ };
+
+ BOOST_concept(ForwardIterator,(TT))
+ : InputIterator<TT>
+ {
+ BOOST_CONCEPT_USAGE(ForwardIterator)
+ {
+ BOOST_CONCEPT_ASSERT((Convertible<
+ BOOST_DEDUCED_TYPENAME ForwardIterator::iterator_category
+ , std::forward_iterator_tag
+ >));
+
+ typename InputIterator<TT>::reference r = *i;
+ ignore_unused_variable_warning(r);
+ }
+
+ private:
+ TT i;
+ };
+
+ BOOST_concept(Mutable_ForwardIterator,(TT))
+ : ForwardIterator<TT>
+ {
+ BOOST_CONCEPT_USAGE(Mutable_ForwardIterator) {
+ *i++ = *i; // require postincrement and assignment
+ }
+ private:
+ TT i;
+ };
+
+ BOOST_concept(BidirectionalIterator,(TT))
+ : ForwardIterator<TT>
+ {
+ BOOST_CONCEPT_USAGE(BidirectionalIterator)
+ {
+ BOOST_CONCEPT_ASSERT((Convertible<
+ BOOST_DEDUCED_TYPENAME BidirectionalIterator::iterator_category
+ , std::bidirectional_iterator_tag
+ >));
+
+ --i; // require predecrement operator
+ i--; // require postdecrement operator
+ }
+ private:
+ TT i;
+ };
+
+ BOOST_concept(Mutable_BidirectionalIterator,(TT))
+ : BidirectionalIterator<TT>
+ , Mutable_ForwardIterator<TT>
+ {
+ BOOST_CONCEPT_USAGE(Mutable_BidirectionalIterator)
+ {
+ *i-- = *i; // require postdecrement and assignment
+ }
+ private:
+ TT i;
+ };
+
+ BOOST_concept(RandomAccessIterator,(TT))
+ : BidirectionalIterator<TT>
+ , Comparable<TT>
+ {
+ BOOST_CONCEPT_USAGE(RandomAccessIterator)
+ {
+ BOOST_CONCEPT_ASSERT((Convertible<
+ BOOST_DEDUCED_TYPENAME BidirectionalIterator<TT>::iterator_category
+ , std::random_access_iterator_tag
+ >));
+
+ i += n; // require assignment addition operator
+ i = i + n; i = n + i; // require addition with difference type
+ i -= n; // require assignment subtraction operator
+ i = i - n; // require subtraction with difference type
+ n = i - j; // require difference operator
+ (void)i[n]; // require element access operator
+ }
+
+ private:
+ TT a, b;
+ TT i, j;
+ typename ndnboost::detail::iterator_traits<TT>::difference_type n;
+ };
+
+ BOOST_concept(Mutable_RandomAccessIterator,(TT))
+ : RandomAccessIterator<TT>
+ , Mutable_BidirectionalIterator<TT>
+ {
+ BOOST_CONCEPT_USAGE(Mutable_RandomAccessIterator)
+ {
+ i[n] = *i; // require element access and assignment
+ }
+ private:
+ TT i;
+ typename ndnboost::detail::iterator_traits<TT>::difference_type n;
+ };
+
+ //===========================================================================
+ // Container s
+
+ BOOST_concept(Container,(C))
+ : Assignable<C>
+ {
+ typedef typename C::value_type value_type;
+ typedef typename C::difference_type difference_type;
+ typedef typename C::size_type size_type;
+ typedef typename C::const_reference const_reference;
+ typedef typename C::const_pointer const_pointer;
+ typedef typename C::const_iterator const_iterator;
+
+ BOOST_CONCEPT_USAGE(Container)
+ {
+ BOOST_CONCEPT_ASSERT((InputIterator<const_iterator>));
+ const_constraints(c);
+ }
+
+ private:
+ void const_constraints(const C& cc) {
+ i = cc.begin();
+ i = cc.end();
+ n = cc.size();
+ n = cc.max_size();
+ b = cc.empty();
+ }
+ C c;
+ bool b;
+ const_iterator i;
+ size_type n;
+ };
+
+ BOOST_concept(Mutable_Container,(C))
+ : Container<C>
+ {
+ typedef typename C::reference reference;
+ typedef typename C::iterator iterator;
+ typedef typename C::pointer pointer;
+
+ BOOST_CONCEPT_USAGE(Mutable_Container)
+ {
+ BOOST_CONCEPT_ASSERT((
+ Assignable<typename Mutable_Container::value_type>));
+
+ BOOST_CONCEPT_ASSERT((InputIterator<iterator>));
+
+ i = c.begin();
+ i = c.end();
+ c.swap(c2);
+ }
+
+ private:
+ iterator i;
+ C c, c2;
+ };
+
+ BOOST_concept(ForwardContainer,(C))
+ : Container<C>
+ {
+ BOOST_CONCEPT_USAGE(ForwardContainer)
+ {
+ BOOST_CONCEPT_ASSERT((
+ ForwardIterator<
+ typename ForwardContainer::const_iterator
+ >));
+ }
+ };
+
+ BOOST_concept(Mutable_ForwardContainer,(C))
+ : ForwardContainer<C>
+ , Mutable_Container<C>
+ {
+ BOOST_CONCEPT_USAGE(Mutable_ForwardContainer)
+ {
+ BOOST_CONCEPT_ASSERT((
+ Mutable_ForwardIterator<
+ typename Mutable_ForwardContainer::iterator
+ >));
+ }
+ };
+
+ BOOST_concept(ReversibleContainer,(C))
+ : ForwardContainer<C>
+ {
+ typedef typename
+ C::const_reverse_iterator
+ const_reverse_iterator;
+
+ BOOST_CONCEPT_USAGE(ReversibleContainer)
+ {
+ BOOST_CONCEPT_ASSERT((
+ BidirectionalIterator<
+ typename ReversibleContainer::const_iterator>));
+
+ BOOST_CONCEPT_ASSERT((BidirectionalIterator<const_reverse_iterator>));
+
+ const_constraints(c);
+ }
+ private:
+ void const_constraints(const C& cc)
+ {
+ const_reverse_iterator i = cc.rbegin();
+ i = cc.rend();
+ }
+ C c;
+ };
+
+ BOOST_concept(Mutable_ReversibleContainer,(C))
+ : Mutable_ForwardContainer<C>
+ , ReversibleContainer<C>
+ {
+ typedef typename C::reverse_iterator reverse_iterator;
+
+ BOOST_CONCEPT_USAGE(Mutable_ReversibleContainer)
+ {
+ typedef typename Mutable_ForwardContainer<C>::iterator iterator;
+ BOOST_CONCEPT_ASSERT((Mutable_BidirectionalIterator<iterator>));
+ BOOST_CONCEPT_ASSERT((Mutable_BidirectionalIterator<reverse_iterator>));
+
+ reverse_iterator i = c.rbegin();
+ i = c.rend();
+ }
+ private:
+ C c;
+ };
+
+ BOOST_concept(RandomAccessContainer,(C))
+ : ReversibleContainer<C>
+ {
+ typedef typename C::size_type size_type;
+ typedef typename C::const_reference const_reference;
+
+ BOOST_CONCEPT_USAGE(RandomAccessContainer)
+ {
+ BOOST_CONCEPT_ASSERT((
+ RandomAccessIterator<
+ typename RandomAccessContainer::const_iterator
+ >));
+
+ const_constraints(c);
+ }
+ private:
+ void const_constraints(const C& cc)
+ {
+ const_reference r = cc[n];
+ ignore_unused_variable_warning(r);
+ }
+
+ C c;
+ size_type n;
+ };
+
+ BOOST_concept(Mutable_RandomAccessContainer,(C))
+ : Mutable_ReversibleContainer<C>
+ , RandomAccessContainer<C>
+ {
+ private:
+ typedef Mutable_RandomAccessContainer self;
+ public:
+ BOOST_CONCEPT_USAGE(Mutable_RandomAccessContainer)
+ {
+ BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator<typename self::iterator>));
+ BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator<typename self::reverse_iterator>));
+
+ typename self::reference r = c[i];
+ ignore_unused_variable_warning(r);
+ }
+
+ private:
+ typename Mutable_ReversibleContainer<C>::size_type i;
+ C c;
+ };
+
+ // A Sequence is inherently mutable
+ BOOST_concept(Sequence,(S))
+ : Mutable_ForwardContainer<S>
+ // Matt Austern's book puts DefaultConstructible here, the C++
+ // standard places it in Container --JGS
+ // ... so why aren't we following the standard? --DWA
+ , DefaultConstructible<S>
+ {
+ BOOST_CONCEPT_USAGE(Sequence)
+ {
+ S
+ c(n),
+ c2(n, t),
+ c3(first, last);
+
+ c.insert(p, t);
+ c.insert(p, n, t);
+ c.insert(p, first, last);
+
+ c.erase(p);
+ c.erase(p, q);
+
+ typename Sequence::reference r = c.front();
+
+ ignore_unused_variable_warning(c);
+ ignore_unused_variable_warning(c2);
+ ignore_unused_variable_warning(c3);
+ ignore_unused_variable_warning(r);
+ const_constraints(c);
+ }
+ private:
+ void const_constraints(const S& c) {
+ typename Sequence::const_reference r = c.front();
+ ignore_unused_variable_warning(r);
+ }
+
+ typename S::value_type t;
+ typename S::size_type n;
+ typename S::value_type* first, *last;
+ typename S::iterator p, q;
+ };
+
+ BOOST_concept(FrontInsertionSequence,(S))
+ : Sequence<S>
+ {
+ BOOST_CONCEPT_USAGE(FrontInsertionSequence)
+ {
+ c.push_front(t);
+ c.pop_front();
+ }
+ private:
+ S c;
+ typename S::value_type t;
+ };
+
+ BOOST_concept(BackInsertionSequence,(S))
+ : Sequence<S>
+ {
+ BOOST_CONCEPT_USAGE(BackInsertionSequence)
+ {
+ c.push_back(t);
+ c.pop_back();
+ typename BackInsertionSequence::reference r = c.back();
+ ignore_unused_variable_warning(r);
+ const_constraints(c);
+ }
+ private:
+ void const_constraints(const S& cc) {
+ typename BackInsertionSequence::const_reference
+ r = cc.back();
+ ignore_unused_variable_warning(r);
+ };
+ S c;
+ typename S::value_type t;
+ };
+
+ BOOST_concept(AssociativeContainer,(C))
+ : ForwardContainer<C>
+ , DefaultConstructible<C>
+ {
+ typedef typename C::key_type key_type;
+ typedef typename C::key_compare key_compare;
+ typedef typename C::value_compare value_compare;
+ typedef typename C::iterator iterator;
+
+ BOOST_CONCEPT_USAGE(AssociativeContainer)
+ {
+ i = c.find(k);
+ r = c.equal_range(k);
+ c.erase(k);
+ c.erase(i);
+ c.erase(r.first, r.second);
+ const_constraints(c);
+ BOOST_CONCEPT_ASSERT((BinaryPredicate<key_compare,key_type,key_type>));
+
+ typedef typename AssociativeContainer::value_type value_type_;
+ BOOST_CONCEPT_ASSERT((BinaryPredicate<value_compare,value_type_,value_type_>));
+ }
+
+ // Redundant with the base concept, but it helps below.
+ typedef typename C::const_iterator const_iterator;
+ private:
+ void const_constraints(const C& cc)
+ {
+ ci = cc.find(k);
+ n = cc.count(k);
+ cr = cc.equal_range(k);
+ }
+
+ C c;
+ iterator i;
+ std::pair<iterator,iterator> r;
+ const_iterator ci;
+ std::pair<const_iterator,const_iterator> cr;
+ typename C::key_type k;
+ typename C::size_type n;
+ };
+
+ BOOST_concept(UniqueAssociativeContainer,(C))
+ : AssociativeContainer<C>
+ {
+ BOOST_CONCEPT_USAGE(UniqueAssociativeContainer)
+ {
+ C c(first, last);
+
+ pos_flag = c.insert(t);
+ c.insert(first, last);
+
+ ignore_unused_variable_warning(c);
+ }
+ private:
+ std::pair<typename C::iterator, bool> pos_flag;
+ typename C::value_type t;
+ typename C::value_type* first, *last;
+ };
+
+ BOOST_concept(MultipleAssociativeContainer,(C))
+ : AssociativeContainer<C>
+ {
+ BOOST_CONCEPT_USAGE(MultipleAssociativeContainer)
+ {
+ C c(first, last);
+
+ pos = c.insert(t);
+ c.insert(first, last);
+
+ ignore_unused_variable_warning(c);
+ ignore_unused_variable_warning(pos);
+ }
+ private:
+ typename C::iterator pos;
+ typename C::value_type t;
+ typename C::value_type* first, *last;
+ };
+
+ BOOST_concept(SimpleAssociativeContainer,(C))
+ : AssociativeContainer<C>
+ {
+ BOOST_CONCEPT_USAGE(SimpleAssociativeContainer)
+ {
+ typedef typename C::key_type key_type;
+ typedef typename C::value_type value_type;
+ BOOST_MPL_ASSERT((ndnboost::is_same<key_type,value_type>));
+ }
+ };
+
+ BOOST_concept(PairAssociativeContainer,(C))
+ : AssociativeContainer<C>
+ {
+ BOOST_CONCEPT_USAGE(PairAssociativeContainer)
+ {
+ typedef typename C::key_type key_type;
+ typedef typename C::value_type value_type;
+ typedef typename C::mapped_type mapped_type;
+ typedef std::pair<const key_type, mapped_type> required_value_type;
+ BOOST_MPL_ASSERT((ndnboost::is_same<value_type,required_value_type>));
+ }
+ };
+
+ BOOST_concept(SortedAssociativeContainer,(C))
+ : AssociativeContainer<C>
+ , ReversibleContainer<C>
+ {
+ BOOST_CONCEPT_USAGE(SortedAssociativeContainer)
+ {
+ C
+ c(kc),
+ c2(first, last),
+ c3(first, last, kc);
+
+ p = c.upper_bound(k);
+ p = c.lower_bound(k);
+ r = c.equal_range(k);
+
+ c.insert(p, t);
+
+ ignore_unused_variable_warning(c);
+ ignore_unused_variable_warning(c2);
+ ignore_unused_variable_warning(c3);
+ const_constraints(c);
+ }
+
+ void const_constraints(const C& c)
+ {
+ kc = c.key_comp();
+ vc = c.value_comp();
+
+ cp = c.upper_bound(k);
+ cp = c.lower_bound(k);
+ cr = c.equal_range(k);
+ }
+
+ private:
+ typename C::key_compare kc;
+ typename C::value_compare vc;
+ typename C::value_type t;
+ typename C::key_type k;
+ typedef typename C::iterator iterator;
+ typedef typename C::const_iterator const_iterator;
+
+ typedef SortedAssociativeContainer self;
+ iterator p;
+ const_iterator cp;
+ std::pair<typename self::iterator,typename self::iterator> r;
+ std::pair<typename self::const_iterator,typename self::const_iterator> cr;
+ typename C::value_type* first, *last;
+ };
+
+ // HashedAssociativeContainer
+
+ BOOST_concept(Collection,(C))
+ {
+ BOOST_CONCEPT_USAGE(Collection)
+ {
+ ndnboost::function_requires<ndnboost::InputIteratorConcept<iterator> >();
+ ndnboost::function_requires<ndnboost::InputIteratorConcept<const_iterator> >();
+ ndnboost::function_requires<ndnboost::CopyConstructibleConcept<value_type> >();
+ const_constraints(c);
+ i = c.begin();
+ i = c.end();
+ c.swap(c);
+ }
+
+ void const_constraints(const C& cc) {
+ ci = cc.begin();
+ ci = cc.end();
+ n = cc.size();
+ b = cc.empty();
+ }
+
+ private:
+ typedef typename C::value_type value_type;
+ typedef typename C::iterator iterator;
+ typedef typename C::const_iterator const_iterator;
+ typedef typename C::reference reference;
+ typedef typename C::const_reference const_reference;
+ // typedef typename C::pointer pointer;
+ typedef typename C::difference_type difference_type;
+ typedef typename C::size_type size_type;
+
+ C c;
+ bool b;
+ iterator i;
+ const_iterator ci;
+ size_type n;
+ };
+} // namespace ndnboost
+
+# include <ndnboost/concept/detail/concept_undef.hpp>
+
+#endif // BOOST_CONCEPT_CHECKS_HPP
+
diff --git a/ndnboost/container/allocator_traits.hpp b/ndnboost/container/allocator_traits.hpp
deleted file mode 100644
index 31e0ceb..0000000
--- a/ndnboost/container/allocator_traits.hpp
+++ /dev/null
@@ -1,400 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Pablo Halpern 2009. 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)
-//
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2011-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINER_ALLOCATOR_ALLOCATOR_TRAITS_HPP
-#define BOOST_CONTAINER_ALLOCATOR_ALLOCATOR_TRAITS_HPP
-
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif
-
-#include <ndnboost/container/detail/config_begin.hpp>
-#include <ndnboost/container/detail/workaround.hpp>
-#include <ndnboost/intrusive/pointer_traits.hpp>
-#include <ndnboost/intrusive/detail/memory_util.hpp>
-#include <ndnboost/container/detail/memory_util.hpp>
-#include <ndnboost/type_traits/integral_constant.hpp>
-#include <ndnboost/container/detail/mpl.hpp>
-#include <ndnboost/move/utility.hpp>
-#include <limits> //numeric_limits<>::max()
-#include <new> //placement new
-#include <memory> //std::allocator
-
-#if defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
-#include <ndnboost/container/detail/preprocessor.hpp>
-#endif
-
-///@cond
-
-namespace ndnboost {
-namespace container {
-namespace container_detail {
-
-//workaround needed for C++03 compilers with no construct()
-//supporting rvalue references
-template<class A>
-struct is_std_allocator
-{ static const bool value = false; };
-
-template<class T>
-struct is_std_allocator< std::allocator<T> >
-{ static const bool value = true; };
-
-} //namespace container_detail {
-
-///@endcond
-
-//! The class template allocator_traits supplies a uniform interface to all allocator types.
-//! This class is a C++03-compatible implementation of std::allocator_traits
-template <typename Alloc>
-struct allocator_traits
-{
- //allocator_type
- typedef Alloc allocator_type;
- //value_type
- typedef typename Alloc::value_type value_type;
-
- #if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- //! Alloc::pointer if such a type exists; otherwise, value_type*
- //!
- typedef unspecified pointer;
- //! Alloc::const_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<const
- //!
- typedef see_documentation const_pointer;
- //! Non-standard extension
- //! Alloc::reference if such a type exists; otherwise, value_type&
- typedef see_documentation reference;
- //! Non-standard extension
- //! Alloc::const_reference if such a type exists ; otherwise, const value_type&
- typedef see_documentation const_reference;
- //! Alloc::void_pointer if such a type exists ; otherwise, pointer_traits<pointer>::rebind<void>.
- //!
- typedef see_documentation void_pointer;
- //! Alloc::const_void_pointer if such a type exists ; otherwis e, pointer_traits<pointer>::rebind<const
- //!
- typedef see_documentation const_void_pointer;
- //! Alloc::difference_type if such a type exists ; otherwise, pointer_traits<pointer>::difference_type.
- //!
- typedef see_documentation difference_type;
- //! Alloc::size_type if such a type exists ; otherwise, make_unsigned<difference_type>::type
- //!
- typedef see_documentation size_type;
- //! Alloc::propagate_on_container_copy_assignment if such a type exists, otherwise an integral_constant
- //! type with internal constant static member `value` == false.
- typedef see_documentation propagate_on_container_copy_assignment;
- //! Alloc::propagate_on_container_move_assignment if such a type exists, otherwise an integral_constant
- //! type with internal constant static member `value` == false.
- typedef see_documentation propagate_on_container_move_assignment;
- //! Alloc::propagate_on_container_swap if such a type exists, otherwise an integral_constant
- //! type with internal constant static member `value` == false.
- typedef see_documentation propagate_on_container_swap;
- //! Defines an allocator: Alloc::rebind<T>::other if such a type exists; otherwise, Alloc<T, Args>
- //! if Alloc is a class template instantiation of the form Alloc<U, Args>, where Args is zero or
- //! more type arguments ; otherwise, the instantiation of rebind_alloc is ill-formed.
- //!
- //! In C++03 compilers `rebind_alloc` is a struct derived from an allocator
- //! deduced by previously detailed rules.
- template <class T> using rebind_alloc = see_documentation;
-
- //! In C++03 compilers `rebind_traits` is a struct derived from
- //! `allocator_traits<OtherAlloc>`, where `OtherAlloc` is
- //! the allocator deduced by rules explained in `rebind_alloc`.
- template <class T> using rebind_traits = allocator_traits<rebind_alloc<T> >;
-
- //! Non-standard extension: Portable allocator rebind for C++03 and C++11 compilers.
- //! `type` is an allocator related to Alloc deduced deduced by rules explained in `rebind_alloc`.
- template <class T>
- struct portable_rebind_alloc
- { typedef see_documentation type; };
- #else
- //pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- pointer, value_type*)
- pointer;
- //const_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(ndnboost::container::container_detail::, Alloc,
- const_pointer, typename ndnboost::intrusive::pointer_traits<pointer>::template
- rebind_pointer<const value_type>)
- const_pointer;
- //reference
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- reference, typename container_detail::unvoid<value_type>::type&)
- reference;
- //const_reference
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- const_reference, const typename container_detail::unvoid<value_type>::type&)
- const_reference;
- //void_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(ndnboost::container::container_detail::, Alloc,
- void_pointer, typename ndnboost::intrusive::pointer_traits<pointer>::template
- rebind_pointer<void>)
- void_pointer;
- //const_void_pointer
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_EVAL_DEFAULT(ndnboost::container::container_detail::, Alloc,
- const_void_pointer, typename ndnboost::intrusive::pointer_traits<pointer>::template
- rebind_pointer<const void>)
- const_void_pointer;
- //difference_type
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- difference_type, std::ptrdiff_t)
- difference_type;
- //size_type
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- size_type, std::size_t)
- size_type;
- //propagate_on_container_copy_assignment
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- propagate_on_container_copy_assignment, ndnboost::false_type)
- propagate_on_container_copy_assignment;
- //propagate_on_container_move_assignment
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- propagate_on_container_move_assignment, ndnboost::false_type)
- propagate_on_container_move_assignment;
- //propagate_on_container_swap
- typedef BOOST_INTRUSIVE_OBTAIN_TYPE_WITH_DEFAULT(ndnboost::container::container_detail::, Alloc,
- propagate_on_container_swap, ndnboost::false_type)
- propagate_on_container_swap;
-
- #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
- //C++11
- template <typename T> using rebind_alloc = typename ndnboost::intrusive::detail::type_rebinder<Alloc, T>::type;
- template <typename T> using rebind_traits = allocator_traits< rebind_alloc<T> >;
- #else // #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
- //Some workaround for C++03 or C++11 compilers with no template aliases
- template <typename T>
- struct rebind_alloc : ndnboost::intrusive::detail::type_rebinder<Alloc,T>::type
- {
- typedef typename ndnboost::intrusive::detail::type_rebinder<Alloc,T>::type Base;
- #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- template <typename... Args>
- rebind_alloc(BOOST_FWD_REF(Args)... args)
- : Base(ndnboost::forward<Args>(args)...)
- {}
- #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- #define BOOST_PP_LOCAL_MACRO(n) \
- BOOST_PP_EXPR_IF(n, template<) BOOST_PP_ENUM_PARAMS(n, class P) BOOST_PP_EXPR_IF(n, >) \
- rebind_alloc(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- : Base(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)) \
- {} \
- //
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
- #endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- };
-
- template <typename T>
- struct rebind_traits
- : allocator_traits<typename ndnboost::intrusive::detail::type_rebinder<Alloc, T>::type>
- {};
- #endif // #if !defined(BOOST_NO_CXX11_TEMPLATE_ALIASES)
- template <class T>
- struct portable_rebind_alloc
- { typedef typename ndnboost::intrusive::detail::type_rebinder<Alloc, T>::type type; };
- #endif //BOOST_CONTAINER_DOXYGEN_INVOKED
-
- //! <b>Returns</b>: `a.allocate(n)`
- //!
- static pointer allocate(Alloc &a, size_type n)
- { return a.allocate(n); }
-
- //! <b>Returns</b>: `a.deallocate(p, n)`
- //!
- //! <b>Throws</b>: Nothing
- static void deallocate(Alloc &a, pointer p, size_type n)
- { a.deallocate(p, n); }
-
- //! <b>Effects</b>: calls `a.allocate(n, p)` if that call is well-formed;
- //! otherwise, invokes `a.allocate(n)`
- static pointer allocate(Alloc &a, size_type n, const_void_pointer p)
- {
- const bool value = ndnboost::container::container_detail::
- has_member_function_callable_with_allocate
- <Alloc, const size_type, const const_void_pointer>::value;
- ::ndnboost::integral_constant<bool, value> flag;
- return allocator_traits::priv_allocate(flag, a, n, p);
- }
-
- //! <b>Effects</b>: calls `a.destroy(p)` if that call is well-formed;
- //! otherwise, invokes `p->~T()`.
- template<class T>
- static void destroy(Alloc &a, T*p)
- {
- typedef T* destroy_pointer;
- const bool value = ndnboost::container::container_detail::
- has_member_function_callable_with_destroy
- <Alloc, const destroy_pointer>::value;
- ::ndnboost::integral_constant<bool, value> flag;
- allocator_traits::priv_destroy(flag, a, p);
- }
-
- //! <b>Returns</b>: `a.max_size()` if that expression is well-formed; otherwise,
- //! `numeric_limits<size_type>::max()`.
- static size_type max_size(const Alloc &a)
- {
- const bool value = ndnboost::container::container_detail::
- has_member_function_callable_with_max_size
- <const Alloc>::value;
- ::ndnboost::integral_constant<bool, value> flag;
- return allocator_traits::priv_max_size(flag, a);
- }
-
- //! <b>Returns</b>: `a.select_on_container_copy_construction()` if that expression is well-formed;
- //! otherwise, a.
- static
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- typename container_detail::if_c
- < ndnboost::container::container_detail::
- has_member_function_callable_with_select_on_container_copy_construction
- <const Alloc>::value
- , Alloc
- , const Alloc &
- >::type
- #else
- Alloc
- #endif
- select_on_container_copy_construction(const Alloc &a)
- {
- const bool value = ndnboost::container::container_detail::
- has_member_function_callable_with_select_on_container_copy_construction
- <const Alloc>::value;
- ::ndnboost::integral_constant<bool, value> flag;
- return allocator_traits::priv_select_on_container_copy_construction(flag, a);
- }
-
- #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) || defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- //! <b>Effects</b>: calls `a.construct(p, std::forward<Args>(args)...)` if that call is well-formed;
- //! otherwise, invokes `::new (static_cast<void*>(p)) T(std::forward<Args>(args)...)`
- template <class T, class ...Args>
- static void construct(Alloc & a, T* p, BOOST_FWD_REF(Args)... args)
- {
- ::ndnboost::integral_constant<bool, container_detail::is_std_allocator<Alloc>::value> flag;
- allocator_traits::priv_construct(flag, a, p, ::ndnboost::forward<Args>(args)...);
- }
- #endif
- ///@cond
- #if !defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
- private:
- static pointer priv_allocate(ndnboost::true_type, Alloc &a, size_type n, const_void_pointer p)
- { return a.allocate(n, p); }
-
- static pointer priv_allocate(ndnboost::false_type, Alloc &a, size_type n, const_void_pointer)
- { return allocator_traits::allocate(a, n); }
-
- template<class T>
- static void priv_destroy(ndnboost::true_type, Alloc &a, T* p)
- { a.destroy(p); }
-
- template<class T>
- static void priv_destroy(ndnboost::false_type, Alloc &, T* p)
- { p->~T(); (void)p; }
-
- static size_type priv_max_size(ndnboost::true_type, const Alloc &a)
- { return a.max_size(); }
-
- static size_type priv_max_size(ndnboost::false_type, const Alloc &)
- { return (std::numeric_limits<size_type>::max)(); }
-
- static Alloc priv_select_on_container_copy_construction(ndnboost::true_type, const Alloc &a)
- { return a.select_on_container_copy_construction(); }
-
- static const Alloc &priv_select_on_container_copy_construction(ndnboost::false_type, const Alloc &a)
- { return a; }
-
- #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- template<class T, class ...Args>
- static void priv_construct(ndnboost::false_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
- {
- const bool value = ndnboost::container::container_detail::
- has_member_function_callable_with_construct
- < Alloc, T*, Args... >::value;
- ::ndnboost::integral_constant<bool, value> flag;
- priv_construct_dispatch2(flag, a, p, ::ndnboost::forward<Args>(args)...);
- }
-
- template<class T, class ...Args>
- static void priv_construct(ndnboost::true_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
- {
- priv_construct_dispatch2(ndnboost::false_type(), a, p, ::ndnboost::forward<Args>(args)...);
- }
-
- template<class T, class ...Args>
- static void priv_construct_dispatch2(ndnboost::true_type, Alloc &a, T *p, BOOST_FWD_REF(Args) ...args)
- { a.construct( p, ::ndnboost::forward<Args>(args)...); }
-
- template<class T, class ...Args>
- static void priv_construct_dispatch2(ndnboost::false_type, Alloc &, T *p, BOOST_FWD_REF(Args) ...args)
- { ::new((void*)p) T(::ndnboost::forward<Args>(args)...); }
- #else // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- public:
- #define BOOST_PP_LOCAL_MACRO(n) \
- template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
- static void construct(Alloc &a, T *p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _)) \
- { \
- ::ndnboost::integral_constant<bool, container_detail::is_std_allocator<Alloc>::value> flag; \
- allocator_traits::priv_construct(flag, a, p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); \
- } \
- //
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
-
- private:
- #define BOOST_PP_LOCAL_MACRO(n) \
- template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
- static void priv_construct(ndnboost::false_type, Alloc &a, T *p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST,_)) \
- { \
- const bool value = \
- ndnboost::container::container_detail::has_member_function_callable_with_construct \
- < Alloc, T* BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_FWD_TYPE, _) >::value; \
- ::ndnboost::integral_constant<bool, value> flag; \
- priv_construct_dispatch2(flag, a, p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
- } \
- \
- template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
- static void priv_construct(ndnboost::true_type, Alloc &a, T *p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST,_)) \
- { \
- priv_construct_dispatch2(ndnboost::false_type(), a, p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); \
- } \
- \
- template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
- static void priv_construct_dispatch2(ndnboost::true_type, Alloc &a, T *p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST,_)) \
- { a.construct( p BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _) ); } \
- \
- template<class T BOOST_PP_ENUM_TRAILING_PARAMS(n, class P) > \
- static void priv_construct_dispatch2(ndnboost::false_type, Alloc &, T *p \
- BOOST_PP_ENUM_TRAILING(n, BOOST_CONTAINER_PP_PARAM_LIST, _) ) \
- { ::new((void*)p) T(BOOST_PP_ENUM(n, BOOST_CONTAINER_PP_PARAM_FORWARD, _)); } \
- //
- #define BOOST_PP_LOCAL_LIMITS (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS)
- #include BOOST_PP_LOCAL_ITERATE()
- #endif // #if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- #endif //#if defined(BOOST_CONTAINER_DOXYGEN_INVOKED)
-
- ///@endcond
-};
-
-} //namespace container {
-} //namespace ndnboost {
-
-#include <ndnboost/container/detail/config_end.hpp>
-
-#endif // ! defined(BOOST_CONTAINER_ALLOCATOR_ALLOCATOR_TRAITS_HPP)
diff --git a/ndnboost/container/container_fwd.hpp b/ndnboost/container/container_fwd.hpp
new file mode 100644
index 0000000..7dda7bd
--- /dev/null
+++ b/ndnboost/container/container_fwd.hpp
@@ -0,0 +1,173 @@
+//////////////////////////////////////////////////////////////////////////////
+//
+// (C) Copyright Ion Gaztanaga 2005-2012. 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)
+//
+// See http://www.boost.org/libs/container for documentation.
+//
+//////////////////////////////////////////////////////////////////////////////
+
+#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP
+#define BOOST_CONTAINER_CONTAINER_FWD_HPP
+
+#if (defined _MSC_VER) && (_MSC_VER >= 1200)
+# pragma once
+#endif
+
+//////////////////////////////////////////////////////////////////////////////
+// Standard predeclarations
+//////////////////////////////////////////////////////////////////////////////
+
+/// @cond
+
+namespace ndnboost{
+namespace intrusive{
+ //Create namespace to avoid compilation errors
+}}
+
+namespace ndnboost{ namespace container{ namespace container_detail{
+
+namespace bi = ndnboost::intrusive;
+
+}}}
+
+#include <utility>
+#include <memory>
+#include <functional>
+#include <iosfwd>
+#include <string>
+
+/// @endcond
+
+//////////////////////////////////////////////////////////////////////////////
+// Containers
+//////////////////////////////////////////////////////////////////////////////
+
+namespace ndnboost {
+namespace container {
+
+//vector class
+template <class T
+ ,class Allocator = std::allocator<T> >
+class vector;
+
+//vector class
+template <class T
+ ,class Allocator = std::allocator<T> >
+class stable_vector;
+
+//vector class
+template <class T
+ ,class Allocator = std::allocator<T> >
+class deque;
+
+//list class
+template <class T
+ ,class Allocator = std::allocator<T> >
+class list;
+
+//slist class
+template <class T
+ ,class Allocator = std::allocator<T> >
+class slist;
+
+//set class
+template <class Key
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<Key> >
+class set;
+
+//multiset class
+template <class Key
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<Key> >
+class multiset;
+
+//map class
+template <class Key
+ ,class T
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<std::pair<const Key, T> > >
+class map;
+
+//multimap class
+template <class Key
+ ,class T
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<std::pair<const Key, T> > >
+class multimap;
+
+//flat_set class
+template <class Key
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<Key> >
+class flat_set;
+
+//flat_multiset class
+template <class Key
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<Key> >
+class flat_multiset;
+
+//flat_map class
+template <class Key
+ ,class T
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<std::pair<Key, T> > >
+class flat_map;
+
+//flat_multimap class
+template <class Key
+ ,class T
+ ,class Compare = std::less<Key>
+ ,class Allocator = std::allocator<std::pair<Key, T> > >
+class flat_multimap;
+
+//basic_string class
+template <class CharT
+ ,class Traits = std::char_traits<CharT>
+ ,class Allocator = std::allocator<CharT> >
+class basic_string;
+
+//! Type used to tag that the input range is
+//! guaranteed to be ordered
+struct ordered_range_t
+{};
+
+//! Type used to tag that the input range is
+//! guaranteed to be ordered and unique
+struct ordered_unique_range_t
+ : public ordered_range_t
+{};
+
+//! Value used to tag that the input range is
+//! guaranteed to be ordered
+static const ordered_range_t ordered_range = ordered_range_t();
+
+//! Value used to tag that the input range is
+//! guaranteed to be ordered and unique
+static const ordered_unique_range_t ordered_unique_range = ordered_unique_range_t();
+
+/// @cond
+
+namespace detail_really_deep_namespace {
+
+//Otherwise, gcc issues a warning of previously defined
+//anonymous_instance and unique_instance
+struct dummy
+{
+ dummy()
+ {
+ (void)ordered_range;
+ (void)ordered_unique_range;
+ }
+};
+
+} //detail_really_deep_namespace {
+
+/// @endcond
+
+}} //namespace ndnboost { namespace container {
+
+#endif //#ifndef BOOST_CONTAINER_CONTAINER_FWD_HPP
diff --git a/ndnboost/container/detail/config_begin.hpp b/ndnboost/container/detail/config_begin.hpp
deleted file mode 100644
index 050ab17..0000000
--- a/ndnboost/container/detail/config_begin.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_CONFIG_INCLUDED
-#define BOOST_CONTAINER_CONTAINER_DETAIL_CONFIG_INCLUDED
-#include <ndnboost/config.hpp>
-
-#endif //BOOST_CONTAINER_CONTAINER_DETAIL_CONFIG_INCLUDED
-
-#ifdef BOOST_MSVC
- #ifndef _CRT_SECURE_NO_DEPRECATE
- #define BOOST_CONTAINER_DETAIL_CRT_SECURE_NO_DEPRECATE
- #define _CRT_SECURE_NO_DEPRECATE
- #endif
- #pragma warning (push)
- #pragma warning (disable : 4702) // unreachable code
- #pragma warning (disable : 4706) // assignment within conditional expression
- #pragma warning (disable : 4127) // conditional expression is constant
- #pragma warning (disable : 4146) // unary minus operator applied to unsigned type, result still unsigned
- #pragma warning (disable : 4284) // odd return type for operator->
- #pragma warning (disable : 4244) // possible loss of data
- #pragma warning (disable : 4251) // "identifier" : class "type" needs to have dll-interface to be used by clients of class "type2"
- #pragma warning (disable : 4267) // conversion from "X" to "Y", possible loss of data
- #pragma warning (disable : 4275) // non DLL-interface classkey "identifier" used as base for DLL-interface classkey "identifier"
- #pragma warning (disable : 4355) // "this" : used in base member initializer list
- #pragma warning (disable : 4503) // "identifier" : decorated name length exceeded, name was truncated
- #pragma warning (disable : 4511) // copy constructor could not be generated
- #pragma warning (disable : 4512) // assignment operator could not be generated
- #pragma warning (disable : 4514) // unreferenced inline removed
- #pragma warning (disable : 4521) // Disable "multiple copy constructors specified"
- #pragma warning (disable : 4522) // "class" : multiple assignment operators specified
- #pragma warning (disable : 4675) // "method" should be declared "static" and have exactly one parameter
- #pragma warning (disable : 4710) // function not inlined
- #pragma warning (disable : 4711) // function selected for automatic inline expansion
- #pragma warning (disable : 4786) // identifier truncated in debug info
- #pragma warning (disable : 4996) // "function": was declared deprecated
- #pragma warning (disable : 4197) // top-level volatile in cast is ignored
- #pragma warning (disable : 4541) // 'typeid' used on polymorphic type 'ndnboost::exception'
- // with /GR-; unpredictable behavior may result
- #pragma warning (disable : 4673) // throwing '' the following types will not be considered at the catch site
- #pragma warning (disable : 4671) // the copy constructor is inaccessible
- #pragma warning (disable : 4584) // X is already a base-class of Y
-#endif //BOOST_MSVC
diff --git a/ndnboost/container/detail/config_end.hpp b/ndnboost/container/detail/config_end.hpp
deleted file mode 100644
index 3451371..0000000
--- a/ndnboost/container/detail/config_end.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-#if defined BOOST_MSVC
- #pragma warning (pop)
- #ifdef BOOST_CONTAINER_DETAIL_CRT_SECURE_NO_DEPRECATE
- #undef BOOST_CONTAINER_DETAIL_CRT_SECURE_NO_DEPRECATE
- #undef _CRT_SECURE_NO_DEPRECATE
- #endif
-#endif
-
diff --git a/ndnboost/container/detail/memory_util.hpp b/ndnboost/container/detail/memory_util.hpp
deleted file mode 100644
index 07dd6fa..0000000
--- a/ndnboost/container/detail/memory_util.hpp
+++ /dev/null
@@ -1,83 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2011-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINER_ALLOCATOR_MEMORY_UTIL_HPP
-#define BOOST_CONTAINER_ALLOCATOR_MEMORY_UTIL_HPP
-
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif
-
-#include <ndnboost/container/detail/config_begin.hpp>
-#include <ndnboost/container/detail/workaround.hpp>
-#include <ndnboost/container/detail/preprocessor.hpp>
-#include <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>
-
-
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME allocate
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace ndnboost { namespace container { namespace container_detail {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 2, <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME destroy
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace ndnboost { namespace container { namespace container_detail {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 3, <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME max_size
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace ndnboost { namespace container { namespace container_detail {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME select_on_container_copy_construction
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace ndnboost { namespace container { namespace container_detail {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 0, <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME construct
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace ndnboost { namespace container { namespace container_detail {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS+1, <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_FUNCNAME swap
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_BEGIN namespace ndnboost { namespace container { namespace container_detail {
-#define BOOST_INTRUSIVE_HAS_MEMBER_FUNCTION_CALLABLE_WITH_NS_END }}}
-#define BOOST_PP_ITERATION_PARAMS_1 (3, (0, 1, <ndnboost/intrusive/detail/has_member_function_callable_with.hpp>))
-#include BOOST_PP_ITERATE()
-
-namespace ndnboost {
-namespace container {
-namespace container_detail {
-
-
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(pointer)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_pointer)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(reference)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_reference)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(void_pointer)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(const_void_pointer)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(size_type)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(propagate_on_container_copy_assignment)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(propagate_on_container_move_assignment)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(propagate_on_container_swap)
-BOOST_INTRUSIVE_INSTANTIATE_DEFAULT_TYPE_TMPLT(difference_type)
-
-} //namespace container_detail {
-} //namespace container {
-} //namespace ndnboost {
-
-#include <ndnboost/container/detail/config_end.hpp>
-
-#endif // ! defined(BOOST_CONTAINER_ALLOCATOR_MEMORY_UTIL_HPP)
diff --git a/ndnboost/container/detail/mpl.hpp b/ndnboost/container/detail/mpl.hpp
deleted file mode 100644
index 1281419..0000000
--- a/ndnboost/container/detail/mpl.hpp
+++ /dev/null
@@ -1,160 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2012.
-//
-// 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP
-#define BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP
-
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif
-
-#include <cstddef>
-
-namespace ndnboost {
-namespace container {
-namespace container_detail {
-
-template <class T, T val>
-struct integral_constant
-{
- static const T value = val;
- typedef integral_constant<T,val> type;
-};
-
-template< bool C_ >
-struct bool_ : integral_constant<bool, C_>
-{
- static const bool value = C_;
- operator bool() const { return bool_::value; }
-};
-
-typedef bool_<true> true_;
-typedef bool_<false> false_;
-
-typedef true_ true_type;
-typedef false_ false_type;
-
-typedef char yes_type;
-struct no_type
-{
- char padding[8];
-};
-
-template <bool B, class T = void>
-struct enable_if_c {
- typedef T type;
-};
-
-template <class T>
-struct enable_if_c<false, T> {};
-
-template <class Cond, class T = void>
-struct enable_if : public enable_if_c<Cond::value, T> {};
-
-template <class Cond, class T = void>
-struct disable_if : public enable_if_c<!Cond::value, T> {};
-
-template <bool B, class T = void>
-struct disable_if_c : public enable_if_c<!B, T> {};
-
-template <class T, class U>
-class is_convertible
-{
- typedef char true_t;
- class false_t { char dummy[2]; };
- static true_t dispatch(U);
- static false_t dispatch(...);
- static T trigger();
- public:
- enum { value = sizeof(dispatch(trigger())) == sizeof(true_t) };
-};
-
-template<
- bool C
- , typename T1
- , typename T2
- >
-struct if_c
-{
- typedef T1 type;
-};
-
-template<
- typename T1
- , typename T2
- >
-struct if_c<false,T1,T2>
-{
- typedef T2 type;
-};
-
-template<
- typename T1
- , typename T2
- , typename T3
- >
-struct if_
-{
- typedef typename if_c<0 != T1::value, T2, T3>::type type;
-};
-
-
-template <class Pair>
-struct select1st
-// : public std::unary_function<Pair, typename Pair::first_type>
-{
- template<class OtherPair>
- const typename Pair::first_type& operator()(const OtherPair& x) const
- { return x.first; }
-
- const typename Pair::first_type& operator()(const typename Pair::first_type& x) const
- { return x; }
-};
-
-// identity is an extension: it is not part of the standard.
-template <class T>
-struct identity
-// : public std::unary_function<T,T>
-{
- typedef T type;
- const T& operator()(const T& x) const
- { return x; }
-};
-
-template<std::size_t S>
-struct ls_zeros
-{
- static const std::size_t value = (S & std::size_t(1)) ? 0 : (1u + ls_zeros<(S >> 1u)>::value);
-};
-
-template<>
-struct ls_zeros<0>
-{
- static const std::size_t value = 0;
-};
-
-template<>
-struct ls_zeros<1>
-{
- static const std::size_t value = 0;
-};
-
-template <typename T> struct unvoid { typedef T type; };
-template <> struct unvoid<void> { struct type { }; };
-template <> struct unvoid<const void> { struct type { }; };
-
-} //namespace container_detail {
-} //namespace container {
-} //namespace ndnboost {
-
-#endif //#ifndef BOOST_CONTAINER_CONTAINER_DETAIL_MPL_HPP
-
diff --git a/ndnboost/container/detail/preprocessor.hpp b/ndnboost/container/detail/preprocessor.hpp
deleted file mode 100644
index 2a5854d..0000000
--- a/ndnboost/container/detail/preprocessor.hpp
+++ /dev/null
@@ -1,232 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2008-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
-#define BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
-
-#if (defined _MSC_VER) && (_MSC_VER >= 1200)
-# pragma once
-#endif
-
-#include <ndnboost/container/detail/config_begin.hpp>
-#include <ndnboost/container/detail/workaround.hpp>
-#include <ndnboost/move/utility.hpp>
-
-#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-//#error "This file is not needed when perfect forwarding is available"
-#endif //BOOST_CONTAINER_PERFECT_FORWARDING
-
-#include <ndnboost/preprocessor/iteration/local.hpp>
-#include <ndnboost/preprocessor/punctuation/paren_if.hpp>
-#include <ndnboost/preprocessor/punctuation/comma_if.hpp>
-#include <ndnboost/preprocessor/control/expr_if.hpp>
-#include <ndnboost/preprocessor/cat.hpp>
-#include <ndnboost/preprocessor/repetition/enum.hpp>
-#include <ndnboost/preprocessor/repetition/enum_params.hpp>
-#include <ndnboost/preprocessor/repetition/enum_trailing_params.hpp>
-#include <ndnboost/preprocessor/repetition/enum_trailing.hpp>
-#include <ndnboost/preprocessor/repetition/enum_shifted_params.hpp>
-#include <ndnboost/preprocessor/repetition/enum_shifted.hpp>
-#include <ndnboost/preprocessor/repetition/repeat.hpp>
-#include <ndnboost/preprocessor/logical/not.hpp>
-#include <ndnboost/preprocessor/arithmetic/sub.hpp>
-#include <ndnboost/preprocessor/arithmetic/add.hpp>
-#include <ndnboost/preprocessor/iteration/iterate.hpp>
-#include <ndnboost/move/utility.hpp>
-
-#define BOOST_CONTAINER_MAX_CONSTRUCTOR_PARAMETERS 10
-
-//Note:
-//We define template parameters as const references to
-//be able to bind temporaries. After that we will un-const them.
-//This cast is ugly but it is necessary until "perfect forwarding"
-//is achieved in C++0x. Meanwhile, if we want to be able to
-//bind rvalues with non-const references, we have to be ugly
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- #define BOOST_CONTAINER_PP_PARAM_LIST(z, n, data) \
- BOOST_PP_CAT(P, n) && BOOST_PP_CAT(p, n) \
- //!
-#else
- #define BOOST_CONTAINER_PP_PARAM_LIST(z, n, data) \
- const BOOST_PP_CAT(P, n) & BOOST_PP_CAT(p, n) \
- //!
-#endif //#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-
-#define BOOST_CONTAINER_PP_CONST_REF_PARAM_LIST_Q(z, n, Data) \
-const BOOST_PP_CAT(Q, n) & BOOST_PP_CAT(q, n) \
-//!
-
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
- #define BOOST_CONTAINER_PP_PARAM(U, u) \
- U && u \
- //!
-#else
- #define BOOST_CONTAINER_PP_PARAM(U, u) \
- const U & u \
- //!
-#endif //#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-
- #define BOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (::ndnboost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) )) \
- //!
-
-#else //BOOST_NO_CXX11_RVALUE_REFERENCES
-
- #define BOOST_CONTAINER_PP_PARAM_INIT(z, n, data) \
- BOOST_PP_CAT(m_p, n) (const_cast<BOOST_PP_CAT(P, n) &>(BOOST_PP_CAT(p, n))) \
- //!
-#endif //#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-
-#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-
- #if defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-
- namespace ndnboost {
- namespace container {
- namespace container_detail {
- template<class T>
- struct ref_holder;
-
- template<class T>
- struct ref_holder<T &>
- {
- explicit ref_holder(T &t)
- : t_(t)
- {}
- T &t_;
- T & get() { return t_; }
- };
-
- template<class T>
- struct ref_holder<const T>
- {
- explicit ref_holder(const T &t)
- : t_(t)
- {}
- const T &t_;
- const T & get() { return t_; }
- };
-
- template<class T>
- struct ref_holder<const T &&>
- {
- explicit ref_holder(const T &t)
- : t_(t)
- {}
- const T &t_;
- const T & get() { return t_; }
- };
-
- template<class T>
- struct ref_holder
- {
- explicit ref_holder(T &&t)
- : t_(t)
- {}
- T &t_;
- T && get() { return ::ndnboost::move(t_); }
- };
-
- template<class T>
- struct ref_holder<T &&>
- {
- explicit ref_holder(T &&t)
- : t_(t)
- {}
- T &t_;
- T && get() { return ::ndnboost::move(t_); }
- };
-
- } //namespace container_detail {
- } //namespace container {
- } //namespace ndnboost {
-
- #define BOOST_CONTAINER_PP_PARAM_DEFINE(z, n, data) \
- ::ndnboost::container::container_detail::ref_holder<BOOST_PP_CAT(P, n)> BOOST_PP_CAT(m_p, n); \
- //!
-
- #else //BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG
-
- #define BOOST_CONTAINER_PP_PARAM_DEFINE(z, n, data) \
- BOOST_PP_CAT(P, n) && BOOST_PP_CAT(m_p, n); \
- //!
-
- #endif //defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-
-#else //BOOST_NO_CXX11_RVALUE_REFERENCES
-
- #define BOOST_CONTAINER_PP_PARAM_DEFINE(z, n, data) \
- BOOST_PP_CAT(P, n) & BOOST_PP_CAT(m_p, n); \
- //!
-#endif //#ifndef BOOST_NO_CXX11_RVALUE_REFERENCES
-
-#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-
- #define BOOST_CONTAINER_PP_MEMBER_FORWARD(z, n, data) BOOST_PP_CAT(this->m_p, n).get() \
- //!
-
-#else //!defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-
- #define BOOST_CONTAINER_PP_MEMBER_FORWARD(z, n, data) \
- ::ndnboost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(this->m_p, n) ) \
- //!
-
-#endif //!defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && defined(BOOST_MOVE_MSVC_10_MEMBER_RVALUE_REF_BUG)
-
-#define BOOST_CONTAINER_PP_PARAM_INC(z, n, data) \
- BOOST_PP_CAT(++this->m_p, n) \
-//!
-
-#define BOOST_CONTAINER_PP_IDENTITY(z, n, data) data
-
-
-#define BOOST_CONTAINER_PP_PARAM_FORWARD(z, n, data) \
-::ndnboost::forward< BOOST_PP_CAT(P, n) >( BOOST_PP_CAT(p, n) ) \
-//!
-
-#define BOOST_CONTAINER_PP_DECLVAL(z, n, data) \
-::ndnboost::move_detail::declval< BOOST_PP_CAT(P, n) >() \
-//!
-
-#define BOOST_CONTAINER_PP_MEMBER_IT_FORWARD(z, n, data) \
-BOOST_PP_CAT(*this->m_p, n) \
-//!
-
-#define BOOST_CONTAINER_PP_TEMPLATE_PARAM_VOID_DEFAULT(z, n, data) \
- BOOST_PP_CAT(class P, n) = void \
-//!
-
-#define BOOST_CONTAINER_PP_TEMPLATE_PARAM_WITH_DEFAULT(z, n, default_type) \
- BOOST_PP_CAT(class P, n) = default_type \
-//!
-
-#define BOOST_CONTAINER_PP_STATIC_PARAM_REF_DECLARE(z, n, data) \
- static BOOST_PP_CAT(P, n) & BOOST_PP_CAT(p, n); \
-//!
-
-#define BOOST_CONTAINER_PP_PARAM_PASS(z, n, data) \
- BOOST_PP_CAT(p, n) \
-//!
-
-#define BOOST_CONTAINER_PP_FWD_TYPE(z, n, data) \
- typename ::ndnboost::move_detail::forward_type< BOOST_PP_CAT(P, n) >::type \
-//!
-
-#include <ndnboost/container/detail/config_end.hpp>
-
-//#else
-
-//#ifdef BOOST_CONTAINER_PERFECT_FORWARDING
-//#error "This file is not needed when perfect forwarding is available"
-//#endif //BOOST_CONTAINER_PERFECT_FORWARDING
-
-#endif //#ifndef BOOST_CONTAINER_DETAIL_PREPROCESSOR_HPP
diff --git a/ndnboost/container/detail/workaround.hpp b/ndnboost/container/detail/workaround.hpp
deleted file mode 100644
index e8d77c0..0000000
--- a/ndnboost/container/detail/workaround.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-//////////////////////////////////////////////////////////////////////////////
-//
-// (C) Copyright Ion Gaztanaga 2005-2012. 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)
-//
-// See http://www.boost.org/libs/container for documentation.
-//
-//////////////////////////////////////////////////////////////////////////////
-
-#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-#define BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
-
-#include <ndnboost/container/detail/config_begin.hpp>
-
-#if !defined(BOOST_NO_CXX11_RVALUE_REFERENCES) && !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)\
- && !defined(BOOST_INTERPROCESS_DISABLE_VARIADIC_TMPL)
- #define BOOST_CONTAINER_PERFECT_FORWARDING
-#endif
-
-#if defined(BOOST_NO_CXX11_NOEXCEPT)
- #if defined(BOOST_MSVC)
- #define BOOST_CONTAINER_NOEXCEPT throw()
- #else
- #define BOOST_CONTAINER_NOEXCEPT
- #endif
- #define BOOST_CONTAINER_NOEXCEPT_IF(x)
-#else
- #define BOOST_CONTAINER_NOEXCEPT noexcept
- #define BOOST_CONTAINER_NOEXCEPT_IF(x) noexcept(x)
-#endif
-
-#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && defined(__GXX_EXPERIMENTAL_CXX0X__)\
- && (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40700)
- #define BOOST_CONTAINER_UNIMPLEMENTED_PACK_EXPANSION_TO_FIXED_LIST
-#endif
-
-//Macros for documentation purposes. For code, expands to the argument
-#define BOOST_CONTAINER_IMPDEF(TYPE) TYPE
-#define BOOST_CONTAINER_SEEDOC(TYPE) TYPE
-
-#include <ndnboost/container/detail/config_end.hpp>
-
-#endif //#ifndef BOOST_CONTAINER_DETAIL_WORKAROUND_HPP
diff --git a/ndnboost/cstdlib.hpp b/ndnboost/cstdlib.hpp
new file mode 100644
index 0000000..5101ba7
--- /dev/null
+++ b/ndnboost/cstdlib.hpp
@@ -0,0 +1,41 @@
+// boost/cstdlib.hpp header ------------------------------------------------//
+
+// Copyright Beman Dawes 2001. 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)
+
+// See http://www.boost.org/libs/utility/cstdlib.html for documentation.
+
+// Revision History
+// 26 Feb 01 Initial version (Beman Dawes)
+
+#ifndef BOOST_CSTDLIB_HPP
+#define BOOST_CSTDLIB_HPP
+
+#include <cstdlib>
+
+namespace ndnboost
+{
+ // The intent is to propose the following for addition to namespace std
+ // in the C++ Standard Library, and to then deprecate EXIT_SUCCESS and
+ // EXIT_FAILURE. As an implementation detail, this header defines the
+ // new constants in terms of EXIT_SUCCESS and EXIT_FAILURE. In a new
+ // standard, the constants would be implementation-defined, although it
+ // might be worthwhile to "suggest" (which a standard is allowed to do)
+ // values of 0 and 1 respectively.
+
+ // Rationale for having multiple failure values: some environments may
+ // wish to distinguish between different classes of errors.
+ // Rationale for choice of values: programs often use values < 100 for
+ // their own error reporting. Values > 255 are sometimes reserved for
+ // system detected errors. 200/201 were suggested to minimize conflict.
+
+ const int exit_success = EXIT_SUCCESS; // implementation-defined value
+ const int exit_failure = EXIT_FAILURE; // implementation-defined value
+ const int exit_exception_failure = 200; // otherwise uncaught exception
+ const int exit_test_failure = 201; // report_error or
+ // report_critical_error called.
+}
+
+#endif
+
diff --git a/ndnboost/detail/binary_search.hpp b/ndnboost/detail/binary_search.hpp
new file mode 100644
index 0000000..da27f39
--- /dev/null
+++ b/ndnboost/detail/binary_search.hpp
@@ -0,0 +1,216 @@
+// Copyright (c) 2000 David Abrahams.
+// 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)
+//
+// Copyright (c) 1994
+// Hewlett-Packard Company
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation. Hewlett-Packard Company makes no
+// representations about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied warranty.
+//
+// Copyright (c) 1996
+// Silicon Graphics Computer Systems, Inc.
+//
+// Permission to use, copy, modify, distribute and sell this software
+// and its documentation for any purpose is hereby granted without fee,
+// provided that the above copyright notice appear in all copies and
+// that both that copyright notice and this permission notice appear
+// in supporting documentation. Silicon Graphics makes no
+// representations about the suitability of this software for any
+// purpose. It is provided "as is" without express or implied warranty.
+//
+#ifndef BINARY_SEARCH_DWA_122600_H_
+# define BINARY_SEARCH_DWA_122600_H_
+
+# include <ndnboost/detail/iterator.hpp>
+# include <utility>
+
+namespace ndnboost { namespace detail {
+
+template <class ForwardIter, class Tp>
+ForwardIter lower_bound(ForwardIter first, ForwardIter last,
+ const Tp& val)
+{
+ typedef detail::iterator_traits<ForwardIter> traits;
+
+ typename traits::difference_type len = ndnboost::detail::distance(first, last);
+ typename traits::difference_type half;
+ ForwardIter middle;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ std::advance(middle, half);
+ if (*middle < val) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ else
+ len = half;
+ }
+ return first;
+}
+
+template <class ForwardIter, class Tp, class Compare>
+ForwardIter lower_bound(ForwardIter first, ForwardIter last,
+ const Tp& val, Compare comp)
+{
+ typedef detail::iterator_traits<ForwardIter> traits;
+
+ typename traits::difference_type len = ndnboost::detail::distance(first, last);
+ typename traits::difference_type half;
+ ForwardIter middle;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ std::advance(middle, half);
+ if (comp(*middle, val)) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ else
+ len = half;
+ }
+ return first;
+}
+
+template <class ForwardIter, class Tp>
+ForwardIter upper_bound(ForwardIter first, ForwardIter last,
+ const Tp& val)
+{
+ typedef detail::iterator_traits<ForwardIter> traits;
+
+ typename traits::difference_type len = ndnboost::detail::distance(first, last);
+ typename traits::difference_type half;
+ ForwardIter middle;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ std::advance(middle, half);
+ if (val < *middle)
+ len = half;
+ else {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ }
+ return first;
+}
+
+template <class ForwardIter, class Tp, class Compare>
+ForwardIter upper_bound(ForwardIter first, ForwardIter last,
+ const Tp& val, Compare comp)
+{
+ typedef detail::iterator_traits<ForwardIter> traits;
+
+ typename traits::difference_type len = ndnboost::detail::distance(first, last);
+ typename traits::difference_type half;
+ ForwardIter middle;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ std::advance(middle, half);
+ if (comp(val, *middle))
+ len = half;
+ else {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ }
+ return first;
+}
+
+template <class ForwardIter, class Tp>
+std::pair<ForwardIter, ForwardIter>
+equal_range(ForwardIter first, ForwardIter last, const Tp& val)
+{
+ typedef detail::iterator_traits<ForwardIter> traits;
+
+ typename traits::difference_type len = ndnboost::detail::distance(first, last);
+ typename traits::difference_type half;
+ ForwardIter middle, left, right;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ std::advance(middle, half);
+ if (*middle < val) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ else if (val < *middle)
+ len = half;
+ else {
+ left = ndnboost::detail::lower_bound(first, middle, val);
+ std::advance(first, len);
+ right = ndnboost::detail::upper_bound(++middle, first, val);
+ return std::pair<ForwardIter, ForwardIter>(left, right);
+ }
+ }
+ return std::pair<ForwardIter, ForwardIter>(first, first);
+}
+
+template <class ForwardIter, class Tp, class Compare>
+std::pair<ForwardIter, ForwardIter>
+equal_range(ForwardIter first, ForwardIter last, const Tp& val,
+ Compare comp)
+{
+ typedef detail::iterator_traits<ForwardIter> traits;
+
+ typename traits::difference_type len = ndnboost::detail::distance(first, last);
+ typename traits::difference_type half;
+ ForwardIter middle, left, right;
+
+ while (len > 0) {
+ half = len >> 1;
+ middle = first;
+ std::advance(middle, half);
+ if (comp(*middle, val)) {
+ first = middle;
+ ++first;
+ len = len - half - 1;
+ }
+ else if (comp(val, *middle))
+ len = half;
+ else {
+ left = ndnboost::detail::lower_bound(first, middle, val, comp);
+ std::advance(first, len);
+ right = ndnboost::detail::upper_bound(++middle, first, val, comp);
+ return std::pair<ForwardIter, ForwardIter>(left, right);
+ }
+ }
+ return std::pair<ForwardIter, ForwardIter>(first, first);
+}
+
+template <class ForwardIter, class Tp>
+bool binary_search(ForwardIter first, ForwardIter last,
+ const Tp& val) {
+ ForwardIter i = ndnboost::detail::lower_bound(first, last, val);
+ return i != last && !(val < *i);
+}
+
+template <class ForwardIter, class Tp, class Compare>
+bool binary_search(ForwardIter first, ForwardIter last,
+ const Tp& val,
+ Compare comp) {
+ ForwardIter i = ndnboost::detail::lower_bound(first, last, val, comp);
+ return i != last && !comp(val, *i);
+}
+
+}} // namespace ndnboost::detail
+
+#endif // BINARY_SEARCH_DWA_122600_H_
diff --git a/ndnboost/detail/endian.hpp b/ndnboost/detail/endian.hpp
new file mode 100644
index 0000000..ccee87f
--- /dev/null
+++ b/ndnboost/detail/endian.hpp
@@ -0,0 +1,126 @@
+// Copyright 2005 Caleb Epstein
+// Copyright 2006 John Maddock
+// Copyright 2010 Rene Rivera
+// Distributed under the Boost Software License, Version 1.0. (See accompany-
+// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+/*
+ * Copyright (c) 1997
+ * Silicon Graphics Computer Systems, Inc.
+ *
+ * Permission to use, copy, modify, distribute and sell this software
+ * and its documentation for any purpose is hereby granted without fee,
+ * provided that the above copyright notice appear in all copies and
+ * that both that copyright notice and this permission notice appear
+ * in supporting documentation. Silicon Graphics makes no
+ * representations about the suitability of this software for any
+ * purpose. It is provided "as is" without express or implied warranty.
+ */
+
+/*
+ * Copyright notice reproduced from <ndnboost/detail/limits.hpp>, from
+ * which this code was originally taken.
+ *
+ * Modified by Caleb Epstein to use <endian.h> with GNU libc and to
+ * defined the BOOST_ENDIAN macro.
+ */
+
+#ifndef BOOST_DETAIL_ENDIAN_HPP
+#define BOOST_DETAIL_ENDIAN_HPP
+
+//
+// Special cases come first:
+//
+#if defined (__GLIBC__)
+// GNU libc offers the helpful header <endian.h> which defines
+// __BYTE_ORDER
+# include <endian.h>
+# if (__BYTE_ORDER == __LITTLE_ENDIAN)
+# define BOOST_LITTLE_ENDIAN
+# elif (__BYTE_ORDER == __BIG_ENDIAN)
+# define BOOST_BIG_ENDIAN
+# elif (__BYTE_ORDER == __PDP_ENDIAN)
+# define BOOST_PDP_ENDIAN
+# else
+# error Unknown machine endianness detected.
+# endif
+# define BOOST_BYTE_ORDER __BYTE_ORDER
+
+#elif defined(__NetBSD__) || defined(__FreeBSD__) || \
+ defined(__OpenBSD__) || (__DragonFly__)
+//
+// BSD has endian.h, see https://svn.boost.org/trac/boost/ticket/6013
+# if defined(__OpenBSD__)
+# include <machine/endian.h>
+# else
+# include <sys/endian.h>
+# endif
+# if (_BYTE_ORDER == _LITTLE_ENDIAN)
+# define BOOST_LITTLE_ENDIAN
+# elif (_BYTE_ORDER == _BIG_ENDIAN)
+# define BOOST_BIG_ENDIAN
+# elif (_BYTE_ORDER == _PDP_ENDIAN)
+# define BOOST_PDP_ENDIAN
+# else
+# error Unknown machine endianness detected.
+# endif
+# define BOOST_BYTE_ORDER _BYTE_ORDER
+
+#elif defined( __ANDROID__ )
+// Adroid specific code, see: https://svn.boost.org/trac/boost/ticket/7528
+// Here we can use machine/_types.h, see:
+// http://stackoverflow.com/questions/6212951/endianness-of-android-ndk
+# include "machine/_types.h"
+# ifdef __ARMEB__
+# define BOOST_BIG_ENDIAN
+# define BOOST_BYTE_ORDER 4321
+# else
+# define BOOST_LITTLE_ENDIAN
+# define BOOST_BYTE_ORDER 1234
+# endif // __ARMEB__
+
+#elif defined( _XBOX )
+//
+// XBox is always big endian??
+//
+# define BOOST_BIG_ENDIAN
+# define BOOST_BYTE_ORDER 4321
+
+#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \
+ defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \
+ defined(__BIGENDIAN__) && !defined(__LITTLEENDIAN__) || \
+ defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN)
+# define BOOST_BIG_ENDIAN
+# define BOOST_BYTE_ORDER 4321
+#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \
+ defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \
+ defined(__LITTLEENDIAN__) && !defined(__BIGENDIAN__) || \
+ defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN)
+# define BOOST_LITTLE_ENDIAN
+# define BOOST_BYTE_ORDER 1234
+#elif defined(__sparc) || defined(__sparc__) \
+ || defined(_POWER) || defined(__powerpc__) \
+ || defined(__ppc__) || defined(__hpux) || defined(__hppa) \
+ || defined(_MIPSEB) || defined(_POWER) \
+ || defined(__s390__) || defined(__ARMEB__)
+# define BOOST_BIG_ENDIAN
+# define BOOST_BYTE_ORDER 4321
+#elif defined(__i386__) || defined(__alpha__) \
+ || defined(__ia64) || defined(__ia64__) \
+ || defined(_M_IX86) || defined(_M_IA64) \
+ || defined(_M_ALPHA) || defined(__amd64) \
+ || defined(__amd64__) || defined(_M_AMD64) \
+ || defined(__x86_64) || defined(__x86_64__) \
+ || defined(_M_X64) || defined(__bfin__) \
+ || defined(__ARMEL__) \
+ || (defined(_WIN32) && defined(__ARM__) && defined(_MSC_VER)) // ARM Windows CE don't define anything reasonably unique, but there are no big-endian Windows versions
+
+# define BOOST_LITTLE_ENDIAN
+# define BOOST_BYTE_ORDER 1234
+#else
+# error The file boost/detail/endian.hpp needs to be set up for your CPU type.
+#endif
+
+
+#endif
+
diff --git a/ndnboost/detail/fenv.hpp b/ndnboost/detail/fenv.hpp
new file mode 100644
index 0000000..4618b54
--- /dev/null
+++ b/ndnboost/detail/fenv.hpp
@@ -0,0 +1,74 @@
+/*=============================================================================
+ Copyright (c) 2010 Bryce Lelbach
+
+ 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)
+=============================================================================*/
+
+#include <ndnboost/config.hpp>
+
+#if defined(BOOST_NO_FENV_H)
+ #error This platform does not have a floating point environment
+#endif
+
+#if !defined(BOOST_DETAIL_FENV_HPP)
+#define BOOST_DETAIL_FENV_HPP
+
+/* If we're using clang + glibc, we have to get hacky.
+ * See http://llvm.org/bugs/show_bug.cgi?id=6907 */
+#if defined(__clang__) && (__clang_major__ < 3) && \
+ defined(__GNU_LIBRARY__) && /* up to version 5 */ \
+ defined(__GLIBC__) && /* version 6 + */ \
+ !defined(_FENV_H)
+ #define _FENV_H
+
+ #include <features.h>
+ #include <bits/fenv.h>
+
+ extern "C" {
+ extern int fegetexceptflag (fexcept_t*, int) __THROW;
+ extern int fesetexceptflag (__const fexcept_t*, int) __THROW;
+ extern int feclearexcept (int) __THROW;
+ extern int feraiseexcept (int) __THROW;
+ extern int fetestexcept (int) __THROW;
+ extern int fegetround (void) __THROW;
+ extern int fesetround (int) __THROW;
+ extern int fegetenv (fenv_t*) __THROW;
+ extern int fesetenv (__const fenv_t*) __THROW;
+ extern int feupdateenv (__const fenv_t*) __THROW;
+ extern int feholdexcept (fenv_t*) __THROW;
+
+ #ifdef __USE_GNU
+ extern int feenableexcept (int) __THROW;
+ extern int fedisableexcept (int) __THROW;
+ extern int fegetexcept (void) __THROW;
+ #endif
+ }
+
+ namespace std { namespace tr1 {
+ using ::fenv_t;
+ using ::fexcept_t;
+ using ::fegetexceptflag;
+ using ::fesetexceptflag;
+ using ::feclearexcept;
+ using ::feraiseexcept;
+ using ::fetestexcept;
+ using ::fegetround;
+ using ::fesetround;
+ using ::fegetenv;
+ using ::fesetenv;
+ using ::feupdateenv;
+ using ::feholdexcept;
+ } }
+
+#else /* if we're not using GNU's C stdlib, fenv.h should work with clang */
+ #if defined(__SUNPRO_CC) /* lol suncc */
+ #include <stdio.h>
+ #endif
+
+ #include <fenv.h>
+
+#endif
+
+#endif /* BOOST_DETAIL_FENV_HPP */
+
diff --git a/ndnboost/detail/indirect_traits.hpp b/ndnboost/detail/indirect_traits.hpp
new file mode 100644
index 0000000..fa2d671
--- /dev/null
+++ b/ndnboost/detail/indirect_traits.hpp
@@ -0,0 +1,487 @@
+// Copyright David Abrahams 2002.
+// 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)
+#ifndef INDIRECT_TRAITS_DWA2002131_HPP
+# define INDIRECT_TRAITS_DWA2002131_HPP
+# include <ndnboost/type_traits/is_function.hpp>
+# include <ndnboost/type_traits/is_reference.hpp>
+# include <ndnboost/type_traits/is_pointer.hpp>
+# include <ndnboost/type_traits/is_class.hpp>
+# include <ndnboost/type_traits/is_const.hpp>
+# include <ndnboost/type_traits/is_volatile.hpp>
+# include <ndnboost/type_traits/is_member_function_pointer.hpp>
+# include <ndnboost/type_traits/is_member_pointer.hpp>
+# include <ndnboost/type_traits/remove_cv.hpp>
+# include <ndnboost/type_traits/remove_reference.hpp>
+# include <ndnboost/type_traits/remove_pointer.hpp>
+
+# include <ndnboost/type_traits/detail/ice_and.hpp>
+# include <ndnboost/detail/workaround.hpp>
+
+# include <ndnboost/mpl/eval_if.hpp>
+# include <ndnboost/mpl/if.hpp>
+# include <ndnboost/mpl/bool.hpp>
+# include <ndnboost/mpl/and.hpp>
+# include <ndnboost/mpl/not.hpp>
+# include <ndnboost/mpl/aux_/lambda_support.hpp>
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# include <ndnboost/detail/is_function_ref_tester.hpp>
+# endif
+
+namespace ndnboost { namespace detail {
+
+namespace indirect_traits {
+
+# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+template <class T>
+struct is_reference_to_const : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_const<T const&> : mpl::true_
+{
+};
+
+# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
+template<class T>
+struct is_reference_to_const<T const volatile&> : mpl::true_
+{
+};
+# endif
+
+template <class T>
+struct is_reference_to_function : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_function<T&> : is_function<T>
+{
+};
+
+template <class T>
+struct is_pointer_to_function : mpl::false_
+{
+};
+
+// There's no such thing as a pointer-to-cv-function, so we don't need
+// specializations for those
+template <class T>
+struct is_pointer_to_function<T*> : is_function<T>
+{
+};
+
+template <class T>
+struct is_reference_to_member_function_pointer_impl : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_member_function_pointer_impl<T&>
+ : is_member_function_pointer<typename remove_cv<T>::type>
+{
+};
+
+
+template <class T>
+struct is_reference_to_member_function_pointer
+ : is_reference_to_member_function_pointer_impl<T>
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
+};
+
+template <class T>
+struct is_reference_to_function_pointer_aux
+ : mpl::and_<
+ is_reference<T>
+ , is_pointer_to_function<
+ typename remove_cv<
+ typename remove_reference<T>::type
+ >::type
+ >
+ >
+{
+ // There's no such thing as a pointer-to-cv-function, so we don't need specializations for those
+};
+
+template <class T>
+struct is_reference_to_function_pointer
+ : mpl::if_<
+ is_reference_to_function<T>
+ , mpl::false_
+ , is_reference_to_function_pointer_aux<T>
+ >::type
+{
+};
+
+template <class T>
+struct is_reference_to_non_const
+ : mpl::and_<
+ is_reference<T>
+ , mpl::not_<
+ is_reference_to_const<T>
+ >
+ >
+{
+};
+
+template <class T>
+struct is_reference_to_volatile : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_volatile<T volatile&> : mpl::true_
+{
+};
+
+# if defined(BOOST_MSVC) && _MSC_FULL_VER <= 13102140 // vc7.01 alpha workaround
+template <class T>
+struct is_reference_to_volatile<T const volatile&> : mpl::true_
+{
+};
+# endif
+
+
+template <class T>
+struct is_reference_to_pointer : mpl::false_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T*&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T* const&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T* volatile&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_pointer<T* const volatile&> : mpl::true_
+{
+};
+
+template <class T>
+struct is_reference_to_class
+ : mpl::and_<
+ is_reference<T>
+ , is_class<
+ typename remove_cv<
+ typename remove_reference<T>::type
+ >::type
+ >
+ >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
+};
+
+template <class T>
+struct is_pointer_to_class
+ : mpl::and_<
+ is_pointer<T>
+ , is_class<
+ typename remove_cv<
+ typename remove_pointer<T>::type
+ >::type
+ >
+ >
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_class,(T))
+};
+
+# else
+
+using namespace ndnboost::detail::is_function_ref_tester_;
+
+typedef char (&inner_yes_type)[3];
+typedef char (&inner_no_type)[2];
+typedef char (&outer_no_type)[1];
+
+template <typename V>
+struct is_const_help
+{
+ typedef typename mpl::if_<
+ is_const<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <typename V>
+struct is_volatile_help
+{
+ typedef typename mpl::if_<
+ is_volatile<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <typename V>
+struct is_pointer_help
+{
+ typedef typename mpl::if_<
+ is_pointer<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <typename V>
+struct is_class_help
+{
+ typedef typename mpl::if_<
+ is_class<V>
+ , inner_yes_type
+ , inner_no_type
+ >::type type;
+};
+
+template <class T>
+struct is_reference_to_function_aux
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value = sizeof(detail::is_function_ref_tester(t,0)) == sizeof(::ndnboost::type_traits::yes_type));
+ typedef mpl::bool_<value> type;
+ };
+
+template <class T>
+struct is_reference_to_function
+ : mpl::if_<is_reference<T>, is_reference_to_function_aux<T>, mpl::bool_<false> >::type
+{
+};
+
+template <class T>
+struct is_pointer_to_function_aux
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(::ndnboost::type_traits::is_function_ptr_tester(t)) == sizeof(::ndnboost::type_traits::yes_type));
+ typedef mpl::bool_<value> type;
+};
+
+template <class T>
+struct is_pointer_to_function
+ : mpl::if_<is_pointer<T>, is_pointer_to_function_aux<T>, mpl::bool_<false> >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_pointer_to_function,(T))
+};
+
+struct false_helper1
+{
+ template <class T>
+ struct apply : mpl::false_
+ {
+ };
+};
+
+template <typename V>
+typename is_const_help<V>::type reference_to_const_helper(V&);
+outer_no_type
+reference_to_const_helper(...);
+
+struct true_helper1
+{
+ template <class T>
+ struct apply
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(reference_to_const_helper(t)) == sizeof(inner_yes_type));
+ typedef mpl::bool_<value> type;
+ };
+};
+
+template <bool ref = true>
+struct is_reference_to_const_helper1 : true_helper1
+{
+};
+
+template <>
+struct is_reference_to_const_helper1<false> : false_helper1
+{
+};
+
+
+template <class T>
+struct is_reference_to_const
+ : is_reference_to_const_helper1<is_reference<T>::value>::template apply<T>
+{
+};
+
+
+template <bool ref = true>
+struct is_reference_to_non_const_helper1
+{
+ template <class T>
+ struct apply
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(reference_to_const_helper(t)) == sizeof(inner_no_type));
+
+ typedef mpl::bool_<value> type;
+ };
+};
+
+template <>
+struct is_reference_to_non_const_helper1<false> : false_helper1
+{
+};
+
+
+template <class T>
+struct is_reference_to_non_const
+ : is_reference_to_non_const_helper1<is_reference<T>::value>::template apply<T>
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_non_const,(T))
+};
+
+
+template <typename V>
+typename is_volatile_help<V>::type reference_to_volatile_helper(V&);
+outer_no_type
+reference_to_volatile_helper(...);
+
+template <bool ref = true>
+struct is_reference_to_volatile_helper1
+{
+ template <class T>
+ struct apply
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof(reference_to_volatile_helper(t)) == sizeof(inner_yes_type));
+ typedef mpl::bool_<value> type;
+ };
+};
+
+template <>
+struct is_reference_to_volatile_helper1<false> : false_helper1
+{
+};
+
+
+template <class T>
+struct is_reference_to_volatile
+ : is_reference_to_volatile_helper1<is_reference<T>::value>::template apply<T>
+{
+};
+
+template <typename V>
+typename is_pointer_help<V>::type reference_to_pointer_helper(V&);
+outer_no_type reference_to_pointer_helper(...);
+
+template <class T>
+struct reference_to_pointer_impl
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = (sizeof((reference_to_pointer_helper)(t)) == sizeof(inner_yes_type))
+ );
+
+ typedef mpl::bool_<value> type;
+};
+
+template <class T>
+struct is_reference_to_pointer
+ : mpl::eval_if<is_reference<T>, reference_to_pointer_impl<T>, mpl::false_>::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_pointer,(T))
+};
+
+template <class T>
+struct is_reference_to_function_pointer
+ : mpl::eval_if<is_reference<T>, is_pointer_to_function_aux<T>, mpl::false_>::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_function_pointer,(T))
+};
+
+
+template <class T>
+struct is_member_function_pointer_help
+ : mpl::if_<is_member_function_pointer<T>, inner_yes_type, inner_no_type>
+{};
+
+template <typename V>
+typename is_member_function_pointer_help<V>::type member_function_pointer_helper(V&);
+outer_no_type member_function_pointer_helper(...);
+
+template <class T>
+struct is_pointer_to_member_function_aux
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = sizeof((member_function_pointer_helper)(t)) == sizeof(inner_yes_type));
+ typedef mpl::bool_<value> type;
+};
+
+template <class T>
+struct is_reference_to_member_function_pointer
+ : mpl::if_<
+ is_reference<T>
+ , is_pointer_to_member_function_aux<T>
+ , mpl::bool_<false>
+ >::type
+{
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_member_function_pointer,(T))
+};
+
+template <typename V>
+typename is_class_help<V>::type reference_to_class_helper(V const volatile&);
+outer_no_type reference_to_class_helper(...);
+
+template <class T>
+struct is_reference_to_class
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = (is_reference<T>::value
+ & (sizeof(reference_to_class_helper(t)) == sizeof(inner_yes_type)))
+ );
+ typedef mpl::bool_<value> type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,is_reference_to_class,(T))
+};
+
+template <typename V>
+typename is_class_help<V>::type pointer_to_class_helper(V const volatile*);
+outer_no_type pointer_to_class_helper(...);
+
+template <class T>
+struct is_pointer_to_class
+{
+ static T t;
+ BOOST_STATIC_CONSTANT(
+ bool, value
+ = (is_pointer<T>::value
+ && sizeof(pointer_to_class_helper(t)) == sizeof(inner_yes_type))
+ );
+ typedef mpl::bool_<value> type;
+};
+# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+}
+
+using namespace indirect_traits;
+
+}} // namespace ndnboost::python::detail
+
+#endif // INDIRECT_TRAITS_DWA2002131_HPP
diff --git a/ndnboost/detail/is_function_ref_tester.hpp b/ndnboost/detail/is_function_ref_tester.hpp
new file mode 100644
index 0000000..b8301ec
--- /dev/null
+++ b/ndnboost/detail/is_function_ref_tester.hpp
@@ -0,0 +1,136 @@
+
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
+// 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)
+
+#if !defined(BOOST_PP_IS_ITERATING)
+
+///// header body
+
+#ifndef BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
+#define BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
+
+#include "ndnboost/type_traits/detail/yes_no_type.hpp"
+#include "ndnboost/type_traits/config.hpp"
+
+#if defined(BOOST_TT_PREPROCESSING_MODE)
+# include "ndnboost/preprocessor/iterate.hpp"
+# include "ndnboost/preprocessor/enum_params.hpp"
+# include "ndnboost/preprocessor/comma_if.hpp"
+#endif
+
+namespace ndnboost {
+namespace detail {
+namespace is_function_ref_tester_ {
+
+template <class T>
+ndnboost::type_traits::no_type BOOST_TT_DECL is_function_ref_tester(T& ...);
+
+#if !defined(BOOST_TT_PREPROCESSING_MODE)
+// preprocessor-generated part, don't edit by hand!
+
+template <class R>
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(), int);
+
+template <class R,class T0 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0), int);
+
+template <class R,class T0,class T1 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1), int);
+
+template <class R,class T0,class T1,class T2 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2), int);
+
+template <class R,class T0,class T1,class T2,class T3 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23), int);
+
+template <class R,class T0,class T1,class T2,class T3,class T4,class T5,class T6,class T7,class T8,class T9,class T10,class T11,class T12,class T13,class T14,class T15,class T16,class T17,class T18,class T19,class T20,class T21,class T22,class T23,class T24 >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(T0,T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24), int);
+
+#else
+
+#define BOOST_PP_ITERATION_PARAMS_1 \
+ (3, (0, 25, "ndnboost/detail/is_function_ref_tester.hpp"))
+#include BOOST_PP_ITERATE()
+
+#endif // BOOST_TT_PREPROCESSING_MODE
+
+} // namespace detail
+} // namespace python
+} // namespace ndnboost
+
+#endif // BOOST_DETAIL_IS_FUNCTION_REF_TESTER_HPP_INCLUDED
+
+///// iteration
+
+#else
+#define i BOOST_PP_FRAME_ITERATION(1)
+
+template <class R BOOST_PP_COMMA_IF(i) BOOST_PP_ENUM_PARAMS(i,class T) >
+ndnboost::type_traits::yes_type is_function_ref_tester(R (&)(BOOST_PP_ENUM_PARAMS(i,T)), int);
+
+#undef i
+#endif // BOOST_PP_IS_ITERATING
+
diff --git a/ndnboost/detail/lcast_precision.hpp b/ndnboost/detail/lcast_precision.hpp
new file mode 100644
index 0000000..b763a83
--- /dev/null
+++ b/ndnboost/detail/lcast_precision.hpp
@@ -0,0 +1,184 @@
+// Copyright Alexander Nasonov & Paul A. Bristow 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)
+
+#ifndef BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED
+#define BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED
+
+#include <climits>
+#include <ios>
+#include <limits>
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/integer_traits.hpp>
+
+#ifndef BOOST_NO_IS_ABSTRACT
+// Fix for SF:1358600 - lexical_cast & pure virtual functions & VC 8 STL
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/type_traits/is_abstract.hpp>
+#endif
+
+#if defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || \
+ (defined(BOOST_MSVC) && (BOOST_MSVC<1310))
+
+#define BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+#endif
+
+#ifdef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+#include <ndnboost/assert.hpp>
+#else
+#include <ndnboost/static_assert.hpp>
+#endif
+
+namespace ndnboost { namespace detail {
+
+class lcast_abstract_stub {};
+
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+// Calculate an argument to pass to std::ios_base::precision from
+// lexical_cast. See alternative implementation for broken standard
+// libraries in lcast_get_precision below. Keep them in sync, please.
+template<class T>
+struct lcast_precision
+{
+#ifdef BOOST_NO_IS_ABSTRACT
+ typedef std::numeric_limits<T> limits; // No fix for SF:1358600.
+#else
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_<
+ ndnboost::is_abstract<T>
+ , std::numeric_limits<lcast_abstract_stub>
+ , std::numeric_limits<T>
+ >::type limits;
+#endif
+
+ BOOST_STATIC_CONSTANT(bool, use_default_precision =
+ !limits::is_specialized || limits::is_exact
+ );
+
+ BOOST_STATIC_CONSTANT(bool, is_specialized_bin =
+ !use_default_precision &&
+ limits::radix == 2 && limits::digits > 0
+ );
+
+ BOOST_STATIC_CONSTANT(bool, is_specialized_dec =
+ !use_default_precision &&
+ limits::radix == 10 && limits::digits10 > 0
+ );
+
+ BOOST_STATIC_CONSTANT(std::streamsize, streamsize_max =
+ ndnboost::integer_traits<std::streamsize>::const_max
+ );
+
+ BOOST_STATIC_CONSTANT(unsigned int, precision_dec = limits::digits10 + 1U);
+
+ BOOST_STATIC_ASSERT(!is_specialized_dec ||
+ precision_dec <= streamsize_max + 0UL
+ );
+
+ BOOST_STATIC_CONSTANT(unsigned long, precision_bin =
+ 2UL + limits::digits * 30103UL / 100000UL
+ );
+
+ BOOST_STATIC_ASSERT(!is_specialized_bin ||
+ (limits::digits + 0UL < ULONG_MAX / 30103UL &&
+ precision_bin > limits::digits10 + 0UL &&
+ precision_bin <= streamsize_max + 0UL)
+ );
+
+ BOOST_STATIC_CONSTANT(std::streamsize, value =
+ is_specialized_bin ? precision_bin
+ : is_specialized_dec ? precision_dec : 6
+ );
+};
+#endif
+
+template<class T>
+inline std::streamsize lcast_get_precision(T* = 0)
+{
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+ return lcast_precision<T>::value;
+#else // Follow lcast_precision algorithm at run-time:
+
+#ifdef BOOST_NO_IS_ABSTRACT
+ typedef std::numeric_limits<T> limits; // No fix for SF:1358600.
+#else
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_<
+ ndnboost::is_abstract<T>
+ , std::numeric_limits<lcast_abstract_stub>
+ , std::numeric_limits<T>
+ >::type limits;
+#endif
+
+ bool const use_default_precision =
+ !limits::is_specialized || limits::is_exact;
+
+ if(!use_default_precision)
+ { // Includes all built-in floating-point types, float, double ...
+ // and UDT types for which digits (significand bits) is defined (not zero)
+
+ bool const is_specialized_bin =
+ limits::radix == 2 && limits::digits > 0;
+ bool const is_specialized_dec =
+ limits::radix == 10 && limits::digits10 > 0;
+ std::streamsize const streamsize_max =
+ (ndnboost::integer_traits<std::streamsize>::max)();
+
+ if(is_specialized_bin)
+ { // Floating-point types with
+ // limits::digits defined by the specialization.
+
+ unsigned long const digits = limits::digits;
+ unsigned long const precision = 2UL + digits * 30103UL / 100000UL;
+ // unsigned long is selected because it is at least 32-bits
+ // and thus ULONG_MAX / 30103UL is big enough for all types.
+ BOOST_ASSERT(
+ digits < ULONG_MAX / 30103UL &&
+ precision > limits::digits10 + 0UL &&
+ precision <= streamsize_max + 0UL
+ );
+ return precision;
+ }
+ else if(is_specialized_dec)
+ { // Decimal Floating-point type, most likely a User Defined Type
+ // rather than a real floating-point hardware type.
+ unsigned int const precision = limits::digits10 + 1U;
+ BOOST_ASSERT(precision <= streamsize_max + 0UL);
+ return precision;
+ }
+ }
+
+ // Integral type (for which precision has no effect)
+ // or type T for which limits is NOT specialized,
+ // so assume stream precision remains the default 6 decimal digits.
+ // Warning: if your User-defined Floating-point type T is NOT specialized,
+ // then you may lose accuracy by only using 6 decimal digits.
+ // To avoid this, you need to specialize T with either
+ // radix == 2 and digits == the number of significand bits,
+ // OR
+ // radix = 10 and digits10 == the number of decimal digits.
+
+ return 6;
+#endif
+}
+
+template<class T>
+inline void lcast_set_precision(std::ios_base& stream, T*)
+{
+ stream.precision(lcast_get_precision<T>());
+}
+
+template<class Source, class Target>
+inline void lcast_set_precision(std::ios_base& stream, Source*, Target*)
+{
+ std::streamsize const s = lcast_get_precision(static_cast<Source*>(0));
+ std::streamsize const t = lcast_get_precision(static_cast<Target*>(0));
+ stream.precision(s > t ? s : t);
+}
+
+}}
+
+#endif // BOOST_DETAIL_LCAST_PRECISION_HPP_INCLUDED
+
diff --git a/ndnboost/detail/reference_content.hpp b/ndnboost/detail/reference_content.hpp
new file mode 100644
index 0000000..52d2c02
--- /dev/null
+++ b/ndnboost/detail/reference_content.hpp
@@ -0,0 +1,141 @@
+//-----------------------------------------------------------------------------
+// boost detail/reference_content.hpp header file
+// See http://www.boost.org for updates, documentation, and revision history.
+//-----------------------------------------------------------------------------
+//
+// Copyright (c) 2003
+// Eric Friedman
+//
+// 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)
+
+#ifndef BOOST_DETAIL_REFERENCE_CONTENT_HPP
+#define BOOST_DETAIL_REFERENCE_CONTENT_HPP
+
+#include "ndnboost/config.hpp"
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+# include "ndnboost/mpl/bool.hpp"
+# include "ndnboost/type_traits/has_nothrow_copy.hpp"
+#else
+# include "ndnboost/mpl/if.hpp"
+# include "ndnboost/type_traits/is_reference.hpp"
+#endif
+
+#include "ndnboost/mpl/void.hpp"
+
+namespace ndnboost {
+
+namespace detail {
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) class template reference_content
+//
+// Non-Assignable wrapper for references.
+//
+template <typename RefT>
+class reference_content
+{
+private: // representation
+
+ RefT content_;
+
+public: // structors
+
+ ~reference_content()
+ {
+ }
+
+ reference_content(RefT r)
+ : content_( r )
+ {
+ }
+
+ reference_content(const reference_content& operand)
+ : content_( operand.content_ )
+ {
+ }
+
+private: // non-Assignable
+
+ reference_content& operator=(const reference_content&);
+
+public: // queries
+
+ RefT get() const
+ {
+ return content_;
+ }
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
+// (detail) metafunction make_reference_content
+//
+// Wraps with reference_content if specified type is reference.
+//
+
+template <typename T = mpl::void_> struct make_reference_content;
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <typename T>
+struct make_reference_content
+{
+ typedef T type;
+};
+
+template <typename T>
+struct make_reference_content< T& >
+{
+ typedef reference_content<T&> type;
+};
+
+#else // defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <typename T>
+struct make_reference_content
+ : mpl::if_<
+ is_reference<T>
+ , reference_content<T>
+ , T
+ >
+{
+};
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION workaround
+
+template <>
+struct make_reference_content< mpl::void_ >
+{
+ template <typename T>
+ struct apply
+ : make_reference_content<T>
+ {
+ };
+
+ typedef mpl::void_ type;
+};
+
+} // namespace detail
+
+///////////////////////////////////////////////////////////////////////////////
+// reference_content<T&> type traits specializations
+//
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template <typename T>
+struct has_nothrow_copy<
+ ::ndnboost::detail::reference_content< T& >
+ >
+ : mpl::true_
+{
+};
+
+#endif // !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+} // namespace ndnboost
+
+#endif // BOOST_DETAIL_REFERENCE_CONTENT_HPP
diff --git a/ndnboost/detail/select_type.hpp b/ndnboost/detail/select_type.hpp
deleted file mode 100644
index 8e3cac7..0000000
--- a/ndnboost/detail/select_type.hpp
+++ /dev/null
@@ -1,36 +0,0 @@
-// (C) Copyright David Abrahams 2001.
-// 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)
-//
-// See http://www.boost.org for most recent version including documentation.
-
-// Revision History
-// 09 Feb 01 Applied John Maddock's Borland patch Moving <true>
-// specialization to unspecialized template (David Abrahams)
-// 06 Feb 01 Created (David Abrahams)
-
-#ifndef SELECT_TYPE_DWA20010206_HPP
-# define SELECT_TYPE_DWA20010206_HPP
-
-namespace ndnboost { namespace detail {
-
- // Template class if_true -- select among 2 types based on a bool constant expression
- // Usage:
- // typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
-
- // HP aCC cannot deal with missing names for template value parameters
- template <bool b> struct if_true
- {
- template <class T, class F>
- struct then { typedef T type; };
- };
-
- template <>
- struct if_true<false>
- {
- template <class T, class F>
- struct then { typedef F type; };
- };
-}}
-#endif // SELECT_TYPE_DWA20010206_HPP
diff --git a/ndnboost/detail/templated_streams.hpp b/ndnboost/detail/templated_streams.hpp
deleted file mode 100644
index b1159f8..0000000
--- a/ndnboost/detail/templated_streams.hpp
+++ /dev/null
@@ -1,74 +0,0 @@
-//-----------------------------------------------------------------------------
-// boost detail/templated_streams.hpp header file
-// See http://www.boost.org for updates, documentation, and revision history.
-//-----------------------------------------------------------------------------
-//
-// Copyright (c) 2003
-// Eric Friedman
-//
-// 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)
-
-#ifndef BOOST_DETAIL_TEMPLATED_STREAMS_HPP
-#define BOOST_DETAIL_TEMPLATED_STREAMS_HPP
-
-#include "ndnboost/config.hpp"
-
-///////////////////////////////////////////////////////////////////////////////
-// (detail) BOOST_TEMPLATED_STREAM_* macros
-//
-// Provides workaround platforms without stream class templates.
-//
-
-#if !defined(BOOST_NO_STD_LOCALE)
-
-#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) \
- template < typename E , typename T >
-
-#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) \
- template < typename E , typename T , typename A >
-
-#define BOOST_TEMPLATED_STREAM_ARGS(E,T) \
- typename E , typename T
-
-#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) \
- typename E , typename T , typename A
-
-#define BOOST_TEMPLATED_STREAM_COMMA ,
-
-#define BOOST_TEMPLATED_STREAM_ELEM(E) E
-#define BOOST_TEMPLATED_STREAM_TRAITS(T) T
-#define BOOST_TEMPLATED_STREAM_ALLOC(A) A
-
-#define BOOST_TEMPLATED_STREAM(X,E,T) \
- BOOST_JOIN(std::basic_,X)< E , T >
-
-#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
- BOOST_JOIN(std::basic_,X)< E , T , A >
-
-#else // defined(BOOST_NO_STD_LOCALE)
-
-#define BOOST_TEMPLATED_STREAM_TEMPLATE(E,T) /**/
-
-#define BOOST_TEMPLATED_STREAM_TEMPLATE_ALLOC(E,T,A) /**/
-
-#define BOOST_TEMPLATED_STREAM_ARGS(E,T) /**/
-
-#define BOOST_TEMPLATED_STREAM_ARGS_ALLOC(E,T,A) /**/
-
-#define BOOST_TEMPLATED_STREAM_COMMA /**/
-
-#define BOOST_TEMPLATED_STREAM_ELEM(E) char
-#define BOOST_TEMPLATED_STREAM_TRAITS(T) std::char_traits<char>
-#define BOOST_TEMPLATED_STREAM_ALLOC(A) std::allocator<char>
-
-#define BOOST_TEMPLATED_STREAM(X,E,T) \
- std::X
-
-#define BOOST_TEMPLATED_STREAM_WITH_ALLOC(X,E,T,A) \
- std::X
-
-#endif // BOOST_NO_STD_LOCALE
-
-#endif // BOOST_DETAIL_TEMPLATED_STREAMS_HPP
diff --git a/ndnboost/exception/current_exception_cast.hpp b/ndnboost/exception/current_exception_cast.hpp
new file mode 100644
index 0000000..f4da16b
--- /dev/null
+++ b/ndnboost/exception/current_exception_cast.hpp
@@ -0,0 +1,43 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
+
+//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)
+
+#ifndef UUID_7E83C166200811DE885E826156D89593
+#define UUID_7E83C166200811DE885E826156D89593
+#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
+
+namespace
+ndnboost
+ {
+ template <class E>
+ inline
+ E *
+ current_exception_cast()
+ {
+ try
+ {
+ throw;
+ }
+ catch(
+ E & e )
+ {
+ return &e;
+ }
+ catch(
+ ...)
+ {
+ return 0;
+ }
+ }
+ }
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/ndnboost/exception/detail/error_info_impl.hpp b/ndnboost/exception/detail/error_info_impl.hpp
new file mode 100644
index 0000000..9847814
--- /dev/null
+++ b/ndnboost/exception/detail/error_info_impl.hpp
@@ -0,0 +1,74 @@
+//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
+
+//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)
+
+#ifndef UUID_CE6983AC753411DDA764247956D89593
+#define UUID_CE6983AC753411DDA764247956D89593
+#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
+
+#include <string>
+
+namespace
+ndnboost
+ {
+ namespace
+ exception_detail
+ {
+ class
+ error_info_base
+ {
+ public:
+
+ virtual std::string name_value_string() const = 0;
+
+ protected:
+
+ virtual
+ ~error_info_base() throw()
+ {
+ }
+ };
+ }
+
+ template <class Tag,class T>
+ class
+ error_info:
+ public exception_detail::error_info_base
+ {
+ public:
+
+ typedef T value_type;
+
+ error_info( value_type const & value );
+ ~error_info() throw();
+
+ value_type const &
+ value() const
+ {
+ return value_;
+ }
+
+ value_type &
+ value()
+ {
+ return value_;
+ }
+
+ private:
+
+ std::string name_value_string() const;
+
+ value_type value_;
+ };
+ }
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/ndnboost/exception/detail/type_info.hpp b/ndnboost/exception/detail/type_info.hpp
new file mode 100644
index 0000000..d1c671f
--- /dev/null
+++ b/ndnboost/exception/detail/type_info.hpp
@@ -0,0 +1,83 @@
+//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
+
+//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)
+
+#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
+#define UUID_C3E1741C754311DDB2834CCA55D89593
+#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
+
+#include <ndnboost/detail/sp_typeinfo.hpp>
+#include <ndnboost/current_function.hpp>
+#include <ndnboost/config.hpp>
+#ifndef BOOST_NO_TYPEID
+#include <ndnboost/units/detail/utility.hpp>
+#endif
+#include <string>
+
+namespace
+ndnboost
+ {
+ template <class T>
+ inline
+ std::string
+ tag_type_name()
+ {
+#ifdef BOOST_NO_TYPEID
+ return BOOST_CURRENT_FUNCTION;
+#else
+ return units::detail::demangle(typeid(T*).name());
+#endif
+ }
+
+ template <class T>
+ inline
+ std::string
+ type_name()
+ {
+#ifdef BOOST_NO_TYPEID
+ return BOOST_CURRENT_FUNCTION;
+#else
+ return units::detail::demangle(typeid(T).name());
+#endif
+ }
+
+ namespace
+ exception_detail
+ {
+ struct
+ type_info_
+ {
+ detail::sp_typeinfo const * type_;
+
+ explicit
+ type_info_( detail::sp_typeinfo const & type ):
+ type_(&type)
+ {
+ }
+
+ friend
+ bool
+ operator<( type_info_ const & a, type_info_ const & b )
+ {
+ return 0!=(a.type_->before(*b.type_));
+ }
+ };
+ }
+ }
+
+#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::ndnboost::exception_detail::type_info_(BOOST_SP_TYPEID(T))
+
+#ifndef BOOST_NO_RTTI
+#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::ndnboost::exception_detail::type_info_(typeid(x))
+#endif
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/ndnboost/exception/get_error_info.hpp b/ndnboost/exception/get_error_info.hpp
new file mode 100644
index 0000000..9a798ed
--- /dev/null
+++ b/ndnboost/exception/get_error_info.hpp
@@ -0,0 +1,130 @@
+//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
+
+//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)
+
+#ifndef UUID_1A590226753311DD9E4CCF6156D89593
+#define UUID_1A590226753311DD9E4CCF6156D89593
+#if (__GNUC__*100+__GNUC_MINOR__>301) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma GCC system_header
+#endif
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(push,1)
+#endif
+
+#include <ndnboost/exception/exception.hpp>
+#include <ndnboost/exception/detail/error_info_impl.hpp>
+#include <ndnboost/exception/detail/type_info.hpp>
+#include <ndnboost/shared_ptr.hpp>
+
+namespace
+ndnboost
+ {
+ namespace
+ exception_detail
+ {
+ template <class ErrorInfo>
+ struct
+ get_info
+ {
+ static
+ typename ErrorInfo::value_type *
+ get( exception const & x )
+ {
+ if( exception_detail::error_info_container * c=x.data_.get() )
+ if( shared_ptr<exception_detail::error_info_base> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
+ {
+#ifndef BOOST_NO_RTTI
+ BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo *>(eib.get()) );
+#endif
+ ErrorInfo * w = static_cast<ErrorInfo *>(eib.get());
+ return &w->value();
+ }
+ return 0;
+ }
+ };
+
+ template <>
+ struct
+ get_info<throw_function>
+ {
+ static
+ char const * *
+ get( exception const & x )
+ {
+ return x.throw_function_ ? &x.throw_function_ : 0;
+ }
+ };
+
+ template <>
+ struct
+ get_info<throw_file>
+ {
+ static
+ char const * *
+ get( exception const & x )
+ {
+ return x.throw_file_ ? &x.throw_file_ : 0;
+ }
+ };
+
+ template <>
+ struct
+ get_info<throw_line>
+ {
+ static
+ int *
+ get( exception const & x )
+ {
+ return x.throw_line_!=-1 ? &x.throw_line_ : 0;
+ }
+ };
+
+ template <class T,class R>
+ struct
+ get_error_info_return_type
+ {
+ typedef R * type;
+ };
+
+ template <class T,class R>
+ struct
+ get_error_info_return_type<T const,R>
+ {
+ typedef R const * type;
+ };
+ }
+
+#ifdef BOOST_NO_RTTI
+ template <class ErrorInfo>
+ inline
+ typename ErrorInfo::value_type const *
+ get_error_info( ndnboost::exception const & x )
+ {
+ return exception_detail::get_info<ErrorInfo>::get(x);
+ }
+ template <class ErrorInfo>
+ inline
+ typename ErrorInfo::value_type *
+ get_error_info( ndnboost::exception & x )
+ {
+ return exception_detail::get_info<ErrorInfo>::get(x);
+ }
+#else
+ template <class ErrorInfo,class E>
+ inline
+ typename exception_detail::get_error_info_return_type<E,typename ErrorInfo::value_type>::type
+ get_error_info( E & some_exception )
+ {
+ if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
+ return exception_detail::get_info<ErrorInfo>::get(*x);
+ else
+ return 0;
+ }
+#endif
+ }
+
+#if defined(_MSC_VER) && !defined(BOOST_EXCEPTION_ENABLE_WARNINGS)
+#pragma warning(pop)
+#endif
+#endif
diff --git a/ndnboost/function/function_typeof.hpp b/ndnboost/function/function_typeof.hpp
new file mode 100644
index 0000000..e3d26c5
--- /dev/null
+++ b/ndnboost/function/function_typeof.hpp
@@ -0,0 +1,45 @@
+// Boost.Function library - Typeof support
+// Copyright (C) Douglas Gregor 2008
+//
+// 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
+#ifndef BOOST_FUNCTION_TYPEOF_HPP
+#define BOOST_FUNCTION_TYPEOF_HPP
+#include <ndnboost/function/function_fwd.hpp>
+#include <ndnboost/typeof/typeof.hpp>
+
+#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
+
+BOOST_TYPEOF_REGISTER_TYPE(ndnboost::bad_function_call)
+
+#if !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function, (typename))
+#endif
+
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function0, (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function1, (typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function2, (typename)(typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function3,
+ (typename)(typename)(typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function4,
+ (typename)(typename)(typename)(typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function5,
+ (typename)(typename)(typename)(typename)(typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function6,
+ (typename)(typename)(typename)(typename)(typename)(typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function7,
+ (typename)(typename)(typename)(typename)(typename)(typename)(typename)
+ (typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function8,
+ (typename)(typename)(typename)(typename)(typename)(typename)(typename)
+ (typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function9,
+ (typename)(typename)(typename)(typename)(typename)(typename)(typename)
+ (typename)(typename)(typename))
+BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::function10,
+ (typename)(typename)(typename)(typename)(typename)(typename)(typename)
+ (typename)(typename)(typename)(typename))
+#endif
diff --git a/ndnboost/function/gen_function_N.pl b/ndnboost/function/gen_function_N.pl
new file mode 100644
index 0000000..7fc53c9
--- /dev/null
+++ b/ndnboost/function/gen_function_N.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl -w
+#
+# Boost.Function library
+#
+# Copyright Douglas Gregor 2001-2003. 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
+use English;
+
+if ($#ARGV < 0) {
+ print "Usage: perl gen_function_N <number of arguments>\n";
+ exit;
+}
+
+
+$totalNumArgs = $ARGV[0];
+for ($numArgs = 0; $numArgs <= $totalNumArgs; ++$numArgs) {
+ open OUT, ">function$numArgs.hpp";
+ print OUT "#define BOOST_FUNCTION_NUM_ARGS $numArgs\n";
+ print OUT "#include <ndnboost/function/detail/maybe_include.hpp>\n";
+ print OUT "#undef BOOST_FUNCTION_NUM_ARGS\n";
+ close OUT;
+}
diff --git a/ndnboost/functional/factory.hpp b/ndnboost/functional/factory.hpp
deleted file mode 100644
index 161465d..0000000
--- a/ndnboost/functional/factory.hpp
+++ /dev/null
@@ -1,163 +0,0 @@
-/*=============================================================================
- Copyright (c) 2007 Tobias Schwinger
-
- 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_FUNCTIONAL_FACTORY_HPP_INCLUDED
-# ifndef BOOST_PP_IS_ITERATING
-
-# include <ndnboost/preprocessor/iteration/iterate.hpp>
-# include <ndnboost/preprocessor/repetition/enum_params.hpp>
-# include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
-
-# include <new>
-# include <ndnboost/pointee.hpp>
-# include <ndnboost/none_t.hpp>
-# include <ndnboost/get_pointer.hpp>
-# include <ndnboost/non_type.hpp>
-# include <ndnboost/type_traits/remove_cv.hpp>
-
-# ifndef BOOST_FUNCTIONAL_FACTORY_MAX_ARITY
-# define BOOST_FUNCTIONAL_FACTORY_MAX_ARITY 10
-# elif BOOST_FUNCTIONAL_FACTORY_MAX_ARITY < 3
-# undef BOOST_FUNCTIONAL_FACTORY_MAX_ARITY
-# define BOOST_FUNCTIONAL_FACTORY_MAX_ARITY 3
-# endif
-
-namespace ndnboost
-{
- enum factory_alloc_propagation
- {
- factory_alloc_for_pointee_and_deleter,
- factory_passes_alloc_to_smart_pointer
- };
-
- template< typename Pointer, class Allocator = ndnboost::none_t,
- factory_alloc_propagation AP = factory_alloc_for_pointee_and_deleter >
- class factory;
-
- //----- ---- --- -- - - - -
-
- template< typename Pointer, factory_alloc_propagation AP >
- class factory<Pointer, ndnboost::none_t, AP>
- {
- public:
- typedef typename ndnboost::remove_cv<Pointer>::type result_type;
- typedef typename ndnboost::pointee<result_type>::type value_type;
-
- factory()
- { }
-
-# define BOOST_PP_FILENAME_1 <ndnboost/functional/factory.hpp>
-# define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUNCTIONAL_FACTORY_MAX_ARITY)
-# include BOOST_PP_ITERATE()
- };
-
- template< class Pointer, class Allocator, factory_alloc_propagation AP >
- class factory
- : private Allocator::template rebind< typename ndnboost::pointee<
- typename ndnboost::remove_cv<Pointer>::type >::type >::other
- {
- public:
- typedef typename ndnboost::remove_cv<Pointer>::type result_type;
- typedef typename ndnboost::pointee<result_type>::type value_type;
-
- typedef typename Allocator::template rebind<value_type>::other
- allocator_type;
-
- explicit factory(allocator_type const & a = allocator_type())
- : allocator_type(a)
- { }
-
- private:
-
- struct deleter
- : allocator_type
- {
- inline deleter(allocator_type const& that)
- : allocator_type(that)
- { }
-
- allocator_type& get_allocator() const
- {
- return *const_cast<allocator_type*>(
- static_cast<allocator_type const*>(this));
- }
-
- void operator()(value_type* ptr) const
- {
- if (!! ptr) ptr->~value_type();
- const_cast<allocator_type*>(static_cast<allocator_type const*>(
- this))->deallocate(ptr,1);
- }
- };
-
- inline allocator_type& get_allocator() const
- {
- return *const_cast<allocator_type*>(
- static_cast<allocator_type const*>(this));
- }
-
- inline result_type make_pointer(value_type* ptr, ndnboost::non_type<
- factory_alloc_propagation,factory_passes_alloc_to_smart_pointer>)
- const
- {
- return result_type(ptr,deleter(this->get_allocator()));
- }
- inline result_type make_pointer(value_type* ptr, ndnboost::non_type<
- factory_alloc_propagation,factory_alloc_for_pointee_and_deleter>)
- const
- {
- return result_type(ptr,deleter(this->get_allocator()),
- this->get_allocator());
- }
-
- public:
-
-# define BOOST_TMP_MACRO
-# define BOOST_PP_FILENAME_1 <ndnboost/functional/factory.hpp>
-# define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUNCTIONAL_FACTORY_MAX_ARITY)
-# include BOOST_PP_ITERATE()
-# undef BOOST_TMP_MACRO
- };
-
- template< typename Pointer, class Allocator, factory_alloc_propagation AP >
- class factory<Pointer&, Allocator, AP>;
- // forbidden, would create a dangling reference
-}
-
-# define BOOST_FUNCTIONAL_FACTORY_HPP_INCLUDED
-# else // defined(BOOST_PP_IS_ITERATING)
-# define N BOOST_PP_ITERATION()
-# if !defined(BOOST_TMP_MACRO)
-# if N > 0
- template< BOOST_PP_ENUM_PARAMS(N, typename T) >
-# endif
- inline result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const
- {
- return result_type( new value_type(BOOST_PP_ENUM_PARAMS(N,a)) );
- }
-# else // defined(BOOST_TMP_MACRO)
-# if N > 0
- template< BOOST_PP_ENUM_PARAMS(N, typename T) >
-# endif
- inline result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const
- {
- value_type* memory = this->get_allocator().allocate(1);
- try
- {
- return make_pointer(
- new(memory) value_type(BOOST_PP_ENUM_PARAMS(N,a)),
- ndnboost::non_type<factory_alloc_propagation,AP>() );
- }
- catch (...) { this->get_allocator().deallocate(memory,1); throw; }
- }
-# endif
-# undef N
-# endif // defined(BOOST_PP_IS_ITERATING)
-
-#endif // include guard
-
diff --git a/ndnboost/functional/forward_adapter.hpp b/ndnboost/functional/forward_adapter.hpp
deleted file mode 100644
index 2bb5623..0000000
--- a/ndnboost/functional/forward_adapter.hpp
+++ /dev/null
@@ -1,472 +0,0 @@
-/*=============================================================================
- Copyright (c) 2007-2008 Tobias Schwinger
-
- 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_FUNCTIONAL_FORWARD_ADAPTER_HPP_INCLUDED
-# ifndef BOOST_PP_IS_ITERATING
-
-# include <ndnboost/config.hpp>
-# include <ndnboost/detail/workaround.hpp>
-
-# include <ndnboost/preprocessor/iteration/iterate.hpp>
-# include <ndnboost/preprocessor/repetition/enum_params.hpp>
-# include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
-# include <ndnboost/preprocessor/facilities/intercept.hpp>
-# include <ndnboost/preprocessor/arithmetic/dec.hpp>
-
-# include <ndnboost/utility/result_of.hpp>
-
-# ifndef BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY
-# define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 6
-# elif BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY < 3
-# undef BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY
-# define BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY 3
-# endif
-
-
-namespace ndnboost
-{
- template< typename Function, int Arity_Or_MinArity = -1, int MaxArity = -1 >
- class forward_adapter;
-
- //----- ---- --- -- - - - -
-
- namespace detail
- {
- template< class MostDerived, typename Function, typename FunctionConst,
- int Arity, int MinArity >
- struct forward_adapter_impl;
-
- struct forward_adapter_result
- {
- template< typename Sig > struct apply;
-
- // Utility metafunction for qualification adjustment on arguments
- template< typename T > struct q { typedef T const t; };
- template< typename T > struct q<T const> { typedef T const t; };
- template< typename T > struct q<T &> { typedef T t; };
-
- // Utility metafunction to choose target function qualification
- template< typename T > struct c
- { typedef typename T::target_function_t t; };
- template< typename T > struct c<T& >
- { typedef typename T::target_function_t t; };
- template< typename T > struct c<T const >
- { typedef typename T::target_function_const_t t; };
- template< typename T > struct c<T const&>
- { typedef typename T::target_function_const_t t; };
- };
- }
-
-# define BOOST_TMP_MACRO(f,fn,fc) \
- ndnboost::detail::forward_adapter_impl< \
- forward_adapter<f,Arity_Or_MinArity,MaxArity>, fn, fc, \
- (MaxArity!=-1? MaxArity :Arity_Or_MinArity!=-1? Arity_Or_MinArity \
- :BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY), \
- (Arity_Or_MinArity!=-1? Arity_Or_MinArity : 0) >
-
- template< typename Function, int Arity_Or_MinArity, int MaxArity >
- class forward_adapter
- : public BOOST_TMP_MACRO(Function,Function,Function const)
- , private Function
- {
- public:
- forward_adapter(Function const& f = Function())
- : Function(f)
- { }
-
- typedef Function target_function_t;
- typedef Function const target_function_const_t;
-
- Function & target_function() { return *this; }
- Function const & target_function() const { return *this; }
-
- template< typename Sig > struct result
- : detail::forward_adapter_result::template apply<Sig>
- { };
-
- using BOOST_TMP_MACRO(Function,Function, Function const)::operator();
- };
- template< typename Function, int Arity_Or_MinArity, int MaxArity >
- class forward_adapter< Function const, Arity_Or_MinArity, MaxArity >
- : public BOOST_TMP_MACRO(Function const, Function const, Function const)
- , private Function
- {
- public:
- forward_adapter(Function const& f = Function())
- : Function(f)
- { }
-
- typedef Function const target_function_t;
- typedef Function const target_function_const_t;
-
- Function const & target_function() const { return *this; }
-
- template< typename Sig > struct result
- : detail::forward_adapter_result::template apply<Sig>
- { };
-
- using BOOST_TMP_MACRO(Function const,Function const, Function const)
- ::operator();
- };
- template< typename Function, int Arity_Or_MinArity, int MaxArity >
- class forward_adapter< Function &, Arity_Or_MinArity, MaxArity >
- : public BOOST_TMP_MACRO(Function&, Function, Function)
- {
- Function& ref_function;
- public:
- forward_adapter(Function& f)
- : ref_function(f)
- { }
-
- typedef Function target_function_t;
- typedef Function target_function_const_t;
-
- Function & target_function() const { return this->ref_function; }
-
- template< typename Sig > struct result
- : detail::forward_adapter_result::template apply<Sig>
- { };
-
- using BOOST_TMP_MACRO(Function&, Function, Function)::operator();
- };
-
- #undef BOOST_TMP_MACRO
-
- namespace detail
- {
- template< class Self >
- struct forward_adapter_result::apply< Self() >
- : ndnboost::result_of< BOOST_DEDUCED_TYPENAME c<Self>::t() >
- { };
-
- template< class MD, class F, class FC >
- struct forward_adapter_impl<MD,F,FC,0,0>
- {
- inline typename ndnboost::result_of< FC() >::type
- operator()() const
- {
- return static_cast<MD const*>(this)->target_function()();
- }
-
- inline typename ndnboost::result_of< F() >::type
- operator()()
- {
- return static_cast<MD*>(this)->target_function()();
- }
-
- // closing brace gets generated by preprocessing code, below
-
-# define BOOST_TMP_MACRO(tpl_params,arg_types,params,args) \
- template< tpl_params > \
- inline typename ndnboost::result_of< FC(arg_types) >::type \
- operator()(params) const \
- { \
- return static_cast<MD const*>(this)->target_function()(args); \
- } \
- template< tpl_params > \
- inline typename ndnboost::result_of< F(arg_types)>::type \
- operator()(params) \
- { \
- return static_cast<MD*>(this)->target_function()(args); \
- }
-
-# // This is the total number of iterations we need
-# define count ((1 << BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY+1)-2)
-
-# // Chain file iteration to virtually one loop
-# if BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY <= 7
-# define limit1 count
-# define limit2 0
-# define limit3 0
-# else
-# if BOOST_FUNCTIONAL_FORWARD_ADAPTER_MAX_ARITY <= 15
-# define limit1 (count >> 8)
-# define limit2 255
-# define limit3 0
-# else
-# define limit1 (count >> 16)
-# define limit2 255
-# define limit3 255
-# endif
-# endif
-
-# define N 0
-
-# define BOOST_PP_FILENAME_1 <ndnboost/functional/forward_adapter.hpp>
-# define BOOST_PP_ITERATION_LIMITS (0,limit1)
-# include BOOST_PP_ITERATE()
-
-# undef N
-# undef limit3
-# undef limit2
-# undef limit1
-# undef count
-# undef BOOST_TMP_MACRO
-
- };
-
- } // namespace detail
-
- template<class F, int A0, int A1>
- struct result_of<ndnboost::forward_adapter<F,A0,A1> const ()>
- : ndnboost::detail::forward_adapter_result::template apply<
- ndnboost::forward_adapter<F,A0,A1> const () >
- { };
- template<class F, int A0, int A1>
- struct result_of<ndnboost::forward_adapter<F,A0,A1>()>
- : ndnboost::detail::forward_adapter_result::template apply<
- ndnboost::forward_adapter<F,A0,A1>() >
- { };
- template<class F, int A0, int A1>
- struct result_of<ndnboost::forward_adapter<F,A0,A1> const& ()>
- : ndnboost::detail::forward_adapter_result::template apply<
- ndnboost::forward_adapter<F,A0,A1> const () >
- { };
- template<class F, int A0, int A1>
- struct result_of<ndnboost::forward_adapter<F,A0,A1>& ()>
- : ndnboost::detail::forward_adapter_result::template apply<
- ndnboost::forward_adapter<F,A0,A1>() >
- { };
-}
-
-# define BOOST_FUNCTIONAL_FORWARD_ADAPTER_HPP_INCLUDED
-
-# elif BOOST_PP_ITERATION_DEPTH() == 1 && limit2
-# define BOOST_PP_FILENAME_2 <ndnboost/functional/forward_adapter.hpp>
-# define BOOST_PP_ITERATION_LIMITS (0,limit2)
-# include BOOST_PP_ITERATE()
-# elif BOOST_PP_ITERATION_DEPTH() == 2 && limit3
-# define BOOST_PP_FILENAME_3 <ndnboost/functional/forward_adapter.hpp>
-# define BOOST_PP_ITERATION_LIMITS (0,limit3)
-# include BOOST_PP_ITERATE()
-
-# else
-
-# // I is the loop counter
-# if limit2 && limit3
-# define I (BOOST_PP_ITERATION_1 << 16 | BOOST_PP_ITERATION_2 << 8 | \
- BOOST_PP_ITERATION_3)
-# elif limit2
-# define I (BOOST_PP_ITERATION_1 << 8 | BOOST_PP_ITERATION_2)
-# else
-# define I BOOST_PP_ITERATION_1
-# endif
-
-# if I < count
-
-# // Done for this arity? Increment N
-# if (I+2 >> N+1)
-# if N == 0
-# undef N
-# define N 1
-# elif N == 1
-# undef N
-# define N 2
-# elif N == 2
-# undef N
-# define N 3
-# elif N == 3
-# undef N
-# define N 4
-# elif N == 4
-# undef N
-# define N 5
-# elif N == 5
-# undef N
-# define N 6
-# elif N == 6
-# undef N
-# define N 7
-# elif N == 7
-# undef N
-# define N 8
-# elif N == 8
-# undef N
-# define N 9
-# elif N == 9
-# undef N
-# define N 10
-# elif N == 10
-# undef N
-# define N 11
-# elif N == 11
-# undef N
-# define N 12
-# elif N == 12
-# undef N
-# define N 13
-# elif N == 13
-# undef N
-# define N 14
-# elif N == 14
-# undef N
-# define N 15
-# elif N == 15
-# undef N
-# define N 16
-# endif
-
- };
-
- template< class Self, BOOST_PP_ENUM_PARAMS(N,typename T) >
- struct forward_adapter_result::apply< Self(BOOST_PP_ENUM_PARAMS(N,T)) >
- : ndnboost::result_of<
- BOOST_DEDUCED_TYPENAME c<Self>::t(BOOST_PP_ENUM_BINARY_PARAMS(N,
- typename q<T,>::t& BOOST_PP_INTERCEPT)) >
- { };
-
- template< class MD, class F, class FC >
- struct forward_adapter_impl<MD,F,FC,BOOST_PP_DEC(N),N>
- {
- template< BOOST_PP_ENUM_PARAMS(N,typename T) >
- inline typename ndnboost::result_of< F(
- BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT)) >::type
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT));
- };
-
- template< class MD, class F, class FC, int MinArity >
- struct forward_adapter_impl<MD,F,FC,N,MinArity>
- : forward_adapter_impl<MD,F,FC,BOOST_PP_DEC(N),MinArity>
- {
- using forward_adapter_impl<MD,F,FC,BOOST_PP_DEC(N),MinArity>::operator();
-
-# endif
-
-# // Zero based count for each arity would be I-(1<<N)+2, but we don't
-# // need it, unless we need a nicer order.
-
-# // Macros for the parameter's type modifiers.
-# if I & 0x000001
-# define PT0 T0 &
-# else
-# define PT0 T0 const &
-# endif
-# if I & 0x000002
-# define PT1 T1 &
-# else
-# define PT1 T1 const &
-# endif
-# if I & 0x000004
-# define PT2 T2 &
-# else
-# define PT2 T2 const &
-# endif
-# if I & 0x000008
-# define PT3 T3 &
-# else
-# define PT3 T3 const &
-# endif
-# if I & 0x000010
-# define PT4 T4 &
-# else
-# define PT4 T4 const &
-# endif
-# if I & 0x000020
-# define PT5 T5 &
-# else
-# define PT5 T5 const &
-# endif
-# if I & 0x000040
-# define PT6 T6 &
-# else
-# define PT6 T6 const &
-# endif
-# if I & 0x000080
-# define PT7 T7 &
-# else
-# define PT7 T7 const &
-# endif
-# if I & 0x000100
-# define PT8 T8 &
-# else
-# define PT8 T8 const &
-# endif
-# if I & 0x000200
-# define PT9 T9 &
-# else
-# define PT9 T9 const &
-# endif
-# if I & 0x000400
-# define PT10 T10 &
-# else
-# define PT10 T10 const &
-# endif
-# if I & 0x000800
-# define PT11 T11 &
-# else
-# define PT11 T11 const &
-# endif
-# if I & 0x001000
-# define PT12 T12 &
-# else
-# define PT12 T12 const &
-# endif
-# if I & 0x002000
-# define PT13 T13 &
-# else
-# define PT13 T13 const &
-# endif
-# if I & 0x004000
-# define PT14 T14 &
-# else
-# define PT14 T14 const &
-# endif
-# if I & 0x008000
-# define PT15 T15 &
-# else
-# define PT15 T15 const &
-# endif
-
-# if BOOST_WORKAROUND(BOOST_MSVC,BOOST_TESTED_AT(1400))
- template< BOOST_PP_ENUM_PARAMS(N,typename T) >
- inline typename ndnboost::result_of< FC(BOOST_PP_ENUM_PARAMS(N,PT))
- >::type
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a)) const
- {
- return static_cast<MD const* const>(this)
- ->target_function()(BOOST_PP_ENUM_PARAMS(N,a));
- }
- template< BOOST_PP_ENUM_PARAMS(N,typename T) >
- inline typename ndnboost::result_of< F(BOOST_PP_ENUM_PARAMS(N,PT))
- >::type
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a))
- {
- return static_cast<MD* const>(this)
- ->target_function()(BOOST_PP_ENUM_PARAMS(N,a));
- }
-# else
- BOOST_TMP_MACRO(BOOST_PP_ENUM_PARAMS(N,typename T),
- BOOST_PP_ENUM_PARAMS(N,PT), BOOST_PP_ENUM_BINARY_PARAMS(N,PT,a),
- BOOST_PP_ENUM_PARAMS(N,a) )
- // ...generates uglier code but is faster - it caches ENUM_*
-# endif
-
-# undef PT0
-# undef PT1
-# undef PT2
-# undef PT3
-# undef PT4
-# undef PT5
-# undef PT6
-# undef PT7
-# undef PT8
-# undef PT9
-# undef PT10
-# undef PT11
-# undef PT12
-# undef PT13
-# undef PT14
-# undef PT15
-
-# endif // I < count
-
-# undef I
-# endif // defined(BOOST_PP_IS_ITERATING)
-
-#endif // include guard
-
diff --git a/ndnboost/functional/hash.hpp b/ndnboost/functional/hash.hpp
deleted file mode 100644
index bcc68bc..0000000
--- a/ndnboost/functional/hash.hpp
+++ /dev/null
@@ -1,7 +0,0 @@
-
-// Copyright 2005-2009 Daniel James.
-// 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)
-
-#include <ndnboost/functional/hash/hash.hpp>
-
diff --git a/ndnboost/functional/hash/detail/float_functions.hpp b/ndnboost/functional/hash/detail/float_functions.hpp
deleted file mode 100644
index 5a6dce4..0000000
--- a/ndnboost/functional/hash/detail/float_functions.hpp
+++ /dev/null
@@ -1,336 +0,0 @@
-
-// Copyright 2005-2009 Daniel James.
-// 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)
-
-#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP)
-#define BOOST_FUNCTIONAL_HASH_DETAIL_FLOAT_FUNCTIONS_HPP
-
-#include <ndnboost/config.hpp>
-#include <ndnboost/config/no_tr1/cmath.hpp>
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-// Set BOOST_HASH_CONFORMANT_FLOATS to 1 for libraries known to have
-// sufficiently good floating point support to not require any
-// workarounds.
-//
-// When set to 0, the library tries to automatically
-// use the best available implementation. This normally works well, but
-// breaks when ambiguities are created by odd namespacing of the functions.
-//
-// Note that if this is set to 0, the library should still take full
-// advantage of the platform's floating point support.
-
-#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#elif defined(__LIBCOMO__)
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER)
-// Rogue Wave library:
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#elif defined(_LIBCPP_VERSION)
-// libc++
-# define BOOST_HASH_CONFORMANT_FLOATS 1
-#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
-// GNU libstdc++ 3
-# if defined(__GNUC__) && __GNUC__ >= 4
-# define BOOST_HASH_CONFORMANT_FLOATS 1
-# else
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-# endif
-#elif defined(__STL_CONFIG_H)
-// generic SGI STL
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#elif defined(__MSL_CPP__)
-// MSL standard lib:
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#elif defined(__IBMCPP__)
-// VACPP std lib (probably conformant for much earlier version).
-# if __IBMCPP__ >= 1210
-# define BOOST_HASH_CONFORMANT_FLOATS 1
-# else
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-# endif
-#elif defined(MSIPL_COMPILE_H)
-// Modena C++ standard library
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER)
-// Dinkumware Library (this has to appear after any possible replacement libraries):
-# if _CPPLIB_VER >= 405
-# define BOOST_HASH_CONFORMANT_FLOATS 1
-# else
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-# endif
-#else
-# define BOOST_HASH_CONFORMANT_FLOATS 0
-#endif
-
-#if BOOST_HASH_CONFORMANT_FLOATS
-
-// The standard library is known to be compliant, so don't use the
-// configuration mechanism.
-
-namespace ndnboost {
- namespace hash_detail {
- template <typename Float>
- struct call_ldexp {
- typedef Float float_type;
- inline Float operator()(Float x, int y) const {
- return std::ldexp(x, y);
- }
- };
-
- template <typename Float>
- struct call_frexp {
- typedef Float float_type;
- inline Float operator()(Float x, int* y) const {
- return std::frexp(x, y);
- }
- };
-
- template <typename Float>
- struct select_hash_type
- {
- typedef Float type;
- };
- }
-}
-
-#else // BOOST_HASH_CONFORMANT_FLOATS == 0
-
-// The C++ standard requires that the C float functions are overloarded
-// for float, double and long double in the std namespace, but some of the older
-// library implementations don't support this. On some that don't, the C99
-// float functions (frexpf, frexpl, etc.) are available.
-//
-// The following tries to automatically detect which are available.
-
-namespace ndnboost {
- namespace hash_detail {
-
- // Returned by dummy versions of the float functions.
-
- struct not_found {
- // Implicitly convertible to float and long double in order to avoid
- // a compile error when the dummy float functions are used.
-
- inline operator float() const { return 0; }
- inline operator long double() const { return 0; }
- };
-
- // A type for detecting the return type of functions.
-
- template <typename T> struct is;
- template <> struct is<float> { char x[10]; };
- template <> struct is<double> { char x[20]; };
- template <> struct is<long double> { char x[30]; };
- template <> struct is<ndnboost::hash_detail::not_found> { char x[40]; };
-
- // Used to convert the return type of a function to a type for sizeof.
-
- template <typename T> is<T> float_type(T);
-
- // call_ldexp
- //
- // This will get specialized for float and long double
-
- template <typename Float> struct call_ldexp
- {
- typedef double float_type;
-
- inline double operator()(double a, int b) const
- {
- using namespace std;
- return ldexp(a, b);
- }
- };
-
- // call_frexp
- //
- // This will get specialized for float and long double
-
- template <typename Float> struct call_frexp
- {
- typedef double float_type;
-
- inline double operator()(double a, int* b) const
- {
- using namespace std;
- return frexp(a, b);
- }
- };
- }
-}
-
-// A namespace for dummy functions to detect when the actual function we want
-// isn't available. ldexpl, ldexpf etc. might be added tby the macros below.
-//
-// AFAICT these have to be outside of the boost namespace, as if they're in
-// the boost namespace they'll always be preferable to any other function
-// (since the arguments are built in types, ADL can't be used).
-
-namespace ndnboost_hash_detect_float_functions {
- template <class Float> ndnboost::hash_detail::not_found ldexp(Float, int);
- template <class Float> ndnboost::hash_detail::not_found frexp(Float, int*);
-}
-
-// Macros for generating specializations of call_ldexp and call_frexp.
-//
-// check_cpp and check_c99 check if the C++ or C99 functions are available.
-//
-// Then the call_* functions select an appropriate implementation.
-//
-// I used c99_func in a few places just to get a unique name.
-//
-// Important: when using 'using namespace' at namespace level, include as
-// little as possible in that namespace, as Visual C++ has an odd bug which
-// can cause the namespace to be imported at the global level. This seems to
-// happen mainly when there's a template in the same namesapce.
-
-#define BOOST_HASH_CALL_FLOAT_FUNC(cpp_func, c99_func, type1, type2) \
-namespace ndnboost_hash_detect_float_functions { \
- template <class Float> \
- ndnboost::hash_detail::not_found c99_func(Float, type2); \
-} \
- \
-namespace ndnboost { \
- namespace hash_detail { \
- namespace c99_func##_detect { \
- using namespace std; \
- using namespace ndnboost_hash_detect_float_functions; \
- \
- struct check { \
- static type1 x; \
- static type2 y; \
- BOOST_STATIC_CONSTANT(bool, cpp = \
- sizeof(float_type(cpp_func(x,y))) \
- == sizeof(is<type1>)); \
- BOOST_STATIC_CONSTANT(bool, c99 = \
- sizeof(float_type(c99_func(x,y))) \
- == sizeof(is<type1>)); \
- }; \
- } \
- \
- template <bool x> \
- struct call_c99_##c99_func : \
- ndnboost::hash_detail::call_##cpp_func<double> {}; \
- \
- template <> \
- struct call_c99_##c99_func<true> { \
- typedef type1 float_type; \
- \
- template <typename T> \
- inline type1 operator()(type1 a, T b) const \
- { \
- using namespace std; \
- return c99_func(a, b); \
- } \
- }; \
- \
- template <bool x> \
- struct call_cpp_##c99_func : \
- call_c99_##c99_func< \
- ::ndnboost::hash_detail::c99_func##_detect::check::c99 \
- > {}; \
- \
- template <> \
- struct call_cpp_##c99_func<true> { \
- typedef type1 float_type; \
- \
- template <typename T> \
- inline type1 operator()(type1 a, T b) const \
- { \
- using namespace std; \
- return cpp_func(a, b); \
- } \
- }; \
- \
- template <> \
- struct call_##cpp_func<type1> : \
- call_cpp_##c99_func< \
- ::ndnboost::hash_detail::c99_func##_detect::check::cpp \
- > {}; \
- } \
-}
-
-#define BOOST_HASH_CALL_FLOAT_MACRO(cpp_func, c99_func, type1, type2) \
-namespace ndnboost { \
- namespace hash_detail { \
- \
- template <> \
- struct call_##cpp_func<type1> { \
- typedef type1 float_type; \
- inline type1 operator()(type1 x, type2 y) const { \
- return c99_func(x, y); \
- } \
- }; \
- } \
-}
-
-#if defined(ldexpf)
-BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpf, float, int)
-#else
-BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpf, float, int)
-#endif
-
-#if defined(ldexpl)
-BOOST_HASH_CALL_FLOAT_MACRO(ldexp, ldexpl, long double, int)
-#else
-BOOST_HASH_CALL_FLOAT_FUNC(ldexp, ldexpl, long double, int)
-#endif
-
-#if defined(frexpf)
-BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpf, float, int*)
-#else
-BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpf, float, int*)
-#endif
-
-#if defined(frexpl)
-BOOST_HASH_CALL_FLOAT_MACRO(frexp, frexpl, long double, int*)
-#else
-BOOST_HASH_CALL_FLOAT_FUNC(frexp, frexpl, long double, int*)
-#endif
-
-#undef BOOST_HASH_CALL_FLOAT_MACRO
-#undef BOOST_HASH_CALL_FLOAT_FUNC
-
-
-namespace ndnboost
-{
- namespace hash_detail
- {
- template <typename Float1, typename Float2>
- struct select_hash_type_impl {
- typedef double type;
- };
-
- template <>
- struct select_hash_type_impl<float, float> {
- typedef float type;
- };
-
- template <>
- struct select_hash_type_impl<long double, long double> {
- typedef long double type;
- };
-
-
- // select_hash_type
- //
- // If there is support for a particular floating point type, use that
- // otherwise use double (there's always support for double).
-
- template <typename Float>
- struct select_hash_type : select_hash_type_impl<
- BOOST_DEDUCED_TYPENAME call_ldexp<Float>::float_type,
- BOOST_DEDUCED_TYPENAME call_frexp<Float>::float_type
- > {};
- }
-}
-
-#endif // BOOST_HASH_CONFORMANT_FLOATS
-
-#endif
diff --git a/ndnboost/functional/hash/detail/hash_float.hpp b/ndnboost/functional/hash/detail/hash_float.hpp
deleted file mode 100644
index c15a139..0000000
--- a/ndnboost/functional/hash/detail/hash_float.hpp
+++ /dev/null
@@ -1,277 +0,0 @@
-
-// Copyright 2005-2012 Daniel James.
-// 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)
-
-#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER)
-#define BOOST_FUNCTIONAL_HASH_DETAIL_HASH_FLOAT_HEADER
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <ndnboost/config.hpp>
-#include <ndnboost/functional/hash/detail/float_functions.hpp>
-#include <ndnboost/functional/hash/detail/limits.hpp>
-#include <ndnboost/utility/enable_if.hpp>
-#include <ndnboost/integer/static_log2.hpp>
-#include <ndnboost/cstdint.hpp>
-#include <ndnboost/assert.hpp>
-#include <ndnboost/limits.hpp>
-#include <cstring>
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#if BOOST_MSVC >= 1400
-#pragma warning(disable:6294) // Ill-defined for-loop: initial condition does
- // not satisfy test. Loop body not executed
-#endif
-#endif
-
-// Can we use fpclassify?
-
-// STLport
-#if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
-#define BOOST_HASH_USE_FPCLASSIFY 0
-
-// GNU libstdc++ 3
-#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
-# if (defined(__USE_ISOC99) || defined(_GLIBCXX_USE_C99_MATH)) && \
- !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
-# define BOOST_HASH_USE_FPCLASSIFY 1
-# else
-# define BOOST_HASH_USE_FPCLASSIFY 0
-# endif
-
-// Everything else
-#else
-# define BOOST_HASH_USE_FPCLASSIFY 0
-#endif
-
-namespace ndnboost
-{
- namespace hash_detail
- {
- inline void hash_float_combine(std::size_t& seed, std::size_t value)
- {
- seed ^= value + (seed<<6) + (seed>>2);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // Binary hash function
- //
- // Only used for floats with known iec559 floats, and certain values in
- // numeric_limits
-
- inline std::size_t hash_binary(char* ptr, std::size_t length)
- {
- std::size_t seed = 0;
-
- if (length >= sizeof(std::size_t)) {
- seed = *(std::size_t*) ptr;
- length -= sizeof(std::size_t);
- ptr += sizeof(std::size_t);
-
- while(length >= sizeof(std::size_t)) {
- std::size_t buffer = 0;
- std::memcpy(&buffer, ptr, sizeof(std::size_t));
- hash_float_combine(seed, buffer);
- length -= sizeof(std::size_t);
- ptr += sizeof(std::size_t);
- }
- }
-
- if (length > 0) {
- std::size_t buffer = 0;
- std::memcpy(&buffer, ptr, length);
- hash_float_combine(seed, buffer);
- }
-
- return seed;
- }
-
- template <typename Float>
- inline std::size_t float_hash_impl(Float v,
- BOOST_DEDUCED_TYPENAME ndnboost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 24 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 128,
- int>::type
- )
- {
- return hash_binary((char*) &v, 4);
- }
-
-
- template <typename Float>
- inline std::size_t float_hash_impl(Float v,
- BOOST_DEDUCED_TYPENAME ndnboost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 53 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 1024,
- int>::type
- )
- {
- return hash_binary((char*) &v, 8);
- }
-
- template <typename Float>
- inline std::size_t float_hash_impl(Float v,
- BOOST_DEDUCED_TYPENAME ndnboost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 64 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 16384,
- int>::type
- )
- {
- return hash_binary((char*) &v, 10);
- }
-
- template <typename Float>
- inline std::size_t float_hash_impl(Float v,
- BOOST_DEDUCED_TYPENAME ndnboost::enable_if_c<
- std::numeric_limits<Float>::is_iec559 &&
- std::numeric_limits<Float>::digits == 113 &&
- std::numeric_limits<Float>::radix == 2 &&
- std::numeric_limits<Float>::max_exponent == 16384,
- int>::type
- )
- {
- return hash_binary((char*) &v, 16);
- }
-
- ////////////////////////////////////////////////////////////////////////
- // Portable hash function
- //
- // Used as a fallback when the binary hash function isn't supported.
-
- template <class T>
- inline std::size_t float_hash_impl2(T v)
- {
- ndnboost::hash_detail::call_frexp<T> frexp;
- ndnboost::hash_detail::call_ldexp<T> ldexp;
-
- int exp = 0;
-
- v = frexp(v, &exp);
-
- // A postive value is easier to hash, so combine the
- // sign with the exponent and use the absolute value.
- if(v < 0) {
- v = -v;
- exp += limits<T>::max_exponent -
- limits<T>::min_exponent;
- }
-
- v = ldexp(v, limits<std::size_t>::digits);
- std::size_t seed = static_cast<std::size_t>(v);
- v -= static_cast<T>(seed);
-
- // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;
- std::size_t const length
- = (limits<T>::digits *
- ndnboost::static_log2<limits<T>::radix>::value
- + limits<std::size_t>::digits - 1)
- / limits<std::size_t>::digits;
-
- for(std::size_t i = 0; i != length; ++i)
- {
- v = ldexp(v, limits<std::size_t>::digits);
- std::size_t part = static_cast<std::size_t>(v);
- v -= static_cast<T>(part);
- hash_float_combine(seed, part);
- }
-
- hash_float_combine(seed, exp);
-
- return seed;
- }
-
-#if !defined(BOOST_HASH_DETAIL_TEST_WITHOUT_GENERIC)
- template <class T>
- inline std::size_t float_hash_impl(T v, ...)
- {
- typedef BOOST_DEDUCED_TYPENAME select_hash_type<T>::type type;
- return float_hash_impl2(static_cast<type>(v));
- }
-#endif
- }
-}
-
-#if BOOST_HASH_USE_FPCLASSIFY
-
-#include <ndnboost/config/no_tr1/cmath.hpp>
-
-namespace ndnboost
-{
- namespace hash_detail
- {
- template <class T>
- inline std::size_t float_hash_value(T v)
- {
-#if defined(fpclassify)
- switch (fpclassify(v))
-#elif BOOST_HASH_CONFORMANT_FLOATS
- switch (std::fpclassify(v))
-#else
- using namespace std;
- switch (fpclassify(v))
-#endif
- {
- case FP_ZERO:
- return 0;
- case FP_INFINITE:
- return (std::size_t)(v > 0 ? -1 : -2);
- case FP_NAN:
- return (std::size_t)(-3);
- case FP_NORMAL:
- case FP_SUBNORMAL:
- return float_hash_impl(v, 0);
- default:
- BOOST_ASSERT(0);
- return 0;
- }
- }
- }
-}
-
-#else // !BOOST_HASH_USE_FPCLASSIFY
-
-namespace ndnboost
-{
- namespace hash_detail
- {
- template <class T>
- inline bool is_zero(T v)
- {
-#if !defined(__GNUC__)
- return v == 0;
-#else
- // GCC's '-Wfloat-equal' will complain about comparing
- // v to 0, but because it disables warnings for system
- // headers it won't complain if you use std::equal_to to
- // compare with 0. Resulting in this silliness:
- return std::equal_to<T>()(v, 0);
-#endif
- }
-
- template <class T>
- inline std::size_t float_hash_value(T v)
- {
- return ndnboost::hash_detail::is_zero(v) ? 0 : float_hash_impl(v, 0);
- }
- }
-}
-
-#endif // BOOST_HASH_USE_FPCLASSIFY
-
-#undef BOOST_HASH_USE_FPCLASSIFY
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
-#endif
diff --git a/ndnboost/functional/hash/detail/limits.hpp b/ndnboost/functional/hash/detail/limits.hpp
deleted file mode 100644
index aff26da..0000000
--- a/ndnboost/functional/hash/detail/limits.hpp
+++ /dev/null
@@ -1,61 +0,0 @@
-
-// Copyright 2005-2009 Daniel James.
-// 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)
-//
-// On some platforms std::limits gives incorrect values for long double.
-// This tries to work around them.
-
-#if !defined(BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER)
-#define BOOST_FUNCTIONAL_HASH_DETAIL_LIMITS_HEADER
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#include <ndnboost/limits.hpp>
-
-// On OpenBSD, numeric_limits is not reliable for long doubles, but
-// the macros defined in <float.h> are and support long double when STLport
-// doesn't.
-
-#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE)
-#include <float.h>
-#endif
-
-namespace ndnboost
-{
- namespace hash_detail
- {
- template <class T>
- struct limits : std::numeric_limits<T> {};
-
-#if defined(__OpenBSD__) || defined(_STLP_NO_LONG_DOUBLE)
- template <>
- struct limits<long double>
- : std::numeric_limits<long double>
- {
- static long double epsilon() {
- return LDBL_EPSILON;
- }
-
- static long double (max)() {
- return LDBL_MAX;
- }
-
- static long double (min)() {
- return LDBL_MIN;
- }
-
- BOOST_STATIC_CONSTANT(int, digits = LDBL_MANT_DIG);
- BOOST_STATIC_CONSTANT(int, max_exponent = LDBL_MAX_EXP);
- BOOST_STATIC_CONSTANT(int, min_exponent = LDBL_MIN_EXP);
-#if defined(_STLP_NO_LONG_DOUBLE)
- BOOST_STATIC_CONSTANT(int, radix = FLT_RADIX);
-#endif
- };
-#endif // __OpenBSD__
- }
-}
-
-#endif
diff --git a/ndnboost/functional/hash/extensions.hpp b/ndnboost/functional/hash/extensions.hpp
deleted file mode 100644
index 119043b..0000000
--- a/ndnboost/functional/hash/extensions.hpp
+++ /dev/null
@@ -1,379 +0,0 @@
-
-// Copyright 2005-2009 Daniel James.
-// 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)
-
-// Based on Peter Dimov's proposal
-// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
-// issue 6.18.
-
-// This implements the extensions to the standard.
-// It's undocumented, so you shouldn't use it....
-
-#if !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)
-#define BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP
-
-#include <ndnboost/functional/hash/hash.hpp>
-#include <ndnboost/detail/container_fwd.hpp>
-#include <ndnboost/utility/enable_if.hpp>
-#include <ndnboost/static_assert.hpp>
-#include <ndnboost/preprocessor/repetition/repeat_from_to.hpp>
-#include <ndnboost/preprocessor/repetition/enum_params.hpp>
-
-#if !defined(BOOST_NO_CXX11_HDR_ARRAY)
-# include <array>
-#endif
-
-#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
-# include <tuple>
-#endif
-
-#if !defined(BOOST_NO_CXX11_HDR_MEMORY)
-# include <memory>
-#endif
-
-#if defined(_MSC_VER) && (_MSC_VER >= 1020)
-# pragma once
-#endif
-
-#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
-#include <ndnboost/type_traits/is_array.hpp>
-#endif
-
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-#include <ndnboost/type_traits/is_const.hpp>
-#endif
-
-namespace ndnboost
-{
- template <class A, class B>
- std::size_t hash_value(std::pair<A, B> const&);
- template <class T, class A>
- std::size_t hash_value(std::vector<T, A> const&);
- template <class T, class A>
- std::size_t hash_value(std::list<T, A> const& v);
- template <class T, class A>
- std::size_t hash_value(std::deque<T, A> const& v);
- template <class K, class C, class A>
- std::size_t hash_value(std::set<K, C, A> const& v);
- template <class K, class C, class A>
- std::size_t hash_value(std::multiset<K, C, A> const& v);
- template <class K, class T, class C, class A>
- std::size_t hash_value(std::map<K, T, C, A> const& v);
- template <class K, class T, class C, class A>
- std::size_t hash_value(std::multimap<K, T, C, A> const& v);
-
- template <class T>
- std::size_t hash_value(std::complex<T> const&);
-
- template <class A, class B>
- std::size_t hash_value(std::pair<A, B> const& v)
- {
- std::size_t seed = 0;
- ndnboost::hash_combine(seed, v.first);
- ndnboost::hash_combine(seed, v.second);
- return seed;
- }
-
- template <class T, class A>
- std::size_t hash_value(std::vector<T, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class T, class A>
- std::size_t hash_value(std::list<T, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class T, class A>
- std::size_t hash_value(std::deque<T, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class K, class C, class A>
- std::size_t hash_value(std::set<K, C, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class K, class C, class A>
- std::size_t hash_value(std::multiset<K, C, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class K, class T, class C, class A>
- std::size_t hash_value(std::map<K, T, C, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class K, class T, class C, class A>
- std::size_t hash_value(std::multimap<K, T, C, A> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-
- template <class T>
- std::size_t hash_value(std::complex<T> const& v)
- {
- ndnboost::hash<T> hasher;
- std::size_t seed = hasher(v.imag());
- seed ^= hasher(v.real()) + (seed<<6) + (seed>>2);
- return seed;
- }
-
-#if !defined(BOOST_NO_CXX11_HDR_ARRAY)
- template <class T, std::size_t N>
- std::size_t hash_value(std::array<T, N> const& v)
- {
- return ndnboost::hash_range(v.begin(), v.end());
- }
-#endif
-
-#if !defined(BOOST_NO_CXX11_HDR_TUPLE)
- namespace hash_detail {
- template <std::size_t I, typename T>
- inline typename ndnboost::enable_if_c<(I == std::tuple_size<T>::value),
- void>::type
- hash_combine_tuple(std::size_t&, T const&)
- {
- }
-
- template <std::size_t I, typename T>
- inline typename ndnboost::enable_if_c<(I < std::tuple_size<T>::value),
- void>::type
- hash_combine_tuple(std::size_t& seed, T const& v)
- {
- ndnboost::hash_combine(seed, std::get<I>(v));
- ndnboost::hash_detail::hash_combine_tuple<I + 1>(seed, v);
- }
-
- template <typename T>
- inline std::size_t hash_tuple(T const& v)
- {
- std::size_t seed = 0;
- ndnboost::hash_detail::hash_combine_tuple<0>(seed, v);
- return seed;
- }
- }
-
-#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES)
- template <typename... T>
- inline std::size_t hash_value(std::tuple<T...> const& v)
- {
- return ndnboost::hash_detail::hash_tuple(v);
- }
-#else
-
- inline std::size_t hash_value(std::tuple<> const& v)
- {
- return ndnboost::hash_detail::hash_tuple(v);
- }
-
-# define BOOST_HASH_TUPLE_F(z, n, _) \
- template< \
- BOOST_PP_ENUM_PARAMS_Z(z, n, typename A) \
- > \
- inline std::size_t hash_value(std::tuple< \
- BOOST_PP_ENUM_PARAMS_Z(z, n, A) \
- > const& v) \
- { \
- return ndnboost::hash_detail::hash_tuple(v); \
- }
-
- BOOST_PP_REPEAT_FROM_TO(1, 11, BOOST_HASH_TUPLE_F, _)
-# undef BOOST_HASH_TUPLE_F
-#endif
-
-#endif
-
-#if !defined(BOOST_NO_CXX11_SMART_PTR)
- template <typename T>
- inline std::size_t hash_value(std::shared_ptr<T> const& x) {
- return ndnboost::hash_value(x.get());
- }
-
- template <typename T, typename Deleter>
- inline std::size_t hash_value(std::unique_ptr<T, Deleter> const& x) {
- return ndnboost::hash_value(x.get());
- }
-#endif
-
- //
- // call_hash_impl
- //
-
- // On compilers without function template ordering, this deals with arrays.
-
-#if defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- namespace hash_detail
- {
- template <bool IsArray>
- struct call_hash_impl
- {
- template <class T>
- struct inner
- {
- static std::size_t call(T const& v)
- {
- using namespace ndnboost;
- return hash_value(v);
- }
- };
- };
-
- template <>
- struct call_hash_impl<true>
- {
- template <class Array>
- struct inner
- {
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- static std::size_t call(Array const& v)
-#else
- static std::size_t call(Array& v)
-#endif
- {
- const int size = sizeof(v) / sizeof(*v);
- return ndnboost::hash_range(v, v + size);
- }
- };
- };
-
- template <class T>
- struct call_hash
- : public call_hash_impl<ndnboost::is_array<T>::value>
- ::BOOST_NESTED_TEMPLATE inner<T>
- {
- };
- }
-#endif // BOOST_NO_FUNCTION_TEMPLATE_ORDERING
-
- //
- // ndnboost::hash
- //
-
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-
- template <class T> struct hash
- : std::unary_function<T, std::size_t>
- {
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- std::size_t operator()(T const& val) const
- {
- return hash_value(val);
- }
-#else
- std::size_t operator()(T const& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
-#endif
- };
-
-#if BOOST_WORKAROUND(__DMC__, <= 0x848)
- template <class T, unsigned int n> struct hash<T[n]>
- : std::unary_function<T[n], std::size_t>
- {
- std::size_t operator()(const T* val) const
- {
- return ndnboost::hash_range(val, val+n);
- }
- };
-#endif
-
-#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
- // On compilers without partial specialization, ndnboost::hash<T>
- // has already been declared to deal with pointers, so just
- // need to supply the non-pointer version of hash_impl.
-
- namespace hash_detail
- {
- template <bool IsPointer>
- struct hash_impl;
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-
- template <>
- struct hash_impl<false>
- {
- template <class T>
- struct inner
- : std::unary_function<T, std::size_t>
- {
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- std::size_t operator()(T const& val) const
- {
- return hash_value(val);
- }
-#else
- std::size_t operator()(T const& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
-#endif
- };
- };
-
-#else // Visual C++ 6.5
-
- // Visual C++ 6.5 has problems with nested member functions and
- // applying const to const types in templates. So we get this:
-
- template <bool IsConst>
- struct hash_impl_msvc
- {
- template <class T>
- struct inner
- : public std::unary_function<T, std::size_t>
- {
- std::size_t operator()(T const& val) const
- {
- return hash_detail::call_hash<T const>::call(val);
- }
-
- std::size_t operator()(T& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
- };
- };
-
- template <>
- struct hash_impl_msvc<true>
- {
- template <class T>
- struct inner
- : public std::unary_function<T, std::size_t>
- {
- std::size_t operator()(T& val) const
- {
- return hash_detail::call_hash<T>::call(val);
- }
- };
- };
-
- template <class T>
- struct hash_impl_msvc2
- : public hash_impl_msvc<ndnboost::is_const<T>::value>
- ::BOOST_NESTED_TEMPLATE inner<T> {};
-
- template <>
- struct hash_impl<false>
- {
- template <class T>
- struct inner : public hash_impl_msvc2<T> {};
- };
-
-#endif // Visual C++ 6.5
- }
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-}
-
-#endif
diff --git a/ndnboost/functional/hash/hash.hpp b/ndnboost/functional/hash/hash.hpp
deleted file mode 100644
index c61793c..0000000
--- a/ndnboost/functional/hash/hash.hpp
+++ /dev/null
@@ -1,530 +0,0 @@
-
-// Copyright 2005-2009 Daniel James.
-// 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)
-
-// Based on Peter Dimov's proposal
-// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2005/n1756.pdf
-// issue 6.18.
-
-#if !defined(BOOST_FUNCTIONAL_HASH_HASH_HPP)
-#define BOOST_FUNCTIONAL_HASH_HASH_HPP
-
-#include <ndnboost/functional/hash/hash_fwd.hpp>
-#include <functional>
-#include <ndnboost/functional/hash/detail/hash_float.hpp>
-#include <string>
-#include <ndnboost/limits.hpp>
-#include <ndnboost/type_traits/is_enum.hpp>
-#include <ndnboost/type_traits/is_integral.hpp>
-#include <ndnboost/utility/enable_if.hpp>
-
-#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-#include <ndnboost/type_traits/is_pointer.hpp>
-#endif
-
-#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
-#include <typeindex>
-#endif
-
-#if BOOST_WORKAROUND(__GNUC__, < 3) \
- && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
-#define BOOST_HASH_CHAR_TRAITS string_char_traits
-#else
-#define BOOST_HASH_CHAR_TRAITS char_traits
-#endif
-
-namespace ndnboost
-{
- namespace hash_detail
- {
- struct enable_hash_value { typedef std::size_t type; };
-
- template <typename T> struct basic_numbers {};
- template <typename T> struct long_numbers;
- template <typename T> struct ulong_numbers;
- template <typename T> struct float_numbers {};
-
- template <> struct basic_numbers<bool> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<char> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<unsigned char> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<signed char> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<short> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<unsigned short> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<int> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<unsigned int> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<long> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct basic_numbers<unsigned long> :
- ndnboost::hash_detail::enable_hash_value {};
-
-#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
- template <> struct basic_numbers<wchar_t> :
- ndnboost::hash_detail::enable_hash_value {};
-#endif
-
- // long_numbers is defined like this to allow for separate
- // specialization for long_long and int128_type, in case
- // they conflict.
- template <typename T> struct long_numbers2 {};
- template <typename T> struct ulong_numbers2 {};
- template <typename T> struct long_numbers : long_numbers2<T> {};
- template <typename T> struct ulong_numbers : ulong_numbers2<T> {};
-
-#if !defined(BOOST_NO_LONG_LONG)
- template <> struct long_numbers<ndnboost::long_long_type> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct ulong_numbers<ndnboost::ulong_long_type> :
- ndnboost::hash_detail::enable_hash_value {};
-#endif
-
-#if defined(BOOST_HAS_INT128)
- template <> struct long_numbers2<ndnboost::int128_type> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct ulong_numbers2<ndnboost::uint128_type> :
- ndnboost::hash_detail::enable_hash_value {};
-#endif
-
- template <> struct float_numbers<float> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct float_numbers<double> :
- ndnboost::hash_detail::enable_hash_value {};
- template <> struct float_numbers<long double> :
- ndnboost::hash_detail::enable_hash_value {};
- }
-
- template <typename T>
- typename ndnboost::hash_detail::basic_numbers<T>::type hash_value(T);
- template <typename T>
- typename ndnboost::hash_detail::long_numbers<T>::type hash_value(T);
- template <typename T>
- typename ndnboost::hash_detail::ulong_numbers<T>::type hash_value(T);
-
- template <typename T>
- typename ndnboost::enable_if<ndnboost::is_enum<T>, std::size_t>::type
- hash_value(T);
-
-#if !BOOST_WORKAROUND(__DMC__, <= 0x848)
- template <class T> std::size_t hash_value(T* const&);
-#else
- template <class T> std::size_t hash_value(T*);
-#endif
-
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- template< class T, unsigned N >
- std::size_t hash_value(const T (&x)[N]);
-
- template< class T, unsigned N >
- std::size_t hash_value(T (&x)[N]);
-#endif
-
- template <class Ch, class A>
- std::size_t hash_value(
- std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
-
- template <typename T>
- typename ndnboost::hash_detail::float_numbers<T>::type hash_value(T);
-
-#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
- std::size_t hash_value(std::type_index);
-#endif
-
- // Implementation
-
- namespace hash_detail
- {
- template <class T>
- inline std::size_t hash_value_signed(T val)
- {
- const int size_t_bits = std::numeric_limits<std::size_t>::digits;
- // ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
- const int length = (std::numeric_limits<T>::digits - 1)
- / size_t_bits;
-
- std::size_t seed = 0;
- T positive = val < 0 ? -1 - val : val;
-
- // Hopefully, this loop can be unrolled.
- for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)
- {
- seed ^= (std::size_t) (positive >> i) + (seed<<6) + (seed>>2);
- }
- seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
-
- return seed;
- }
-
- template <class T>
- inline std::size_t hash_value_unsigned(T val)
- {
- const int size_t_bits = std::numeric_limits<std::size_t>::digits;
- // ceiling(std::numeric_limits<T>::digits / size_t_bits) - 1
- const int length = (std::numeric_limits<T>::digits - 1)
- / size_t_bits;
-
- std::size_t seed = 0;
-
- // Hopefully, this loop can be unrolled.
- for(unsigned int i = length * size_t_bits; i > 0; i -= size_t_bits)
- {
- seed ^= (std::size_t) (val >> i) + (seed<<6) + (seed>>2);
- }
- seed ^= (std::size_t) val + (seed<<6) + (seed>>2);
-
- return seed;
- }
- }
-
- template <typename T>
- typename ndnboost::hash_detail::basic_numbers<T>::type hash_value(T v)
- {
- return static_cast<std::size_t>(v);
- }
-
- template <typename T>
- typename ndnboost::hash_detail::long_numbers<T>::type hash_value(T v)
- {
- return hash_detail::hash_value_signed(v);
- }
-
- template <typename T>
- typename ndnboost::hash_detail::ulong_numbers<T>::type hash_value(T v)
- {
- return hash_detail::hash_value_unsigned(v);
- }
-
- template <typename T>
- typename ndnboost::enable_if<ndnboost::is_enum<T>, std::size_t>::type
- hash_value(T v)
- {
- return static_cast<std::size_t>(v);
- }
-
- // Implementation by Alberto Barbati and Dave Harris.
-#if !BOOST_WORKAROUND(__DMC__, <= 0x848)
- template <class T> std::size_t hash_value(T* const& v)
-#else
- template <class T> std::size_t hash_value(T* v)
-#endif
- {
-#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64
- // for some reason ptrdiff_t on OpenVMS compiler with
- // 64 bit is not 64 bit !!!
- std::size_t x = static_cast<std::size_t>(
- reinterpret_cast<long long int>(v));
-#else
- std::size_t x = static_cast<std::size_t>(
- reinterpret_cast<std::ptrdiff_t>(v));
-#endif
- return x + (x >> 3);
- }
-
-#if defined(BOOST_MSVC)
-#pragma warning(push)
-#if BOOST_MSVC <= 1400
-#pragma warning(disable:4267) // 'argument' : conversion from 'size_t' to
- // 'unsigned int', possible loss of data
- // A misguided attempt to detect 64-bit
- // incompatability.
-#endif
-#endif
-
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
- template <class T>
- inline void hash_combine(std::size_t& seed, T& v)
-#else
- template <class T>
- inline void hash_combine(std::size_t& seed, T const& v)
-#endif
- {
- ndnboost::hash<T> hasher;
- seed ^= hasher(v) + 0x9e3779b9 + (seed<<6) + (seed>>2);
- }
-
-#if defined(BOOST_MSVC)
-#pragma warning(pop)
-#endif
-
- template <class It>
- inline std::size_t hash_range(It first, It last)
- {
- std::size_t seed = 0;
-
- for(; first != last; ++first)
- {
- hash_combine(seed, *first);
- }
-
- return seed;
- }
-
- template <class It>
- inline void hash_range(std::size_t& seed, It first, It last)
- {
- for(; first != last; ++first)
- {
- hash_combine(seed, *first);
- }
- }
-
-#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
- template <class T>
- inline std::size_t hash_range(T* first, T* last)
- {
- std::size_t seed = 0;
-
- for(; first != last; ++first)
- {
- ndnboost::hash<T> hasher;
- seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
- }
-
- return seed;
- }
-
- template <class T>
- inline void hash_range(std::size_t& seed, T* first, T* last)
- {
- for(; first != last; ++first)
- {
- ndnboost::hash<T> hasher;
- seed ^= hasher(*first) + 0x9e3779b9 + (seed<<6) + (seed>>2);
- }
- }
-#endif
-
-#if !defined(BOOST_NO_FUNCTION_TEMPLATE_ORDERING)
- template< class T, unsigned N >
- inline std::size_t hash_value(const T (&x)[N])
- {
- return hash_range(x, x + N);
- }
-
- template< class T, unsigned N >
- inline std::size_t hash_value(T (&x)[N])
- {
- return hash_range(x, x + N);
- }
-#endif
-
- template <class Ch, class A>
- inline std::size_t hash_value(
- std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const& v)
- {
- return hash_range(v.begin(), v.end());
- }
-
- template <typename T>
- typename ndnboost::hash_detail::float_numbers<T>::type hash_value(T v)
- {
- return ndnboost::hash_detail::float_hash_value(v);
- }
-
-#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
- inline std::size_t hash_value(std::type_index v)
- {
- return v.hash_code();
- }
-#endif
-
- //
- // ndnboost::hash
- //
-
- // Define the specializations required by the standard. The general purpose
- // ndnboost::hash is defined later in extensions.hpp if
- // BOOST_HASH_NO_EXTENSIONS is not defined.
-
- // BOOST_HASH_SPECIALIZE - define a specialization for a type which is
- // passed by copy.
- //
- // BOOST_HASH_SPECIALIZE_REF - define a specialization for a type which is
- // passed by copy.
- //
- // These are undefined later.
-
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-#define BOOST_HASH_SPECIALIZE(type) \
- template <> struct hash<type> \
- : public std::unary_function<type, std::size_t> \
- { \
- std::size_t operator()(type v) const \
- { \
- return ndnboost::hash_value(v); \
- } \
- };
-
-#define BOOST_HASH_SPECIALIZE_REF(type) \
- template <> struct hash<type> \
- : public std::unary_function<type, std::size_t> \
- { \
- std::size_t operator()(type const& v) const \
- { \
- return ndnboost::hash_value(v); \
- } \
- };
-#else
-#define BOOST_HASH_SPECIALIZE(type) \
- template <> struct hash<type> \
- : public std::unary_function<type, std::size_t> \
- { \
- std::size_t operator()(type v) const \
- { \
- return ndnboost::hash_value(v); \
- } \
- }; \
- \
- template <> struct hash<const type> \
- : public std::unary_function<const type, std::size_t> \
- { \
- std::size_t operator()(const type v) const \
- { \
- return ndnboost::hash_value(v); \
- } \
- };
-
-#define BOOST_HASH_SPECIALIZE_REF(type) \
- template <> struct hash<type> \
- : public std::unary_function<type, std::size_t> \
- { \
- std::size_t operator()(type const& v) const \
- { \
- return ndnboost::hash_value(v); \
- } \
- }; \
- \
- template <> struct hash<const type> \
- : public std::unary_function<const type, std::size_t> \
- { \
- std::size_t operator()(type const& v) const \
- { \
- return ndnboost::hash_value(v); \
- } \
- };
-#endif
-
- BOOST_HASH_SPECIALIZE(bool)
- BOOST_HASH_SPECIALIZE(char)
- BOOST_HASH_SPECIALIZE(signed char)
- BOOST_HASH_SPECIALIZE(unsigned char)
-#if !defined(BOOST_NO_INTRINSIC_WCHAR_T)
- BOOST_HASH_SPECIALIZE(wchar_t)
-#endif
- BOOST_HASH_SPECIALIZE(short)
- BOOST_HASH_SPECIALIZE(unsigned short)
- BOOST_HASH_SPECIALIZE(int)
- BOOST_HASH_SPECIALIZE(unsigned int)
- BOOST_HASH_SPECIALIZE(long)
- BOOST_HASH_SPECIALIZE(unsigned long)
-
- BOOST_HASH_SPECIALIZE(float)
- BOOST_HASH_SPECIALIZE(double)
- BOOST_HASH_SPECIALIZE(long double)
-
- BOOST_HASH_SPECIALIZE_REF(std::string)
-#if !defined(BOOST_NO_STD_WSTRING)
- BOOST_HASH_SPECIALIZE_REF(std::wstring)
-#endif
-
-#if !defined(BOOST_NO_LONG_LONG)
- BOOST_HASH_SPECIALIZE(ndnboost::long_long_type)
- BOOST_HASH_SPECIALIZE(ndnboost::ulong_long_type)
-#endif
-
-#if defined(BOOST_HAS_INT128)
- BOOST_HASH_SPECIALIZE(ndnboost::int128_type)
- BOOST_HASH_SPECIALIZE(ndnboost::uint128_type)
-#endif
-
-#if !defined(BOOST_NO_CXX11_HDR_TYPEINDEX)
- BOOST_HASH_SPECIALIZE(std::type_index)
-#endif
-
-#undef BOOST_HASH_SPECIALIZE
-#undef BOOST_HASH_SPECIALIZE_REF
-
-// Specializing ndnboost::hash for pointers.
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-
- template <class T>
- struct hash<T*>
- : public std::unary_function<T*, std::size_t>
- {
- std::size_t operator()(T* v) const
- {
-#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
- return ndnboost::hash_value(v);
-#else
- std::size_t x = static_cast<std::size_t>(
- reinterpret_cast<std::ptrdiff_t>(v));
-
- return x + (x >> 3);
-#endif
- }
- };
-
-#else
-
- // For compilers without partial specialization, we define a
- // ndnboost::hash for all remaining types. But hash_impl is only defined
- // for pointers in 'extensions.hpp' - so when BOOST_HASH_NO_EXTENSIONS
- // is defined there will still be a compile error for types not supported
- // in the standard.
-
- namespace hash_detail
- {
- template <bool IsPointer>
- struct hash_impl;
-
- template <>
- struct hash_impl<true>
- {
- template <class T>
- struct inner
- : public std::unary_function<T, std::size_t>
- {
- std::size_t operator()(T val) const
- {
-#if !BOOST_WORKAROUND(__SUNPRO_CC, <= 590)
- return ndnboost::hash_value(val);
-#else
- std::size_t x = static_cast<std::size_t>(
- reinterpret_cast<std::ptrdiff_t>(val));
-
- return x + (x >> 3);
-#endif
- }
- };
- };
- }
-
- template <class T> struct hash
- : public ndnboost::hash_detail::hash_impl<ndnboost::is_pointer<T>::value>
- ::BOOST_NESTED_TEMPLATE inner<T>
- {
- };
-
-#endif
-}
-
-#undef BOOST_HASH_CHAR_TRAITS
-
-#endif // BOOST_FUNCTIONAL_HASH_HASH_HPP
-
-// Include this outside of the include guards in case the file is included
-// twice - once with BOOST_HASH_NO_EXTENSIONS defined, and then with it
-// undefined.
-
-#if !defined(BOOST_HASH_NO_EXTENSIONS) \
- && !defined(BOOST_FUNCTIONAL_HASH_EXTENSIONS_HPP)
-#include <ndnboost/functional/hash/extensions.hpp>
-#endif
diff --git a/ndnboost/functional/lightweight_forward_adapter.hpp b/ndnboost/functional/lightweight_forward_adapter.hpp
deleted file mode 100644
index 8312a2c..0000000
--- a/ndnboost/functional/lightweight_forward_adapter.hpp
+++ /dev/null
@@ -1,259 +0,0 @@
-/*=============================================================================
- Copyright (c) 2007 Tobias Schwinger
-
- 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_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_HPP_INCLUDED
-# ifndef BOOST_PP_IS_ITERATING
-
-# include <ndnboost/config.hpp>
-# include <ndnboost/detail/workaround.hpp>
-
-# include <ndnboost/preprocessor/cat.hpp>
-# include <ndnboost/preprocessor/iteration/iterate.hpp>
-# include <ndnboost/preprocessor/repetition/enum.hpp>
-# include <ndnboost/preprocessor/repetition/enum_params.hpp>
-# include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
-# include <ndnboost/preprocessor/facilities/intercept.hpp>
-
-# include <ndnboost/utility/result_of.hpp>
-# include <ndnboost/ref.hpp>
-
-# ifndef BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY
-# define BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY 10
-# elif BOOST_FUNCTIONAL_FORDWARD_ADAPTER_MAX_ARITY < 3
-# undef BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY
-# define BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY 3
-# endif
-
-namespace ndnboost
-{
- template< typename Function, int Arity_Or_MinArity = -1, int MaxArity = -1 >
- class lightweight_forward_adapter;
-
- //----- ---- --- -- - - - -
-
- namespace detail
- {
- template< class MostDerived, typename Function, typename FunctionConst,
- int Arity, int MinArity >
- struct lightweight_forward_adapter_impl;
-
- struct lightweight_forward_adapter_result
- {
- template< typename Sig > struct apply;
-
- // Utility metafunction for argument transform
- template< typename T > struct x { typedef T const& t; };
- template< typename T > struct x< ndnboost::reference_wrapper<T> >
- { typedef T& t; };
- template< typename T > struct x<T&> : x<T> { };
- template< typename T > struct x<T const&> : x<T> { };
- template< typename T > struct x<T const> : x<T> { };
-
- // Utility metafunction to choose target function qualification
- template< typename T > struct c
- { typedef typename T::target_function_t t; };
- template< typename T > struct c<T& >
- { typedef typename T::target_function_t t; };
- template< typename T > struct c<T const >
- { typedef typename T::target_function_const_t t; };
- template< typename T > struct c<T const&>
- { typedef typename T::target_function_const_t t; };
- };
- }
-
-# define BOOST_TMP_MACRO(f,fn,fc) \
- ndnboost::detail::lightweight_forward_adapter_impl< \
- lightweight_forward_adapter<f,Arity_Or_MinArity,MaxArity>, fn, fc, \
- (MaxArity!=-1? MaxArity :Arity_Or_MinArity!=-1? Arity_Or_MinArity \
- :BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY), \
- (Arity_Or_MinArity!=-1? Arity_Or_MinArity : 0) >
-
- template< typename Function, int Arity_Or_MinArity, int MaxArity >
- class lightweight_forward_adapter
- : public BOOST_TMP_MACRO(Function,Function,Function const)
- , private Function
- {
- public:
- lightweight_forward_adapter(Function const& f = Function())
- : Function(f)
- { }
-
- typedef Function target_function_t;
- typedef Function const target_function_const_t;
-
- Function & target_function() { return *this; }
- Function const & target_function() const { return *this; }
-
- template< typename Sig > struct result
- : detail::lightweight_forward_adapter_result::template apply<Sig>
- { };
-
- using BOOST_TMP_MACRO(Function,Function, Function const)::operator();
- };
- template< typename Function, int Arity_Or_MinArity, int MaxArity >
- class lightweight_forward_adapter< Function const, Arity_Or_MinArity,
- MaxArity >
- : public BOOST_TMP_MACRO(Function const, Function const, Function const)
- , private Function
- {
- public:
- lightweight_forward_adapter(Function const& f = Function())
- : Function(f)
- { }
-
- typedef Function const target_function_t;
- typedef Function const target_function_const_t;
-
- Function const & target_function() const { return *this; }
-
- template< typename Sig > struct result
- : detail::lightweight_forward_adapter_result::template apply<Sig>
- { };
-
- using BOOST_TMP_MACRO(Function const,Function const, Function const)
- ::operator();
- };
- template< typename Function, int Arity_Or_MinArity, int MaxArity >
- class lightweight_forward_adapter< Function &, Arity_Or_MinArity, MaxArity >
- : public BOOST_TMP_MACRO(Function&, Function, Function)
- {
- Function& ref_function;
- public:
- lightweight_forward_adapter(Function& f)
- : ref_function(f)
- { }
-
- typedef Function target_function_t;
- typedef Function target_function_const_t;
-
- Function & target_function() const { return this->ref_function; }
-
- template< typename Sig > struct result
- : detail::lightweight_forward_adapter_result::template apply<Sig>
- { };
-
- using BOOST_TMP_MACRO(Function&, Function, Function)::operator();
- };
-
- #undef BOOST_TMP_MACRO
-
- namespace detail
- {
- template< class Self >
- struct lightweight_forward_adapter_result::apply< Self() >
- : ndnboost::result_of< BOOST_DEDUCED_TYPENAME c<Self>::t() >
- { };
-
- template< class MD, class F, class FC >
- struct lightweight_forward_adapter_impl<MD,F,FC,0,0>
- : lightweight_forward_adapter_result
- {
- inline typename ndnboost::result_of< FC() >::type
- operator()() const
- {
- return static_cast<MD const*>(this)->target_function()();
- }
-
- inline typename ndnboost::result_of< F() >::type
- operator()()
- {
- return static_cast<MD*>(this)->target_function()();
- }
- };
-
-# define BOOST_PP_FILENAME_1 \
- <ndnboost/functional/lightweight_forward_adapter.hpp>
-# define BOOST_PP_ITERATION_LIMITS \
- (1,BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_MAX_ARITY)
-# include BOOST_PP_ITERATE()
-
- } // namespace detail
-
- template<class F, int A0, int A1>
- struct result_of<ndnboost::lightweight_forward_adapter<F,A0,A1> const ()>
- : ndnboost::detail::lightweight_forward_adapter_result::template apply<
- ndnboost::lightweight_forward_adapter<F,A0,A1> const () >
- { };
- template<class F, int A0, int A1>
- struct result_of<ndnboost::lightweight_forward_adapter<F,A0,A1>()>
- : ndnboost::detail::lightweight_forward_adapter_result::template apply<
- ndnboost::lightweight_forward_adapter<F,A0,A1>() >
- { };
- template<class F, int A0, int A1>
- struct result_of<ndnboost::lightweight_forward_adapter<F,A0,A1> const& ()>
- : ndnboost::detail::lightweight_forward_adapter_result::template apply<
- ndnboost::lightweight_forward_adapter<F,A0,A1> const () >
- { };
- template<class F, int A0, int A1>
- struct result_of<ndnboost::lightweight_forward_adapter<F,A0,A1>& ()>
- : ndnboost::detail::lightweight_forward_adapter_result::template apply<
- ndnboost::lightweight_forward_adapter<F,A0,A1>() >
- { };
-}
-
-# define BOOST_FUNCTIONAL_LIGHTWEIGHT_FORWARD_ADAPTER_HPP_INCLUDED
-
-# else // defined(BOOST_PP_IS_ITERATING)
-# define N BOOST_PP_ITERATION()
-
- template< class Self, BOOST_PP_ENUM_PARAMS(N,typename T) >
- struct lightweight_forward_adapter_result::apply<
- Self (BOOST_PP_ENUM_PARAMS(N,T)) >
- : ndnboost::result_of<
- BOOST_DEDUCED_TYPENAME c<Self>::t (BOOST_PP_ENUM_BINARY_PARAMS(N,
- typename x<T,>::t BOOST_PP_INTERCEPT)) >
- { };
-
- template< class MD, class F, class FC >
- struct lightweight_forward_adapter_impl<MD,F,FC,BOOST_PP_DEC(N),N>
- : lightweight_forward_adapter_result
- {
- template< BOOST_PP_ENUM_PARAMS(N,typename T) >
- inline typename ndnboost::result_of< F(BOOST_PP_ENUM_BINARY_PARAMS(N,
- T,const& BOOST_PP_INTERCEPT)) >::type
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& BOOST_PP_INTERCEPT));
- };
-
- template< class MD, class F, class FC, int MinArity >
- struct lightweight_forward_adapter_impl<MD,F,FC,N,MinArity>
- : lightweight_forward_adapter_impl<MD,F,FC,BOOST_PP_DEC(N),MinArity>
- {
- using lightweight_forward_adapter_impl<MD,F,FC,BOOST_PP_DEC(N),
- MinArity>::operator();
-
-# define M(z,i,d) \
- static_cast<typename d::template x<T##i>::t>(a##i)
-
- template< BOOST_PP_ENUM_PARAMS(N,typename T) >
- inline typename lightweight_forward_adapter_result::template apply<
- MD const (BOOST_PP_ENUM_BINARY_PARAMS(N,
- T,const& BOOST_PP_INTERCEPT)) >::type
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& a)) const
- {
- typedef lightweight_forward_adapter_result _;
- return static_cast<MD const*>(this)->target_function()(
- BOOST_PP_ENUM(N,M,_));
- }
- template< BOOST_PP_ENUM_PARAMS(N,typename T) >
- inline typename lightweight_forward_adapter_result::template apply<
- MD (BOOST_PP_ENUM_BINARY_PARAMS(N,
- T,const& BOOST_PP_INTERCEPT)) >::type
- operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,const& a))
- {
- typedef lightweight_forward_adapter_result _;
- return static_cast<MD*>(this)->target_function()(
- BOOST_PP_ENUM(N,M,_));
- }
-# undef M
- };
-
-# undef N
-# endif // defined(BOOST_PP_IS_ITERATING)
-
-#endif // include guard
-
diff --git a/ndnboost/functional/overloaded_function.hpp b/ndnboost/functional/overloaded_function.hpp
deleted file mode 100644
index d2a1369..0000000
--- a/ndnboost/functional/overloaded_function.hpp
+++ /dev/null
@@ -1,311 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/functional/overloaded_function
-
-#ifndef DOXYGEN // Doxygen documentation only.
-
-#if !BOOST_PP_IS_ITERATING
-# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
-# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_HPP_
-
-# include <ndnboost/functional/overloaded_function/detail/base.hpp>
-# include <ndnboost/functional/overloaded_function/detail/function_type.hpp>
-# include <ndnboost/functional/overloaded_function/config.hpp>
-# include <ndnboost/typeof/typeof.hpp>
-# include <ndnboost/preprocessor/iteration/iterate.hpp>
-# include <ndnboost/preprocessor/repetition/enum.hpp>
-# include <ndnboost/preprocessor/repetition/repeat.hpp>
-# include <ndnboost/preprocessor/control/expr_iif.hpp>
-# include <ndnboost/preprocessor/control/expr_if.hpp>
-# include <ndnboost/preprocessor/comparison/greater.hpp>
-# include <ndnboost/preprocessor/comparison/less.hpp>
-# include <ndnboost/preprocessor/cat.hpp>
-# include <ndnboost/preprocessor/arithmetic/add.hpp>
-# include <ndnboost/preprocessor/arithmetic/sub.hpp>
-# include <ndnboost/preprocessor/tuple/eat.hpp>
-# include <ndnboost/preprocessor/logical/and.hpp>
-# include <ndnboost/preprocessor/logical/not.hpp>
-# include <ndnboost/preprocessor/facilities/expand.hpp>
-
-#define BOOST_FUNCTIONAL_f_type(z, n, unused) \
- BOOST_PP_CAT(F, n)
-
-#define BOOST_FUNCTIONAL_f_arg(z, n, unused) \
- BOOST_PP_CAT(f, n)
-
-#define BOOST_FUNCTIONAL_f_tparam(z, n, unused) \
- typename BOOST_FUNCTIONAL_f_type(z, n, ~) \
-
-#define BOOST_FUNCTIONAL_f_tparam_dflt(z, n, is_tspec) \
- BOOST_FUNCTIONAL_f_tparam(z, n, ~) \
- /* overload requires at least 2 functors so F0 and F1 not optional */ \
- BOOST_PP_EXPR_IIF(BOOST_PP_AND(BOOST_PP_NOT(is_tspec), \
- BOOST_PP_GREATER(n, 1)), \
- = void \
- )
-
-#define BOOST_FUNCTIONAL_f_arg_decl(z, n, unused) \
- BOOST_FUNCTIONAL_f_type(z, n, ~) /* no qualifier to deduce tparam */ \
- BOOST_FUNCTIONAL_f_arg(z, n, ~)
-
-#define BOOST_FUNCTIONAL_g_type(z, n, unused) \
- BOOST_PP_CAT(G, n)
-
-#define BOOST_FUNCTIONAL_g_arg(z, n, unused) \
- BOOST_PP_CAT(g, n)
-
-#define BOOST_FUNCTIONAL_g_tparam(z, n, unused) \
- typename BOOST_FUNCTIONAL_g_type(z, n, ~)
-
-#define BOOST_FUNCTIONAL_g_arg_decl(z, n, unused) \
- BOOST_FUNCTIONAL_g_type(z, n, ~) /* no qualifier to deduce tparam */ \
- BOOST_FUNCTIONAL_g_arg(z, n, ~)
-
-#define BOOST_FUNCTIONAL_base(z, n, unused) \
- ::ndnboost::overloaded_function_detail::base< \
- BOOST_FUNCTIONAL_f_type(z, n, ~) \
- >
-
-#define BOOST_FUNCTIONAL_inherit(z, n, unused) \
- public BOOST_FUNCTIONAL_base(z, n, ~)
-
-#define BOOST_FUNCTIONAL_base_init(z, n, unused) \
- BOOST_FUNCTIONAL_base(z, n, ~)(BOOST_FUNCTIONAL_g_arg(z, n, ~))
-
-#define BOOST_FUNCTIONAL_using_operator_call(z, n, unused) \
- using BOOST_FUNCTIONAL_base(z, n, ~)::operator();
-
-#define BOOST_FUNCTIONAL_function_type(z, n, unused) \
- typename ::ndnboost::overloaded_function_detail::function_type< \
- BOOST_FUNCTIONAL_f_type(z, n, ~) \
- >::type
-
-# define BOOST_PP_ITERATION_PARAMS_1 \
- /* at least 2 func to overload so start from 2 to MAX */ \
- /* (cannot iterate [0, MAX-2) because error on Sun) */ \
- (3, (2, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
- "ndnboost/functional/overloaded_function.hpp"))
-# include BOOST_PP_ITERATE() // Iterate over function arity.
-
-#undef BOOST_FUNCTIONAL_f_type
-#undef BOOST_FUNCTIONAL_f_arg
-#undef BOOST_FUNCTIONAL_f_tparam
-#undef BOOST_FUNCTIONAL_f_arg_decl
-#undef BOOST_FUNCTIONAL_f_tparam_dflt
-#undef BOOST_FUNCTIONAL_g_type
-#undef BOOST_FUNCTIONAL_g_arg
-#undef BOOST_FUNCTIONAL_g_tparam
-#undef BOOST_FUNCTIONAL_g_arg_decl
-#undef BOOST_FUNCTIONAL_base
-#undef BOOST_FUNCTIONAL_inherit
-#undef BOOST_FUNCTIONAL_base_init
-#undef BOOST_FUNCTIONAL_using_operator_call
-#undef BOOST_FUNCTIONAL_function_type
-
-# endif // #include guard
-
-#elif BOOST_PP_ITERATION_DEPTH() == 1
-# define BOOST_FUNCTIONAL_overloads \
- /* iterate as OVERLOADS, OVERLOADS-1, OVERLOADS-2, ... */ \
- /* (add 2 because iteration started from 2 to MAX) */ \
- BOOST_PP_ADD(2, BOOST_PP_SUB( \
- BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX, \
- BOOST_PP_FRAME_ITERATION(1)))
-# define BOOST_FUNCTIONAL_is_tspec \
- /* if template specialization */ \
- BOOST_PP_LESS(BOOST_FUNCTIONAL_overloads, \
- BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX)
-
-// For type-of emulation: This must be included at this pp iteration level.
-# include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-
-namespace ndnboost {
-
-template<
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam_dflt,
- BOOST_FUNCTIONAL_is_tspec)
->
-class overloaded_function
- // Template specialization.
- BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), <)
- BOOST_PP_IIF(BOOST_FUNCTIONAL_is_tspec,
- BOOST_PP_ENUM
- ,
- BOOST_PP_TUPLE_EAT(3)
- )(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_type, ~)
- BOOST_PP_EXPR_IIF(BOOST_PP_EXPAND(BOOST_FUNCTIONAL_is_tspec), >)
- // Bases (overloads >= 2 so always at least 2 bases).
- : BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
- BOOST_FUNCTIONAL_inherit, ~)
-{
-public:
- template<
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_g_tparam, ~)
- > /* implicit */ inline overloaded_function(
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
- BOOST_FUNCTIONAL_g_arg_decl, ~))
- // Overloads >= 2 so always at least 2 bases to initialize.
- : BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
- BOOST_FUNCTIONAL_base_init, ~)
- {}
-
- BOOST_PP_REPEAT(BOOST_FUNCTIONAL_overloads,
- BOOST_FUNCTIONAL_using_operator_call, ~)
-};
-
-template<
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_tparam, ~)
->
-overloaded_function<
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_function_type, ~)
-> make_overloaded_function(
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg_decl, ~)
-) {
- return overloaded_function<
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads,
- BOOST_FUNCTIONAL_function_type, ~)
- >(BOOST_PP_ENUM(BOOST_FUNCTIONAL_overloads, BOOST_FUNCTIONAL_f_arg, ~));
-}
-
-} // namespace
-
-// For type-of emulation: Register overloaded function type (for _AUTO, etc).
-BOOST_TYPEOF_REGISTER_TEMPLATE(ndnboost::overloaded_function,
- BOOST_FUNCTIONAL_overloads)
-
-# undef BOOST_FUNCTIONAL_overloads
-# undef BOOST_FUNCTIONAL_is_tspec
-#endif // iteration
-
-// DOCUMENTATION //
-
-#else // DOXYGEN
-
-/** @file
-@brief Overload distinct function pointers, function references, and
-monomorphic function objects into a single function object.
-*/
-
-namespace ndnboost {
-
-/**
-@brief Function object to overload functions with distinct signatures.
-
-This function object aggregates together calls to functions of all the
-specified function types <c>F1</c>, <c>F2</c>, etc which must have distinct
-function signatures from one another.
-
-@Params
-@Param{F<em>i</em>,
-Each function type must be specified using the following syntax (which is
-Boost.Function's preferred syntax):
-@code
- result_type (argument1_type\, argumgnet2_type\, ...)
-@endcode
-}
-@EndParams
-
-In some cases, the @RefFunc{make_overloaded_function} function template can be
-useful to construct an overloaded function object without explicitly
-specifying the function types.
-
-At least two distinct function types must be specified (because there is
-nothing to overload between one or zero functions).
-The maximum number of functions to overload is given by the
-@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
-configuration macro.
-The maximum number of function parameters for each of the specified function
-types is given by the
-@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX}
-configuration macro.
-
-@See @RefSect{tutorial, Tutorial} section, @RefFunc{make_overloaded_function},
-@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX},
-@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX},
-Boost.Function.
-*/
-template<typename F1, typename F2, ...>
-class overloaded_function {
-public:
- /**
- @brief Construct the overloaded function object.
-
- Any function pointer, function reference, and monomorphic function object
- that can be converted to a <c>ndnboost::function</c> function object can be
- specified as parameter.
-
- @Note Unfortunately, it is not possible to support polymorphic function
- objects (as explained <a
- href="http://lists.boost.org/Archives/boost/2012/03/191744.php">here</a>).
- */
- overloaded_function(const ndnboost::function<F1>&,
- const ndnboost::function<F2>&, ...);
-
- /**
- @brief Call operator matching the signature of the function type specified
- as 1st template parameter.
-
- This will in turn invoke the call operator of the 1st function passed to
- the constructor.
- */
- typename ndnboost::function_traits<F1>::result_type operator()(
- typename ndnboost::function_traits<F1>::arg1_type,
- typename ndnboost::function_traits<F1>::arg2_type,
- ...) const;
-
- /**
- @brief Call operator matching the signature of the function type specified
- as 2nd template parameter.
-
- This will in turn invoke the call operator of the 2nd function passed to
- the constructor.
-
- @Note Similar call operators are present for all specified function types
- <c>F1</c>, <c>F2</c>, etc (even if not exhaustively listed by this
- documentation).
- */
- typename ndnboost::function_traits<F2>::result_type operator()(
- typename ndnboost::function_traits<F2>::arg1_type,
- typename ndnboost::function_traits<F2>::arg2_type,
- ...) const;
-};
-
-/**
-@brief Make an overloaded function object without explicitly specifying the
-function types.
-
-This function template creates and returns an @RefClass{overloaded_function}
-object that overloads all the specified functions <c>f1</c>, <c>f2</c>, etc.
-
-The function types are internally determined from the template parameter types
-so they do not need to be explicitly specified.
-Therefore, this function template usually has a more concise syntax when
-compared with @RefClass{overloaded_function}.
-This is especially useful when the explicit type of the returned
-@RefClass{overloaded_function} object does not need to be known (e.g., when
-used with Boost.Typeof's <c>BOOST_AUTO</c>, C++11 <c>auto</c>, or when the
-overloaded function object is handled using a function template parameter, see
-the @RefSect{tutorial, Tutorial} section).
-
-The maximum number of functions to overload is given by the
-@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}
-configuration macro.
-
-@Note In this documentation, <c>__function_type__</c> is a placeholder for a
-symbol that is specific to the implementation of this library.
-
-@See @RefSect{tutorial, Tutorial} section, @RefClass{overloaded_function},
-@RefMacro{BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX}.
-*/
-template<typename F1, typename F2, ...>
-overloaded_function<
- __function_type__<F1>, __function_type__<F2>, ...
-> make_overloaded_function(F1 f1, F2 f2, ...);
-
-} // namespace
-
-#endif // DOXYGEN
-
diff --git a/ndnboost/functional/overloaded_function/config.hpp b/ndnboost/functional/overloaded_function/config.hpp
deleted file mode 100644
index 33ff1b5..0000000
--- a/ndnboost/functional/overloaded_function/config.hpp
+++ /dev/null
@@ -1,50 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/functional/overloaded_function
-
-#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
-#define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_HPP_
-
-/** @file
-@brief Change the compile-time configuration of this library.
-*/
-
-/**
-@brief Specify the maximum number of arguments of the functions being
-overloaded.
-
-If this macro is left undefined by the user, it has a default value of 5
-(increasing this number might increase compilation time).
-When specified by the user, this macro must be a non-negative integer number.
-
-@See @RefSect{getting_started, Getting Started},
-@RefClass{ndnboost::overloaded_function}.
-*/
-#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX
-# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX 5
-#endif
-
-/**
-@brief Specify the maximum number of functions that can be overloaded.
-
-If this macro is left undefined by the user, it has a default value of 5
-(increasing this number might increase compilation time).
-When defined by the user, this macro must be an integer number greater or
-equal than 2 (because at least two distinct functions need to be specified in
-order to define an overload).
-
-@See @RefSect{getting_started, Getting Started},
-@RefClass{ndnboost::overloaded_function}.
-*/
-#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX
-# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX 5
-#endif
-#if BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_OVERLOAD_MAX < 2
-# error "maximum overload macro cannot be less than 2"
-#endif
-
-#endif // #include guard
-
diff --git a/ndnboost/functional/overloaded_function/detail/base.hpp b/ndnboost/functional/overloaded_function/detail/base.hpp
deleted file mode 100644
index c4cef04..0000000
--- a/ndnboost/functional/overloaded_function/detail/base.hpp
+++ /dev/null
@@ -1,86 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/functional/overloaded_function
-
-#if !BOOST_PP_IS_ITERATING
-# ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
-# define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_BASE_HPP_
-
-# include <ndnboost/functional/overloaded_function/config.hpp>
-# include <ndnboost/function.hpp>
-# include <ndnboost/preprocessor/iteration/iterate.hpp>
-# include <ndnboost/preprocessor/repetition/enum.hpp>
-# include <ndnboost/preprocessor/cat.hpp>
-# include <ndnboost/preprocessor/comma_if.hpp>
-
-#define BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
- BOOST_PP_CAT(A, n)
-
-#define BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused) \
- BOOST_PP_CAT(a, n)
-
-#define BOOST_FUNCTIONAL_DETAIL_arg_tparam(z, n, unused) \
- typename BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused)
-
-#define BOOST_FUNCTIONAL_DETAIL_arg(z, n, unused) \
- BOOST_FUNCTIONAL_DETAIL_arg_type(z, n, unused) \
- BOOST_FUNCTIONAL_DETAIL_arg_name(z, n, unused)
-
-#define BOOST_FUNCTIONAL_DETAIL_f \
- R (BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity, \
- BOOST_FUNCTIONAL_DETAIL_arg_type, ~))
-
-// Do not use namespace ::detail because overloaded_function is already a class.
-namespace ndnboost { namespace overloaded_function_detail {
-
-template<typename F>
-class base {}; // Empty template cannot be used directly (only its spec).
-
-# define BOOST_PP_ITERATION_PARAMS_1 \
- (3, (0, BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_CONFIG_ARITY_MAX, \
- "ndnboost/functional/overloaded_function/detail/base.hpp"))
-# include BOOST_PP_ITERATE() // Iterate over funciton arity.
-
-} } // namespace
-
-#undef BOOST_FUNCTIONAL_DETAIL_arg_type
-#undef BOOST_FUNCTIONAL_DETAIL_arg_name
-#undef BOOST_FUNCTIONAL_DETAIL_arg_tparam
-#undef BOOST_FUNCTIONAL_DETAIL_arg
-#undef BOOST_FUNCTIONAL_DETAIL_f
-
-# endif // #include guard
-
-#elif BOOST_PP_ITERATION_DEPTH() == 1
-# define BOOST_FUNCTIONAL_DETAIL_arity BOOST_PP_FRAME_ITERATION(1)
-
-template<
- typename R
- BOOST_PP_COMMA_IF(BOOST_FUNCTIONAL_DETAIL_arity)
- BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
- BOOST_FUNCTIONAL_DETAIL_arg_tparam, ~)
->
-class base< BOOST_FUNCTIONAL_DETAIL_f > {
-public:
- /* implicit */ inline base(
- // This requires specified type to be implicitly convertible to
- // a ndnboost::function<> functor.
- ndnboost::function< BOOST_FUNCTIONAL_DETAIL_f > const& f): f_(f)
- {}
-
- inline R operator()(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
- BOOST_FUNCTIONAL_DETAIL_arg, ~)) const {
- return f_(BOOST_PP_ENUM(BOOST_FUNCTIONAL_DETAIL_arity,
- BOOST_FUNCTIONAL_DETAIL_arg_name, ~));
- }
-
-private:
- ndnboost::function< BOOST_FUNCTIONAL_DETAIL_f > const f_;
-};
-
-# undef BOOST_FUNCTIONAL_DETAIL_arity
-#endif // iteration
-
diff --git a/ndnboost/functional/overloaded_function/detail/function_type.hpp b/ndnboost/functional/overloaded_function/detail/function_type.hpp
deleted file mode 100644
index 7119f93..0000000
--- a/ndnboost/functional/overloaded_function/detail/function_type.hpp
+++ /dev/null
@@ -1,85 +0,0 @@
-
-// Copyright (C) 2009-2012 Lorenzo Caminiti
-// Distributed under the Boost Software License, Version 1.0
-// (see accompanying file LICENSE_1_0.txt or a copy at
-// http://www.boost.org/LICENSE_1_0.txt)
-// Home at http://www.boost.org/libs/functional/overloaded_function
-
-#ifndef BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_FUNCTION_TYPE_HPP_
-#define BOOST_FUNCTIONAL_OVERLOADED_FUNCTION_DETAIL_FUNCTION_TYPE_HPP_
-
-#include <ndnboost/function_types/is_function.hpp>
-#include <ndnboost/function_types/is_function_pointer.hpp>
-#include <ndnboost/function_types/is_function_reference.hpp>
-#include <ndnboost/function_types/function_type.hpp>
-#include <ndnboost/function_types/parameter_types.hpp>
-#include <ndnboost/function_types/result_type.hpp>
-#include <ndnboost/type_traits/remove_pointer.hpp>
-#include <ndnboost/type_traits/remove_reference.hpp>
-#include <ndnboost/function.hpp>
-#include <ndnboost/mpl/if.hpp>
-#include <ndnboost/mpl/identity.hpp>
-#include <ndnboost/mpl/pop_front.hpp>
-#include <ndnboost/mpl/push_front.hpp>
-#include <ndnboost/typeof/typeof.hpp>
-
-// Do not use namespace ::detail because overloaded_function is already a class.
-namespace ndnboost { namespace overloaded_function_detail {
-
-// Requires: F is a monomorphic functor (i.e., has non-template `operator()`).
-// Returns: F's function type `result_type (arg1_type, arg2_type, ...)`.
-// It does not assume F typedef result_type, arg1_type, ... but needs typeof.
-template<typename F>
-class functor_type {
- // NOTE: clang does not accept extra parenthesis `&(...)`.
- typedef BOOST_TYPEOF_TPL(&F::operator()) call_ptr;
-public:
- typedef
- typename ndnboost::function_types::function_type<
- typename ndnboost::mpl::push_front<
- typename ndnboost::mpl::pop_front< // Remove functor type (1st).
- typename ndnboost::function_types::parameter_types<
- call_ptr>::type
- >::type
- , typename ndnboost::function_types::result_type<call_ptr>::type
- >::type
- >::type
- type;
-};
-
-// NOTE: When using ndnboost::function in Boost.Typeof emulation mode, the user
-// has to register ndnboost::functionN instead of ndnboost::function in oder to
-// do TYPEOF(F::operator()). That is confusing, so ndnboost::function is handled
-// separately so it does not require any Boost.Typeof registration at all.
-template<typename F>
-struct functor_type< ndnboost::function<F> > {
- typedef F type;
-};
-
-// Requires: F is a function type, pointer, reference, or monomorphic functor.
-// Returns: F's function type `result_type (arg1_type, arg2_type, ...)`.
-template<typename F>
-struct function_type {
- typedef
- typename ndnboost::mpl::if_<ndnboost::function_types::is_function<F>,
- ndnboost::mpl::identity<F>
- ,
- typename ndnboost::mpl::if_<ndnboost::function_types::
- is_function_pointer<F>,
- ndnboost::remove_pointer<F>
- ,
- typename ndnboost::mpl::if_<ndnboost::function_types::
- is_function_reference<F>,
- ndnboost::remove_reference<F>
- , // Else, requires that F is a functor.
- functor_type<F>
- >::type
- >::type
- >::type
- ::type type;
-};
-
-} } // namespace
-
-#endif // #include guard
-
diff --git a/ndnboost/functional/value_factory.hpp b/ndnboost/functional/value_factory.hpp
deleted file mode 100644
index c917519..0000000
--- a/ndnboost/functional/value_factory.hpp
+++ /dev/null
@@ -1,70 +0,0 @@
-/*=============================================================================
- Copyright (c) 2007 Tobias Schwinger
-
- 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_FUNCTIONAL_VALUE_FACTORY_HPP_INCLUDED
-# ifndef BOOST_PP_IS_ITERATING
-
-# include <ndnboost/preprocessor/iteration/iterate.hpp>
-# include <ndnboost/preprocessor/repetition/enum_params.hpp>
-# include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
-
-# include <new>
-# include <ndnboost/pointee.hpp>
-# include <ndnboost/none_t.hpp>
-# include <ndnboost/get_pointer.hpp>
-# include <ndnboost/non_type.hpp>
-# include <ndnboost/type_traits/remove_cv.hpp>
-
-# ifndef BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY
-# define BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY 10
-# elif BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY < 3
-# undef BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY
-# define BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY 3
-# endif
-
-namespace ndnboost
-{
- template< typename T >
- class value_factory;
-
- //----- ---- --- -- - - - -
-
- template< typename T >
- class value_factory
- {
- public:
- typedef T result_type;
-
- value_factory()
- { }
-
-# define BOOST_PP_FILENAME_1 <ndnboost/functional/value_factory.hpp>
-# define BOOST_PP_ITERATION_LIMITS (0,BOOST_FUNCTIONAL_VALUE_FACTORY_MAX_ARITY)
-# include BOOST_PP_ITERATE()
- };
-
- template< typename T > class value_factory<T&>;
- // forbidden, would create a dangling reference
-}
-# define BOOST_FUNCTIONAL_VALUE_FACTORY_HPP_INCLUDED
-# else // defined(BOOST_PP_IS_ITERATING)
-
-# define N BOOST_PP_ITERATION()
-# if N > 0
- template< BOOST_PP_ENUM_PARAMS(N, typename T) >
-# endif
- inline result_type operator()(BOOST_PP_ENUM_BINARY_PARAMS(N,T,& a)) const
- {
- return result_type(BOOST_PP_ENUM_PARAMS(N,a));
- }
-# undef N
-
-# endif // defined(BOOST_PP_IS_ITERATING)
-
-#endif // include guard
-
diff --git a/ndnboost/indirect_reference.hpp b/ndnboost/indirect_reference.hpp
new file mode 100644
index 0000000..fdd5e72
--- /dev/null
+++ b/ndnboost/indirect_reference.hpp
@@ -0,0 +1,43 @@
+#ifndef INDIRECT_REFERENCE_DWA200415_HPP
+# define INDIRECT_REFERENCE_DWA200415_HPP
+
+//
+// Copyright David Abrahams 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)
+//
+// typename indirect_reference<P>::type provides the type of *p.
+//
+// http://www.boost.org/libs/iterator/doc/pointee.html
+//
+
+# include <ndnboost/detail/is_incrementable.hpp>
+# include <ndnboost/iterator/iterator_traits.hpp>
+# include <ndnboost/type_traits/remove_cv.hpp>
+# include <ndnboost/mpl/eval_if.hpp>
+# include <ndnboost/pointee.hpp>
+
+namespace ndnboost {
+
+namespace detail
+{
+ template <class P>
+ struct smart_ptr_reference
+ {
+ typedef typename ndnboost::pointee<P>::type& type;
+ };
+}
+
+template <class P>
+struct indirect_reference
+ : mpl::eval_if<
+ detail::is_incrementable<P>
+ , iterator_reference<P>
+ , detail::smart_ptr_reference<P>
+ >
+{
+};
+
+} // namespace ndnboost
+
+#endif // INDIRECT_REFERENCE_DWA200415_HPP
diff --git a/ndnboost/io/ios_state.hpp b/ndnboost/io/ios_state.hpp
new file mode 100644
index 0000000..bee1422
--- /dev/null
+++ b/ndnboost/io/ios_state.hpp
@@ -0,0 +1,439 @@
+// Boost io/ios_state.hpp header file --------------------------------------//
+
+// Copyright 2002, 2005 Daryle Walker. Use, modification, and distribution
+// are subject to the Boost Software License, Version 1.0. (See accompanying
+// file LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
+
+// See <http://www.boost.org/libs/io/> for the library's home page.
+
+#ifndef BOOST_IO_IOS_STATE_HPP
+#define BOOST_IO_IOS_STATE_HPP
+
+#include <ndnboost/io_fwd.hpp> // self include
+#include <ndnboost/detail/workaround.hpp>
+
+#include <ios> // for std::ios_base, std::basic_ios, etc.
+#ifndef BOOST_NO_STD_LOCALE
+#include <locale> // for std::locale
+#endif
+#include <ostream> // for std::basic_ostream
+#include <streambuf> // for std::basic_streambuf
+#include <string> // for std::char_traits
+
+
+namespace ndnboost
+{
+namespace io
+{
+
+
+// Basic stream state saver class declarations -----------------------------//
+
+class ios_flags_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+ typedef ::std::ios_base::fmtflags aspect_type;
+
+ explicit ios_flags_saver( state_type &s )
+ : s_save_( s ), a_save_( s.flags() )
+ {}
+ ios_flags_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.flags(a) )
+ {}
+ ~ios_flags_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.flags( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+
+ ios_flags_saver& operator=(const ios_flags_saver&);
+};
+
+class ios_precision_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+ typedef ::std::streamsize aspect_type;
+
+ explicit ios_precision_saver( state_type &s )
+ : s_save_( s ), a_save_( s.precision() )
+ {}
+ ios_precision_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.precision(a) )
+ {}
+ ~ios_precision_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.precision( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+
+ ios_precision_saver& operator=(const ios_precision_saver&);
+};
+
+class ios_width_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+ typedef ::std::streamsize aspect_type;
+
+ explicit ios_width_saver( state_type &s )
+ : s_save_( s ), a_save_( s.width() )
+ {}
+ ios_width_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.width(a) )
+ {}
+ ~ios_width_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.width( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ ios_width_saver& operator=(const ios_width_saver&);
+};
+
+
+// Advanced stream state saver class template declarations -----------------//
+
+template < typename Ch, class Tr >
+class basic_ios_iostate_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+ typedef ::std::ios_base::iostate aspect_type;
+
+ explicit basic_ios_iostate_saver( state_type &s )
+ : s_save_( s ), a_save_( s.rdstate() )
+ {}
+ basic_ios_iostate_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.rdstate() )
+ { s.clear(a); }
+ ~basic_ios_iostate_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.clear( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ basic_ios_iostate_saver& operator=(const basic_ios_iostate_saver&);
+};
+
+template < typename Ch, class Tr >
+class basic_ios_exception_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+ typedef ::std::ios_base::iostate aspect_type;
+
+ explicit basic_ios_exception_saver( state_type &s )
+ : s_save_( s ), a_save_( s.exceptions() )
+ {}
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ basic_ios_exception_saver( state_type &s, aspect_type a )
+#else
+ basic_ios_exception_saver( state_type &s, aspect_type const &a )
+#endif
+ : s_save_( s ), a_save_( s.exceptions() )
+ { s.exceptions(a); }
+ ~basic_ios_exception_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.exceptions( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ basic_ios_exception_saver& operator=(const basic_ios_exception_saver&);
+};
+
+template < typename Ch, class Tr >
+class basic_ios_tie_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+ typedef ::std::basic_ostream<Ch, Tr> * aspect_type;
+
+ explicit basic_ios_tie_saver( state_type &s )
+ : s_save_( s ), a_save_( s.tie() )
+ {}
+ basic_ios_tie_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.tie(a) )
+ {}
+ ~basic_ios_tie_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.tie( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ basic_ios_tie_saver& operator=(const basic_ios_tie_saver&);
+};
+
+template < typename Ch, class Tr >
+class basic_ios_rdbuf_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+ typedef ::std::basic_streambuf<Ch, Tr> * aspect_type;
+
+ explicit basic_ios_rdbuf_saver( state_type &s )
+ : s_save_( s ), a_save_( s.rdbuf() )
+ {}
+ basic_ios_rdbuf_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.rdbuf(a) )
+ {}
+ ~basic_ios_rdbuf_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.rdbuf( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ basic_ios_rdbuf_saver& operator=(const basic_ios_rdbuf_saver&);
+};
+
+template < typename Ch, class Tr >
+class basic_ios_fill_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+ typedef typename state_type::char_type aspect_type;
+
+ explicit basic_ios_fill_saver( state_type &s )
+ : s_save_( s ), a_save_( s.fill() )
+ {}
+ basic_ios_fill_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.fill(a) )
+ {}
+ ~basic_ios_fill_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.fill( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ basic_ios_fill_saver& operator=(const basic_ios_fill_saver&);
+};
+
+#ifndef BOOST_NO_STD_LOCALE
+template < typename Ch, class Tr >
+class basic_ios_locale_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+ typedef ::std::locale aspect_type;
+
+ explicit basic_ios_locale_saver( state_type &s )
+ : s_save_( s ), a_save_( s.getloc() )
+ {}
+ basic_ios_locale_saver( state_type &s, aspect_type const &a )
+ : s_save_( s ), a_save_( s.imbue(a) )
+ {}
+ ~basic_ios_locale_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.imbue( a_save_ ); }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ basic_ios_locale_saver& operator=(const basic_ios_locale_saver&);
+};
+#endif
+
+
+// User-defined stream state saver class declarations ----------------------//
+
+class ios_iword_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+ typedef int index_type;
+ typedef long aspect_type;
+
+ explicit ios_iword_saver( state_type &s, index_type i )
+ : s_save_( s ), a_save_( s.iword(i) ), i_save_( i )
+ {}
+ ios_iword_saver( state_type &s, index_type i, aspect_type const &a )
+ : s_save_( s ), a_save_( s.iword(i) ), i_save_( i )
+ { s.iword(i) = a; }
+ ~ios_iword_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.iword( i_save_ ) = a_save_; }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ index_type const i_save_;
+
+ ios_iword_saver& operator=(const ios_iword_saver&);
+};
+
+class ios_pword_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+ typedef int index_type;
+ typedef void * aspect_type;
+
+ explicit ios_pword_saver( state_type &s, index_type i )
+ : s_save_( s ), a_save_( s.pword(i) ), i_save_( i )
+ {}
+ ios_pword_saver( state_type &s, index_type i, aspect_type const &a )
+ : s_save_( s ), a_save_( s.pword(i) ), i_save_( i )
+ { s.pword(i) = a; }
+ ~ios_pword_saver()
+ { this->restore(); }
+
+ void restore()
+ { s_save_.pword( i_save_ ) = a_save_; }
+
+private:
+ state_type & s_save_;
+ aspect_type const a_save_;
+ index_type const i_save_;
+
+ ios_pword_saver operator=(const ios_pword_saver&);
+};
+
+
+// Combined stream state saver class (template) declarations ---------------//
+
+class ios_base_all_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+
+ explicit ios_base_all_saver( state_type &s )
+ : s_save_( s ), a1_save_( s.flags() ), a2_save_( s.precision() )
+ , a3_save_( s.width() )
+ {}
+
+ ~ios_base_all_saver()
+ { this->restore(); }
+
+ void restore()
+ {
+ s_save_.width( a3_save_ );
+ s_save_.precision( a2_save_ );
+ s_save_.flags( a1_save_ );
+ }
+
+private:
+ state_type & s_save_;
+ state_type::fmtflags const a1_save_;
+ ::std::streamsize const a2_save_;
+ ::std::streamsize const a3_save_;
+
+ ios_base_all_saver& operator=(const ios_base_all_saver&);
+};
+
+template < typename Ch, class Tr >
+class basic_ios_all_saver
+{
+public:
+ typedef ::std::basic_ios<Ch, Tr> state_type;
+
+ explicit basic_ios_all_saver( state_type &s )
+ : s_save_( s ), a1_save_( s.flags() ), a2_save_( s.precision() )
+ , a3_save_( s.width() ), a4_save_( s.rdstate() )
+ , a5_save_( s.exceptions() ), a6_save_( s.tie() )
+ , a7_save_( s.rdbuf() ), a8_save_( s.fill() )
+ #ifndef BOOST_NO_STD_LOCALE
+ , a9_save_( s.getloc() )
+ #endif
+ {}
+
+ ~basic_ios_all_saver()
+ { this->restore(); }
+
+ void restore()
+ {
+ #ifndef BOOST_NO_STD_LOCALE
+ s_save_.imbue( a9_save_ );
+ #endif
+ s_save_.fill( a8_save_ );
+ s_save_.rdbuf( a7_save_ );
+ s_save_.tie( a6_save_ );
+ s_save_.exceptions( a5_save_ );
+ s_save_.clear( a4_save_ );
+ s_save_.width( a3_save_ );
+ s_save_.precision( a2_save_ );
+ s_save_.flags( a1_save_ );
+ }
+
+private:
+ state_type & s_save_;
+ typename state_type::fmtflags const a1_save_;
+ ::std::streamsize const a2_save_;
+ ::std::streamsize const a3_save_;
+ typename state_type::iostate const a4_save_;
+ typename state_type::iostate const a5_save_;
+ ::std::basic_ostream<Ch, Tr> * const a6_save_;
+ ::std::basic_streambuf<Ch, Tr> * const a7_save_;
+ typename state_type::char_type const a8_save_;
+ #ifndef BOOST_NO_STD_LOCALE
+ ::std::locale const a9_save_;
+ #endif
+
+ basic_ios_all_saver& operator=(const basic_ios_all_saver&);
+};
+
+class ios_all_word_saver
+{
+public:
+ typedef ::std::ios_base state_type;
+ typedef int index_type;
+
+ ios_all_word_saver( state_type &s, index_type i )
+ : s_save_( s ), i_save_( i ), a1_save_( s.iword(i) )
+ , a2_save_( s.pword(i) )
+ {}
+
+ ~ios_all_word_saver()
+ { this->restore(); }
+
+ void restore()
+ {
+ s_save_.pword( i_save_ ) = a2_save_;
+ s_save_.iword( i_save_ ) = a1_save_;
+ }
+
+private:
+ state_type & s_save_;
+ index_type const i_save_;
+ long const a1_save_;
+ void * const a2_save_;
+
+ ios_all_word_saver& operator=(const ios_all_word_saver&);
+};
+
+
+} // namespace io
+} // namespace ndnboost
+
+
+#endif // BOOST_IO_IOS_STATE_HPP
diff --git a/ndnboost/io_fwd.hpp b/ndnboost/io_fwd.hpp
new file mode 100644
index 0000000..c58e9e3
--- /dev/null
+++ b/ndnboost/io_fwd.hpp
@@ -0,0 +1,67 @@
+// Boost io_fwd.hpp header file --------------------------------------------//
+
+// Copyright 2002 Daryle Walker. Use, modification, and distribution are subject
+// to the Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
+
+// See <http://www.boost.org/libs/io/> for the library's home page.
+
+#ifndef BOOST_IO_FWD_HPP
+#define BOOST_IO_FWD_HPP
+
+#include <iosfwd> // for std::char_traits (declaration)
+
+
+namespace ndnboost
+{
+namespace io
+{
+
+
+// From <ndnboost/io/ios_state.hpp> -------------------------------------------//
+
+class ios_flags_saver;
+class ios_precision_saver;
+class ios_width_saver;
+class ios_base_all_saver;
+
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_iostate_saver;
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_exception_saver;
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_tie_saver;
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_rdbuf_saver;
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_fill_saver;
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_locale_saver;
+template < typename Ch, class Tr = ::std::char_traits<Ch> >
+ class basic_ios_all_saver;
+
+typedef basic_ios_iostate_saver<char> ios_iostate_saver;
+typedef basic_ios_iostate_saver<wchar_t> wios_iostate_saver;
+typedef basic_ios_exception_saver<char> ios_exception_saver;
+typedef basic_ios_exception_saver<wchar_t> wios_exception_saver;
+typedef basic_ios_tie_saver<char> ios_tie_saver;
+typedef basic_ios_tie_saver<wchar_t> wios_tie_saver;
+typedef basic_ios_rdbuf_saver<char> ios_rdbuf_saver;
+typedef basic_ios_rdbuf_saver<wchar_t> wios_rdbuf_saver;
+typedef basic_ios_fill_saver<char> ios_fill_saver;
+typedef basic_ios_fill_saver<wchar_t> wios_fill_saver;
+typedef basic_ios_locale_saver<char> ios_locale_saver;
+typedef basic_ios_locale_saver<wchar_t> wios_locale_saver;
+typedef basic_ios_all_saver<char> ios_all_saver;
+typedef basic_ios_all_saver<wchar_t> wios_all_saver;
+
+class ios_iword_saver;
+class ios_pword_saver;
+class ios_all_word_saver;
+
+
+} // namespace io
+} // namespace ndnboost
+
+
+#endif // BOOST_IO_FWD_HPP
diff --git a/ndnboost/is_placeholder.hpp b/ndnboost/is_placeholder.hpp
new file mode 100644
index 0000000..e358ca6
--- /dev/null
+++ b/ndnboost/is_placeholder.hpp
@@ -0,0 +1,31 @@
+#ifndef BOOST_IS_PLACEHOLDER_HPP_INCLUDED
+#define BOOST_IS_PLACEHOLDER_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined( _MSC_VER ) && ( _MSC_VER >= 1020 )
+# pragma once
+#endif
+
+
+// is_placeholder.hpp - TR1 is_placeholder metafunction
+//
+// Copyright (c) 2006 Peter Dimov
+//
+// 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
+
+
+namespace ndnboost
+{
+
+template< class T > struct is_placeholder
+{
+ enum _vt { value = 0 };
+};
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_IS_PLACEHOLDER_HPP_INCLUDED
diff --git a/ndnboost/iterator/detail/enable_if.hpp b/ndnboost/iterator/detail/enable_if.hpp
new file mode 100644
index 0000000..1b26330
--- /dev/null
+++ b/ndnboost/iterator/detail/enable_if.hpp
@@ -0,0 +1,86 @@
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// 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)
+#ifndef BOOST_ENABLE_IF_23022003THW_HPP
+#define BOOST_ENABLE_IF_23022003THW_HPP
+
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/mpl/identity.hpp>
+
+#include <ndnboost/iterator/detail/config_def.hpp>
+
+//
+// Boost iterators uses its own enable_if cause we need
+// special semantics for deficient compilers.
+// 23/02/03 thw
+//
+
+namespace ndnboost
+{
+
+ namespace iterators
+ {
+ //
+ // Base machinery for all kinds of enable if
+ //
+ template<bool>
+ struct enabled
+ {
+ template<typename T>
+ struct base
+ {
+ typedef T type;
+ };
+ };
+
+ //
+ // For compilers that don't support "Substitution Failure Is Not An Error"
+ // enable_if falls back to always enabled. See comments
+ // on operator implementation for consequences.
+ //
+ template<>
+ struct enabled<false>
+ {
+ template<typename T>
+ struct base
+ {
+#ifdef BOOST_NO_SFINAE
+
+ typedef T type;
+
+ // This way to do it would give a nice error message containing
+ // invalid overload, but has the big disadvantage that
+ // there is no reference to user code in the error message.
+ //
+ // struct invalid_overload;
+ // typedef invalid_overload type;
+ //
+#endif
+ };
+ };
+
+
+ template <class Cond,
+ class Return>
+ struct enable_if
+# if !defined(BOOST_NO_SFINAE) && !defined(BOOST_NO_IS_CONVERTIBLE)
+ : enabled<(Cond::value)>::template base<Return>
+# else
+ : mpl::identity<Return>
+# endif
+ {
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ typedef Return type;
+# endif
+ };
+
+ } // namespace iterators
+
+} // namespace ndnboost
+
+#include <ndnboost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ENABLE_IF_23022003THW_HPP
diff --git a/ndnboost/iterator/detail/facade_iterator_category.hpp b/ndnboost/iterator/detail/facade_iterator_category.hpp
new file mode 100644
index 0000000..fa21f5a
--- /dev/null
+++ b/ndnboost/iterator/detail/facade_iterator_category.hpp
@@ -0,0 +1,200 @@
+// Copyright David Abrahams 2003. 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)
+#ifndef FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
+# define FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
+
+# include <ndnboost/iterator/iterator_categories.hpp>
+
+# include <ndnboost/mpl/or.hpp> // used in iterator_tag inheritance logic
+# include <ndnboost/mpl/and.hpp>
+# include <ndnboost/mpl/if.hpp>
+# include <ndnboost/mpl/eval_if.hpp>
+# include <ndnboost/mpl/identity.hpp>
+# include <ndnboost/mpl/assert.hpp>
+
+# include <ndnboost/type_traits/is_same.hpp>
+# include <ndnboost/type_traits/is_const.hpp>
+# include <ndnboost/type_traits/is_reference.hpp>
+# include <ndnboost/type_traits/is_convertible.hpp>
+
+# include <ndnboost/type_traits/is_same.hpp>
+
+# include <ndnboost/iterator/detail/config_def.hpp> // try to keep this last
+
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+# include <ndnboost/detail/indirect_traits.hpp>
+# endif
+
+//
+// iterator_category deduction for iterator_facade
+//
+
+// forward declaration
+namespace ndnboost { struct use_default; }
+
+namespace ndnboost { namespace detail {
+
+struct input_output_iterator_tag
+ : std::input_iterator_tag
+{
+ // Using inheritance for only input_iterator_tag helps to avoid
+ // ambiguities when a stdlib implementation dispatches on a
+ // function which is overloaded on both input_iterator_tag and
+ // output_iterator_tag, as STLPort does, in its __valid_range
+ // function. I claim it's better to avoid the ambiguity in these
+ // cases.
+ operator std::output_iterator_tag() const
+ {
+ return std::output_iterator_tag();
+ }
+};
+
+//
+// True iff the user has explicitly disabled writability of this
+// iterator. Pass the iterator_facade's Value parameter and its
+// nested ::reference type.
+//
+template <class ValueParam, class Reference>
+struct iterator_writability_disabled
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY // Adding Thomas' logic?
+ : mpl::or_<
+ is_const<Reference>
+ , ndnboost::detail::indirect_traits::is_reference_to_const<Reference>
+ , is_const<ValueParam>
+ >
+# else
+ : is_const<ValueParam>
+# endif
+{};
+
+
+//
+// Convert an iterator_facade's traversal category, Value parameter,
+// and ::reference type to an appropriate old-style category.
+//
+// If writability has been disabled per the above metafunction, the
+// result will not be convertible to output_iterator_tag.
+//
+// Otherwise, if Traversal == single_pass_traversal_tag, the following
+// conditions will result in a tag that is convertible both to
+// input_iterator_tag and output_iterator_tag:
+//
+// 1. Reference is a reference to non-const
+// 2. Reference is not a reference and is convertible to Value
+//
+template <class Traversal, class ValueParam, class Reference>
+struct iterator_facade_default_category
+ : mpl::eval_if<
+ mpl::and_<
+ is_reference<Reference>
+ , is_convertible<Traversal,forward_traversal_tag>
+ >
+ , mpl::eval_if<
+ is_convertible<Traversal,random_access_traversal_tag>
+ , mpl::identity<std::random_access_iterator_tag>
+ , mpl::if_<
+ is_convertible<Traversal,bidirectional_traversal_tag>
+ , std::bidirectional_iterator_tag
+ , std::forward_iterator_tag
+ >
+ >
+ , typename mpl::eval_if<
+ mpl::and_<
+ is_convertible<Traversal, single_pass_traversal_tag>
+
+ // check for readability
+ , is_convertible<Reference, ValueParam>
+ >
+ , mpl::identity<std::input_iterator_tag>
+ , mpl::identity<Traversal>
+ >
+ >
+{
+};
+
+// True iff T is convertible to an old-style iterator category.
+template <class T>
+struct is_iterator_category
+ : mpl::or_<
+ is_convertible<T,std::input_iterator_tag>
+ , is_convertible<T,std::output_iterator_tag>
+ >
+{
+};
+
+template <class T>
+struct is_iterator_traversal
+ : is_convertible<T,incrementable_traversal_tag>
+{};
+
+//
+// A composite iterator_category tag convertible to Category (a pure
+// old-style category) and Traversal (a pure traversal tag).
+// Traversal must be a strict increase of the traversal power given by
+// Category.
+//
+template <class Category, class Traversal>
+struct iterator_category_with_traversal
+ : Category, Traversal
+{
+# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ // Make sure this isn't used to build any categories where
+ // convertibility to Traversal is redundant. Should just use the
+ // Category element in that case.
+ BOOST_MPL_ASSERT_NOT((
+ is_convertible<
+ typename iterator_category_to_traversal<Category>::type
+ , Traversal
+ >));
+
+ BOOST_MPL_ASSERT((is_iterator_category<Category>));
+ BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
+ BOOST_MPL_ASSERT_NOT((is_iterator_traversal<Category>));
+# if !BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
+ BOOST_MPL_ASSERT((is_iterator_traversal<Traversal>));
+# endif
+# endif
+};
+
+// Computes an iterator_category tag whose traversal is Traversal and
+// which is appropriate for an iterator
+template <class Traversal, class ValueParam, class Reference>
+struct facade_iterator_category_impl
+{
+# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ BOOST_MPL_ASSERT_NOT((is_iterator_category<Traversal>));
+# endif
+
+ typedef typename iterator_facade_default_category<
+ Traversal,ValueParam,Reference
+ >::type category;
+
+ typedef typename mpl::if_<
+ is_same<
+ Traversal
+ , typename iterator_category_to_traversal<category>::type
+ >
+ , category
+ , iterator_category_with_traversal<category,Traversal>
+ >::type type;
+};
+
+//
+// Compute an iterator_category for iterator_facade
+//
+template <class CategoryOrTraversal, class ValueParam, class Reference>
+struct facade_iterator_category
+ : mpl::eval_if<
+ is_iterator_category<CategoryOrTraversal>
+ , mpl::identity<CategoryOrTraversal> // old-style categories are fine as-is
+ , facade_iterator_category_impl<CategoryOrTraversal,ValueParam,Reference>
+ >
+{
+};
+
+}} // namespace ndnboost::detail
+
+# include <ndnboost/iterator/detail/config_undef.hpp>
+
+#endif // FACADE_ITERATOR_CATEGORY_DWA20031118_HPP
diff --git a/ndnboost/iterator/interoperable.hpp b/ndnboost/iterator/interoperable.hpp
new file mode 100644
index 0000000..daede1c
--- /dev/null
+++ b/ndnboost/iterator/interoperable.hpp
@@ -0,0 +1,50 @@
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// 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)
+#ifndef BOOST_INTEROPERABLE_23022003THW_HPP
+# define BOOST_INTEROPERABLE_23022003THW_HPP
+
+# include <ndnboost/mpl/bool.hpp>
+# include <ndnboost/mpl/or.hpp>
+
+# include <ndnboost/type_traits/is_convertible.hpp>
+
+# include <ndnboost/iterator/detail/config_def.hpp> // must appear last
+
+namespace ndnboost
+{
+
+ //
+ // Meta function that determines whether two
+ // iterator types are considered interoperable.
+ //
+ // Two iterator types A,B are considered interoperable if either
+ // A is convertible to B or vice versa.
+ // This interoperability definition is in sync with the
+ // standards requirements on constant/mutable container
+ // iterators (23.1 [lib.container.requirements]).
+ //
+ // For compilers that don't support is_convertible
+ // is_interoperable gives false positives. See comments
+ // on operator implementation for consequences.
+ //
+ template <typename A, typename B>
+ struct is_interoperable
+# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
+ : mpl::true_
+# else
+ : mpl::or_<
+ is_convertible< A, B >
+ , is_convertible< B, A > >
+# endif
+ {
+ };
+
+} // namespace ndnboost
+
+# include <ndnboost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_INTEROPERABLE_23022003THW_HPP
diff --git a/ndnboost/iterator/iterator_adaptor.hpp b/ndnboost/iterator/iterator_adaptor.hpp
new file mode 100644
index 0000000..59aafbf
--- /dev/null
+++ b/ndnboost/iterator/iterator_adaptor.hpp
@@ -0,0 +1,365 @@
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// 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)
+#ifndef BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
+#define BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
+
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/iterator.hpp>
+#include <ndnboost/detail/iterator.hpp>
+
+#include <ndnboost/iterator/iterator_categories.hpp>
+#include <ndnboost/iterator/iterator_facade.hpp>
+#include <ndnboost/iterator/detail/enable_if.hpp>
+
+#include <ndnboost/mpl/and.hpp>
+#include <ndnboost/mpl/not.hpp>
+#include <ndnboost/mpl/or.hpp>
+
+#include <ndnboost/type_traits/is_same.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+
+#ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+# include <ndnboost/type_traits/remove_reference.hpp>
+#endif
+
+#include <ndnboost/type_traits/add_reference.hpp>
+#include <ndnboost/iterator/detail/config_def.hpp>
+
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+namespace ndnboost
+{
+ // Used as a default template argument internally, merely to
+ // indicate "use the default", this can also be passed by users
+ // explicitly in order to specify that the default should be used.
+ struct use_default;
+
+# ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ // the incompleteness of use_default causes massive problems for
+ // is_convertible (naturally). This workaround is fortunately not
+ // needed for vc6/vc7.
+ template<class To>
+ struct is_convertible<use_default,To>
+ : mpl::false_ {};
+# endif
+
+ namespace detail
+ {
+
+ //
+ // Result type used in enable_if_convertible meta function.
+ // This can be an incomplete type, as only pointers to
+ // enable_if_convertible< ... >::type are used.
+ // We could have used void for this, but conversion to
+ // void* is just to easy.
+ //
+ struct enable_type;
+ }
+
+
+ //
+ // enable_if for use in adapted iterators constructors.
+ //
+ // In order to provide interoperability between adapted constant and
+ // mutable iterators, adapted iterators will usually provide templated
+ // conversion constructors of the following form
+ //
+ // template <class BaseIterator>
+ // class adapted_iterator :
+ // public iterator_adaptor< adapted_iterator<Iterator>, Iterator >
+ // {
+ // public:
+ //
+ // ...
+ //
+ // template <class OtherIterator>
+ // adapted_iterator(
+ // OtherIterator const& it
+ // , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0);
+ //
+ // ...
+ // };
+ //
+ // enable_if_convertible is used to remove those overloads from the overload
+ // set that cannot be instantiated. For all practical purposes only overloads
+ // for constant/mutable interaction will remain. This has the advantage that
+ // meta functions like ndnboost::is_convertible do not return false positives,
+ // as they can only look at the signature of the conversion constructor
+ // and not at the actual instantiation.
+ //
+ // enable_if_interoperable can be safely used in user code. It falls back to
+ // always enabled for compilers that don't support enable_if or is_convertible.
+ // There is no need for compiler specific workarounds in user code.
+ //
+ // The operators implementation relies on ndnboost::is_convertible not returning
+ // false positives for user/library defined iterator types. See comments
+ // on operator implementation for consequences.
+ //
+# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+
+ template<typename From, typename To>
+ struct enable_if_convertible
+ {
+ typedef typename mpl::if_<
+ mpl::or_<
+ is_same<From,To>
+ , is_convertible<From, To>
+ >
+ , ndnboost::detail::enable_type
+ , int&
+ >::type type;
+ };
+
+# elif defined(BOOST_NO_IS_CONVERTIBLE) || defined(BOOST_NO_SFINAE)
+
+ template <class From, class To>
+ struct enable_if_convertible
+ {
+ typedef ndnboost::detail::enable_type type;
+ };
+
+# elif BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300
+
+ // For some reason vc7.1 needs us to "cut off" instantiation
+ // of is_convertible in a few cases.
+ template<typename From, typename To>
+ struct enable_if_convertible
+ : iterators::enable_if<
+ mpl::or_<
+ is_same<From,To>
+ , is_convertible<From, To>
+ >
+ , ndnboost::detail::enable_type
+ >
+ {};
+
+# else
+
+ template<typename From, typename To>
+ struct enable_if_convertible
+ : iterators::enable_if<
+ is_convertible<From, To>
+ , ndnboost::detail::enable_type
+ >
+ {};
+
+# endif
+
+ //
+ // Default template argument handling for iterator_adaptor
+ //
+ namespace detail
+ {
+ // If T is use_default, return the result of invoking
+ // DefaultNullaryFn, otherwise return T.
+ template <class T, class DefaultNullaryFn>
+ struct ia_dflt_help
+ : mpl::eval_if<
+ is_same<T, use_default>
+ , DefaultNullaryFn
+ , mpl::identity<T>
+ >
+ {
+ };
+
+ // A metafunction which computes an iterator_adaptor's base class,
+ // a specialization of iterator_facade.
+ template <
+ class Derived
+ , class Base
+ , class Value
+ , class Traversal
+ , class Reference
+ , class Difference
+ >
+ struct iterator_adaptor_base
+ {
+ typedef iterator_facade<
+ Derived
+
+# ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
+ , typename ndnboost::detail::ia_dflt_help<
+ Value
+ , mpl::eval_if<
+ is_same<Reference,use_default>
+ , iterator_value<Base>
+ , remove_reference<Reference>
+ >
+ >::type
+# else
+ , typename ndnboost::detail::ia_dflt_help<
+ Value, iterator_value<Base>
+ >::type
+# endif
+
+ , typename ndnboost::detail::ia_dflt_help<
+ Traversal
+ , iterator_traversal<Base>
+ >::type
+
+ , typename ndnboost::detail::ia_dflt_help<
+ Reference
+ , mpl::eval_if<
+ is_same<Value,use_default>
+ , iterator_reference<Base>
+ , add_reference<Value>
+ >
+ >::type
+
+ , typename ndnboost::detail::ia_dflt_help<
+ Difference, iterator_difference<Base>
+ >::type
+ >
+ type;
+ };
+
+ // workaround for aC++ CR JAGaf33512
+ template <class Tr1, class Tr2>
+ inline void iterator_adaptor_assert_traversal ()
+ {
+ BOOST_STATIC_ASSERT((is_convertible<Tr1, Tr2>::value));
+ }
+ }
+
+ //
+ // Iterator Adaptor
+ //
+ // The parameter ordering changed slightly with respect to former
+ // versions of iterator_adaptor The idea is that when the user needs
+ // to fiddle with the reference type it is highly likely that the
+ // iterator category has to be adjusted as well. Any of the
+ // following four template arguments may be ommitted or explicitly
+ // replaced by use_default.
+ //
+ // Value - if supplied, the value_type of the resulting iterator, unless
+ // const. If const, a conforming compiler strips constness for the
+ // value_type. If not supplied, iterator_traits<Base>::value_type is used
+ //
+ // Category - the traversal category of the resulting iterator. If not
+ // supplied, iterator_traversal<Base>::type is used.
+ //
+ // Reference - the reference type of the resulting iterator, and in
+ // particular, the result type of operator*(). If not supplied but
+ // Value is supplied, Value& is used. Otherwise
+ // iterator_traits<Base>::reference is used.
+ //
+ // Difference - the difference_type of the resulting iterator. If not
+ // supplied, iterator_traits<Base>::difference_type is used.
+ //
+ template <
+ class Derived
+ , class Base
+ , class Value = use_default
+ , class Traversal = use_default
+ , class Reference = use_default
+ , class Difference = use_default
+ >
+ class iterator_adaptor
+ : public ndnboost::detail::iterator_adaptor_base<
+ Derived, Base, Value, Traversal, Reference, Difference
+ >::type
+ {
+ friend class iterator_core_access;
+
+ protected:
+ typedef typename ndnboost::detail::iterator_adaptor_base<
+ Derived, Base, Value, Traversal, Reference, Difference
+ >::type super_t;
+ public:
+ iterator_adaptor() {}
+
+ explicit iterator_adaptor(Base const &iter)
+ : m_iterator(iter)
+ {
+ }
+
+ typedef Base base_type;
+
+ Base const& base() const
+ { return m_iterator; }
+
+ protected:
+ // for convenience in derived classes
+ typedef iterator_adaptor<Derived,Base,Value,Traversal,Reference,Difference> iterator_adaptor_;
+
+ //
+ // lvalue access to the Base object for Derived
+ //
+ Base const& base_reference() const
+ { return m_iterator; }
+
+ Base& base_reference()
+ { return m_iterator; }
+
+ private:
+ //
+ // Core iterator interface for iterator_facade. This is private
+ // to prevent temptation for Derived classes to use it, which
+ // will often result in an error. Derived classes should use
+ // base_reference(), above, to get direct access to m_iterator.
+ //
+ typename super_t::reference dereference() const
+ { return *m_iterator; }
+
+ template <
+ class OtherDerived, class OtherIterator, class V, class C, class R, class D
+ >
+ bool equal(iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& x) const
+ {
+ // Maybe readd with same_distance
+ // BOOST_STATIC_ASSERT(
+ // (detail::same_category_and_difference<Derived,OtherDerived>::value)
+ // );
+ return m_iterator == x.base();
+ }
+
+ typedef typename iterator_category_to_traversal<
+ typename super_t::iterator_category
+ >::type my_traversal;
+
+# define BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(cat) \
+ ndnboost::detail::iterator_adaptor_assert_traversal<my_traversal, cat>();
+
+ void advance(typename super_t::difference_type n)
+ {
+ BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(random_access_traversal_tag)
+ m_iterator += n;
+ }
+
+ void increment() { ++m_iterator; }
+
+ void decrement()
+ {
+ BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(bidirectional_traversal_tag)
+ --m_iterator;
+ }
+
+ template <
+ class OtherDerived, class OtherIterator, class V, class C, class R, class D
+ >
+ typename super_t::difference_type distance_to(
+ iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> const& y) const
+ {
+ BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL(random_access_traversal_tag)
+ // Maybe readd with same_distance
+ // BOOST_STATIC_ASSERT(
+ // (detail::same_category_and_difference<Derived,OtherDerived>::value)
+ // );
+ return y.base() - m_iterator;
+ }
+
+# undef BOOST_ITERATOR_ADAPTOR_ASSERT_TRAVERSAL
+
+ private: // data members
+ Base m_iterator;
+ };
+
+} // namespace ndnboost
+
+#include <ndnboost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ITERATOR_ADAPTOR_23022003THW_HPP
diff --git a/ndnboost/iterator/iterator_concepts.hpp b/ndnboost/iterator/iterator_concepts.hpp
new file mode 100644
index 0000000..5826135
--- /dev/null
+++ b/ndnboost/iterator/iterator_concepts.hpp
@@ -0,0 +1,284 @@
+// (C) Copyright Jeremy Siek 2002.
+// 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)
+
+#ifndef BOOST_ITERATOR_CONCEPTS_HPP
+#define BOOST_ITERATOR_CONCEPTS_HPP
+
+#include <ndnboost/concept_check.hpp>
+#include <ndnboost/iterator/iterator_categories.hpp>
+
+// Use ndnboost::detail::iterator_traits to work around some MSVC/Dinkumware problems.
+#include <ndnboost/detail/iterator.hpp>
+
+#include <ndnboost/type_traits/is_same.hpp>
+#include <ndnboost/type_traits/is_integral.hpp>
+
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/and.hpp>
+#include <ndnboost/mpl/or.hpp>
+
+#include <ndnboost/static_assert.hpp>
+
+// Use boost/limits to work around missing limits headers on some compilers
+#include <ndnboost/limits.hpp>
+#include <ndnboost/config.hpp>
+
+#include <algorithm>
+
+#include <ndnboost/concept/detail/concept_def.hpp>
+
+namespace ndnboost_concepts
+{
+ // Used a different namespace here (instead of "boost") so that the
+ // concept descriptions do not take for granted the names in
+ // namespace ndnboost.
+
+ //===========================================================================
+ // Iterator Access Concepts
+
+ BOOST_concept(ReadableIterator,(Iterator))
+ : ndnboost::Assignable<Iterator>
+ , ndnboost::CopyConstructible<Iterator>
+
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::value_type value_type;
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::reference reference;
+
+ BOOST_CONCEPT_USAGE(ReadableIterator)
+ {
+
+ value_type v = *i;
+ ndnboost::ignore_unused_variable_warning(v);
+ }
+ private:
+ Iterator i;
+ };
+
+ template <
+ typename Iterator
+ , typename ValueType = BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::value_type
+ >
+ struct WritableIterator
+ : ndnboost::CopyConstructible<Iterator>
+ {
+ BOOST_CONCEPT_USAGE(WritableIterator)
+ {
+ *i = v;
+ }
+ private:
+ ValueType v;
+ Iterator i;
+ };
+
+ template <
+ typename Iterator
+ , typename ValueType = BOOST_DEDUCED_TYPENAME ndnboost::detail::iterator_traits<Iterator>::value_type
+ >
+ struct WritableIteratorConcept : WritableIterator<Iterator,ValueType> {};
+
+ BOOST_concept(SwappableIterator,(Iterator))
+ {
+ BOOST_CONCEPT_USAGE(SwappableIterator)
+ {
+ std::iter_swap(i1, i2);
+ }
+ private:
+ Iterator i1;
+ Iterator i2;
+ };
+
+ BOOST_concept(LvalueIterator,(Iterator))
+ {
+ typedef typename ndnboost::detail::iterator_traits<Iterator>::value_type value_type;
+
+ BOOST_CONCEPT_USAGE(LvalueIterator)
+ {
+ value_type& r = const_cast<value_type&>(*i);
+ ndnboost::ignore_unused_variable_warning(r);
+ }
+ private:
+ Iterator i;
+ };
+
+
+ //===========================================================================
+ // Iterator Traversal Concepts
+
+ BOOST_concept(IncrementableIterator,(Iterator))
+ : ndnboost::Assignable<Iterator>
+ , ndnboost::CopyConstructible<Iterator>
+ {
+ typedef typename ndnboost::iterator_traversal<Iterator>::type traversal_category;
+
+ BOOST_CONCEPT_ASSERT((
+ ndnboost::Convertible<
+ traversal_category
+ , ndnboost::incrementable_traversal_tag
+ >));
+
+ BOOST_CONCEPT_USAGE(IncrementableIterator)
+ {
+ ++i;
+ (void)i++;
+ }
+ private:
+ Iterator i;
+ };
+
+ BOOST_concept(SinglePassIterator,(Iterator))
+ : IncrementableIterator<Iterator>
+ , ndnboost::EqualityComparable<Iterator>
+
+ {
+ BOOST_CONCEPT_ASSERT((
+ ndnboost::Convertible<
+ BOOST_DEDUCED_TYPENAME SinglePassIterator::traversal_category
+ , ndnboost::single_pass_traversal_tag
+ > ));
+ };
+
+ BOOST_concept(ForwardTraversal,(Iterator))
+ : SinglePassIterator<Iterator>
+ , ndnboost::DefaultConstructible<Iterator>
+ {
+ typedef typename ndnboost::detail::iterator_traits<Iterator>::difference_type difference_type;
+
+ BOOST_MPL_ASSERT((ndnboost::is_integral<difference_type>));
+ BOOST_MPL_ASSERT_RELATION(std::numeric_limits<difference_type>::is_signed, ==, true);
+
+ BOOST_CONCEPT_ASSERT((
+ ndnboost::Convertible<
+ BOOST_DEDUCED_TYPENAME ForwardTraversal::traversal_category
+ , ndnboost::forward_traversal_tag
+ > ));
+ };
+
+ BOOST_concept(BidirectionalTraversal,(Iterator))
+ : ForwardTraversal<Iterator>
+ {
+ BOOST_CONCEPT_ASSERT((
+ ndnboost::Convertible<
+ BOOST_DEDUCED_TYPENAME BidirectionalTraversal::traversal_category
+ , ndnboost::bidirectional_traversal_tag
+ > ));
+
+ BOOST_CONCEPT_USAGE(BidirectionalTraversal)
+ {
+ --i;
+ (void)i--;
+ }
+ private:
+ Iterator i;
+ };
+
+ BOOST_concept(RandomAccessTraversal,(Iterator))
+ : BidirectionalTraversal<Iterator>
+ {
+ BOOST_CONCEPT_ASSERT((
+ ndnboost::Convertible<
+ BOOST_DEDUCED_TYPENAME RandomAccessTraversal::traversal_category
+ , ndnboost::random_access_traversal_tag
+ > ));
+
+ BOOST_CONCEPT_USAGE(RandomAccessTraversal)
+ {
+ i += n;
+ i = i + n;
+ i = n + i;
+ i -= n;
+ i = i - n;
+ n = i - j;
+ }
+
+ private:
+ typename BidirectionalTraversal<Iterator>::difference_type n;
+ Iterator i, j;
+ };
+
+ //===========================================================================
+ // Iterator Interoperability
+
+ namespace detail
+ {
+ template <typename Iterator1, typename Iterator2>
+ void interop_single_pass_constraints(Iterator1 const& i1, Iterator2 const& i2)
+ {
+ bool b;
+ b = i1 == i2;
+ b = i1 != i2;
+
+ b = i2 == i1;
+ b = i2 != i1;
+ ndnboost::ignore_unused_variable_warning(b);
+ }
+
+ template <typename Iterator1, typename Iterator2>
+ void interop_rand_access_constraints(
+ Iterator1 const& i1, Iterator2 const& i2,
+ ndnboost::random_access_traversal_tag, ndnboost::random_access_traversal_tag)
+ {
+ bool b;
+ typename ndnboost::detail::iterator_traits<Iterator2>::difference_type n;
+ b = i1 < i2;
+ b = i1 <= i2;
+ b = i1 > i2;
+ b = i1 >= i2;
+ n = i1 - i2;
+
+ b = i2 < i1;
+ b = i2 <= i1;
+ b = i2 > i1;
+ b = i2 >= i1;
+ n = i2 - i1;
+ ndnboost::ignore_unused_variable_warning(b);
+ ndnboost::ignore_unused_variable_warning(n);
+ }
+
+ template <typename Iterator1, typename Iterator2>
+ void interop_rand_access_constraints(
+ Iterator1 const&, Iterator2 const&,
+ ndnboost::single_pass_traversal_tag, ndnboost::single_pass_traversal_tag)
+ { }
+
+ } // namespace detail
+
+ BOOST_concept(InteroperableIterator,(Iterator)(ConstIterator))
+ {
+ private:
+ typedef typename ndnboost::detail::pure_traversal_tag<
+ typename ndnboost::iterator_traversal<
+ Iterator
+ >::type
+ >::type traversal_category;
+
+ typedef typename ndnboost::detail::pure_traversal_tag<
+ typename ndnboost::iterator_traversal<
+ ConstIterator
+ >::type
+ >::type const_traversal_category;
+
+ public:
+ BOOST_CONCEPT_ASSERT((SinglePassIterator<Iterator>));
+ BOOST_CONCEPT_ASSERT((SinglePassIterator<ConstIterator>));
+
+ BOOST_CONCEPT_USAGE(InteroperableIterator)
+ {
+ detail::interop_single_pass_constraints(i, ci);
+ detail::interop_rand_access_constraints(i, ci, traversal_category(), const_traversal_category());
+
+ ci = i;
+ }
+
+ private:
+ Iterator i;
+ ConstIterator ci;
+ };
+
+} // namespace ndnboost_concepts
+
+#include <ndnboost/concept/detail/concept_undef.hpp>
+
+#endif // BOOST_ITERATOR_CONCEPTS_HPP
diff --git a/ndnboost/iterator/iterator_facade.hpp b/ndnboost/iterator/iterator_facade.hpp
new file mode 100644
index 0000000..c61f3ad
--- /dev/null
+++ b/ndnboost/iterator/iterator_facade.hpp
@@ -0,0 +1,874 @@
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// 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)
+#ifndef BOOST_ITERATOR_FACADE_23022003THW_HPP
+#define BOOST_ITERATOR_FACADE_23022003THW_HPP
+
+#include <ndnboost/iterator.hpp>
+#include <ndnboost/iterator/interoperable.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+#include <ndnboost/iterator/detail/facade_iterator_category.hpp>
+#include <ndnboost/iterator/detail/enable_if.hpp>
+
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/utility/addressof.hpp>
+
+#include <ndnboost/type_traits/is_same.hpp>
+#include <ndnboost/type_traits/add_const.hpp>
+#include <ndnboost/type_traits/add_pointer.hpp>
+#include <ndnboost/type_traits/remove_const.hpp>
+#include <ndnboost/type_traits/remove_reference.hpp>
+#include <ndnboost/type_traits/is_convertible.hpp>
+#include <ndnboost/type_traits/is_pod.hpp>
+
+#include <ndnboost/mpl/eval_if.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/or.hpp>
+#include <ndnboost/mpl/and.hpp>
+#include <ndnboost/mpl/not.hpp>
+#include <ndnboost/mpl/always.hpp>
+#include <ndnboost/mpl/apply.hpp>
+#include <ndnboost/mpl/identity.hpp>
+
+#include <ndnboost/iterator/detail/config_def.hpp> // this goes last
+
+namespace ndnboost
+{
+ // This forward declaration is required for the friend declaration
+ // in iterator_core_access
+ template <class I, class V, class TC, class R, class D> class iterator_facade;
+
+ namespace detail
+ {
+ // A binary metafunction class that always returns bool. VC6
+ // ICEs on mpl::always<bool>, probably because of the default
+ // parameters.
+ struct always_bool2
+ {
+ template <class T, class U>
+ struct apply
+ {
+ typedef bool type;
+ };
+ };
+
+ //
+ // enable if for use in operator implementation.
+ //
+ template <
+ class Facade1
+ , class Facade2
+ , class Return
+ >
+ struct enable_if_interoperable
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ {
+ typedef typename mpl::if_<
+ mpl::or_<
+ is_convertible<Facade1, Facade2>
+ , is_convertible<Facade2, Facade1>
+ >
+ , Return
+ , int[3]
+ >::type type;
+ };
+#else
+ : ::ndnboost::iterators::enable_if<
+ mpl::or_<
+ is_convertible<Facade1, Facade2>
+ , is_convertible<Facade2, Facade1>
+ >
+ , Return
+ >
+ {};
+#endif
+
+ //
+ // Generates associated types for an iterator_facade with the
+ // given parameters.
+ //
+ template <
+ class ValueParam
+ , class CategoryOrTraversal
+ , class Reference
+ , class Difference
+ >
+ struct iterator_facade_types
+ {
+ typedef typename facade_iterator_category<
+ CategoryOrTraversal, ValueParam, Reference
+ >::type iterator_category;
+
+ typedef typename remove_const<ValueParam>::type value_type;
+
+ // Not the real associated pointer type
+ typedef typename mpl::eval_if<
+ ndnboost::detail::iterator_writability_disabled<ValueParam,Reference>
+ , add_pointer<const value_type>
+ , add_pointer<value_type>
+ >::type pointer;
+
+# if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) \
+ && (BOOST_WORKAROUND(_STLPORT_VERSION, BOOST_TESTED_AT(0x452)) \
+ || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, BOOST_TESTED_AT(310))) \
+ || BOOST_WORKAROUND(BOOST_RWSTD_VER, BOOST_TESTED_AT(0x20101)) \
+ || BOOST_WORKAROUND(BOOST_DINKUMWARE_STDLIB, <= 310)
+
+ // To interoperate with some broken library/compiler
+ // combinations, user-defined iterators must be derived from
+ // std::iterator. It is possible to implement a standard
+ // library for broken compilers without this limitation.
+# define BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE 1
+
+ typedef
+ iterator<iterator_category, value_type, Difference, pointer, Reference>
+ base;
+# endif
+ };
+
+ // iterators whose dereference operators reference the same value
+ // for all iterators into the same sequence (like many input
+ // iterators) need help with their postfix ++: the referenced
+ // value must be read and stored away before the increment occurs
+ // so that *a++ yields the originally referenced element and not
+ // the next one.
+ template <class Iterator>
+ class postfix_increment_proxy
+ {
+ typedef typename iterator_value<Iterator>::type value_type;
+ public:
+ explicit postfix_increment_proxy(Iterator const& x)
+ : stored_value(*x)
+ {}
+
+ // Returning a mutable reference allows nonsense like
+ // (*r++).mutate(), but it imposes fewer assumptions about the
+ // behavior of the value_type. In particular, recall that
+ // (*r).mutate() is legal if operator* returns by value.
+ value_type&
+ operator*() const
+ {
+ return this->stored_value;
+ }
+ private:
+ mutable value_type stored_value;
+ };
+
+ //
+ // In general, we can't determine that such an iterator isn't
+ // writable -- we also need to store a copy of the old iterator so
+ // that it can be written into.
+ template <class Iterator>
+ class writable_postfix_increment_proxy
+ {
+ typedef typename iterator_value<Iterator>::type value_type;
+ public:
+ explicit writable_postfix_increment_proxy(Iterator const& x)
+ : stored_value(*x)
+ , stored_iterator(x)
+ {}
+
+ // Dereferencing must return a proxy so that both *r++ = o and
+ // value_type(*r++) can work. In this case, *r is the same as
+ // *r++, and the conversion operator below is used to ensure
+ // readability.
+ writable_postfix_increment_proxy const&
+ operator*() const
+ {
+ return *this;
+ }
+
+ // Provides readability of *r++
+ operator value_type&() const
+ {
+ return stored_value;
+ }
+
+ // Provides writability of *r++
+ template <class T>
+ T const& operator=(T const& x) const
+ {
+ *this->stored_iterator = x;
+ return x;
+ }
+
+ // This overload just in case only non-const objects are writable
+ template <class T>
+ T& operator=(T& x) const
+ {
+ *this->stored_iterator = x;
+ return x;
+ }
+
+ // Provides X(r++)
+ operator Iterator const&() const
+ {
+ return stored_iterator;
+ }
+
+ private:
+ mutable value_type stored_value;
+ Iterator stored_iterator;
+ };
+
+# ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ template <class Reference, class Value>
+ struct is_non_proxy_reference_impl
+ {
+ static Reference r;
+
+ template <class R>
+ static typename mpl::if_<
+ is_convertible<
+ R const volatile*
+ , Value const volatile*
+ >
+ , char[1]
+ , char[2]
+ >::type& helper(R const&);
+
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(helper(r)) == 1);
+ };
+
+ template <class Reference, class Value>
+ struct is_non_proxy_reference
+ : mpl::bool_<
+ is_non_proxy_reference_impl<Reference, Value>::value
+ >
+ {};
+# else
+ template <class Reference, class Value>
+ struct is_non_proxy_reference
+ : is_convertible<
+ typename remove_reference<Reference>::type
+ const volatile*
+ , Value const volatile*
+ >
+ {};
+# endif
+
+ // A metafunction to choose the result type of postfix ++
+ //
+ // Because the C++98 input iterator requirements say that *r++ has
+ // type T (value_type), implementations of some standard
+ // algorithms like lexicographical_compare may use constructions
+ // like:
+ //
+ // *r++ < *s++
+ //
+ // If *r++ returns a proxy (as required if r is writable but not
+ // multipass), this sort of expression will fail unless the proxy
+ // supports the operator<. Since there are any number of such
+ // operations, we're not going to try to support them. Therefore,
+ // even if r++ returns a proxy, *r++ will only return a proxy if
+ // *r also returns a proxy.
+ template <class Iterator, class Value, class Reference, class CategoryOrTraversal>
+ struct postfix_increment_result
+ : mpl::eval_if<
+ mpl::and_<
+ // A proxy is only needed for readable iterators
+ is_convertible<Reference,Value const&>
+
+ // No multipass iterator can have values that disappear
+ // before positions can be re-visited
+ , mpl::not_<
+ is_convertible<
+ typename iterator_category_to_traversal<CategoryOrTraversal>::type
+ , forward_traversal_tag
+ >
+ >
+ >
+ , mpl::if_<
+ is_non_proxy_reference<Reference,Value>
+ , postfix_increment_proxy<Iterator>
+ , writable_postfix_increment_proxy<Iterator>
+ >
+ , mpl::identity<Iterator>
+ >
+ {};
+
+ // operator->() needs special support for input iterators to strictly meet the
+ // standard's requirements. If *i is not a reference type, we must still
+ // produce an lvalue to which a pointer can be formed. We do that by
+ // returning a proxy object containing an instance of the reference object.
+ template <class Reference, class Pointer>
+ struct operator_arrow_dispatch // proxy references
+ {
+ struct proxy
+ {
+ explicit proxy(Reference const & x) : m_ref(x) {}
+ Reference* operator->() { return ndnboost::addressof(m_ref); }
+ // This function is needed for MWCW and BCC, which won't call
+ // operator-> again automatically per 13.3.1.2 para 8
+ operator Reference*() { return ndnboost::addressof(m_ref); }
+ Reference m_ref;
+ };
+ typedef proxy result_type;
+ static result_type apply(Reference const & x)
+ {
+ return result_type(x);
+ }
+ };
+
+ template <class T, class Pointer>
+ struct operator_arrow_dispatch<T&, Pointer> // "real" references
+ {
+ typedef Pointer result_type;
+ static result_type apply(T& x)
+ {
+ return ndnboost::addressof(x);
+ }
+ };
+
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ // Deal with ETI
+ template<>
+ struct operator_arrow_dispatch<int, int>
+ {
+ typedef int result_type;
+ };
+# endif
+
+ // A proxy return type for operator[], needed to deal with
+ // iterators that may invalidate referents upon destruction.
+ // Consider the temporary iterator in *(a + n)
+ template <class Iterator>
+ class operator_brackets_proxy
+ {
+ // Iterator is actually an iterator_facade, so we do not have to
+ // go through iterator_traits to access the traits.
+ typedef typename Iterator::reference reference;
+ typedef typename Iterator::value_type value_type;
+
+ public:
+ operator_brackets_proxy(Iterator const& iter)
+ : m_iter(iter)
+ {}
+
+ operator reference() const
+ {
+ return *m_iter;
+ }
+
+ operator_brackets_proxy& operator=(value_type const& val)
+ {
+ *m_iter = val;
+ return *this;
+ }
+
+ private:
+ Iterator m_iter;
+ };
+
+ // A metafunction that determines whether operator[] must return a
+ // proxy, or whether it can simply return a copy of the value_type.
+ template <class ValueType, class Reference>
+ struct use_operator_brackets_proxy
+ : mpl::not_<
+ mpl::and_<
+ // Really we want an is_copy_constructible trait here,
+ // but is_POD will have to suffice in the meantime.
+ ndnboost::is_POD<ValueType>
+ , iterator_writability_disabled<ValueType,Reference>
+ >
+ >
+ {};
+
+ template <class Iterator, class Value, class Reference>
+ struct operator_brackets_result
+ {
+ typedef typename mpl::if_<
+ use_operator_brackets_proxy<Value,Reference>
+ , operator_brackets_proxy<Iterator>
+ , Value
+ >::type type;
+ };
+
+ template <class Iterator>
+ operator_brackets_proxy<Iterator> make_operator_brackets_result(Iterator const& iter, mpl::true_)
+ {
+ return operator_brackets_proxy<Iterator>(iter);
+ }
+
+ template <class Iterator>
+ typename Iterator::value_type make_operator_brackets_result(Iterator const& iter, mpl::false_)
+ {
+ return *iter;
+ }
+
+ struct choose_difference_type
+ {
+ template <class I1, class I2>
+ struct apply
+ :
+# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP
+ iterator_difference<I1>
+# elif BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ mpl::if_<
+ is_convertible<I2,I1>
+ , typename I1::difference_type
+ , typename I2::difference_type
+ >
+# else
+ mpl::eval_if<
+ is_convertible<I2,I1>
+ , iterator_difference<I1>
+ , iterator_difference<I2>
+ >
+# endif
+ {};
+
+ };
+ } // namespace detail
+
+
+ // Macros which describe the declarations of binary operators
+# ifdef BOOST_NO_STRICT_ITERATOR_INTEROPERABILITY
+# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
+ template < \
+ class Derived1, class V1, class TC1, class Reference1, class Difference1 \
+ , class Derived2, class V2, class TC2, class Reference2, class Difference2 \
+ > \
+ prefix typename mpl::apply2<result_type,Derived1,Derived2>::type \
+ operator op( \
+ iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs \
+ , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs)
+# else
+# define BOOST_ITERATOR_FACADE_INTEROP_HEAD(prefix, op, result_type) \
+ template < \
+ class Derived1, class V1, class TC1, class Reference1, class Difference1 \
+ , class Derived2, class V2, class TC2, class Reference2, class Difference2 \
+ > \
+ prefix typename ndnboost::detail::enable_if_interoperable< \
+ Derived1, Derived2 \
+ , typename mpl::apply2<result_type,Derived1,Derived2>::type \
+ >::type \
+ operator op( \
+ iterator_facade<Derived1, V1, TC1, Reference1, Difference1> const& lhs \
+ , iterator_facade<Derived2, V2, TC2, Reference2, Difference2> const& rhs)
+# endif
+
+# define BOOST_ITERATOR_FACADE_PLUS_HEAD(prefix,args) \
+ template <class Derived, class V, class TC, class R, class D> \
+ prefix Derived operator+ args
+
+ //
+ // Helper class for granting access to the iterator core interface.
+ //
+ // The simple core interface is used by iterator_facade. The core
+ // interface of a user/library defined iterator type should not be made public
+ // so that it does not clutter the public interface. Instead iterator_core_access
+ // should be made friend so that iterator_facade can access the core
+ // interface through iterator_core_access.
+ //
+ class iterator_core_access
+ {
+# if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
+ // Tasteless as this may seem, making all members public allows member templates
+ // to work in the absence of member template friends.
+ public:
+# else
+
+ template <class I, class V, class TC, class R, class D> friend class iterator_facade;
+
+# define BOOST_ITERATOR_FACADE_RELATION(op) \
+ BOOST_ITERATOR_FACADE_INTEROP_HEAD(friend,op, ndnboost::detail::always_bool2);
+
+ BOOST_ITERATOR_FACADE_RELATION(==)
+ BOOST_ITERATOR_FACADE_RELATION(!=)
+
+ BOOST_ITERATOR_FACADE_RELATION(<)
+ BOOST_ITERATOR_FACADE_RELATION(>)
+ BOOST_ITERATOR_FACADE_RELATION(<=)
+ BOOST_ITERATOR_FACADE_RELATION(>=)
+# undef BOOST_ITERATOR_FACADE_RELATION
+
+ BOOST_ITERATOR_FACADE_INTEROP_HEAD(
+ friend, -, ndnboost::detail::choose_difference_type)
+ ;
+
+ BOOST_ITERATOR_FACADE_PLUS_HEAD(
+ friend inline
+ , (iterator_facade<Derived, V, TC, R, D> const&
+ , typename Derived::difference_type)
+ )
+ ;
+
+ BOOST_ITERATOR_FACADE_PLUS_HEAD(
+ friend inline
+ , (typename Derived::difference_type
+ , iterator_facade<Derived, V, TC, R, D> const&)
+ )
+ ;
+
+# endif
+
+ template <class Facade>
+ static typename Facade::reference dereference(Facade const& f)
+ {
+ return f.dereference();
+ }
+
+ template <class Facade>
+ static void increment(Facade& f)
+ {
+ f.increment();
+ }
+
+ template <class Facade>
+ static void decrement(Facade& f)
+ {
+ f.decrement();
+ }
+
+ template <class Facade1, class Facade2>
+ static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::true_)
+ {
+ return f1.equal(f2);
+ }
+
+ template <class Facade1, class Facade2>
+ static bool equal(Facade1 const& f1, Facade2 const& f2, mpl::false_)
+ {
+ return f2.equal(f1);
+ }
+
+ template <class Facade>
+ static void advance(Facade& f, typename Facade::difference_type n)
+ {
+ f.advance(n);
+ }
+
+ template <class Facade1, class Facade2>
+ static typename Facade1::difference_type distance_from(
+ Facade1 const& f1, Facade2 const& f2, mpl::true_)
+ {
+ return -f1.distance_to(f2);
+ }
+
+ template <class Facade1, class Facade2>
+ static typename Facade2::difference_type distance_from(
+ Facade1 const& f1, Facade2 const& f2, mpl::false_)
+ {
+ return f2.distance_to(f1);
+ }
+
+ //
+ // Curiously Recurring Template interface.
+ //
+ template <class I, class V, class TC, class R, class D>
+ static I& derived(iterator_facade<I,V,TC,R,D>& facade)
+ {
+ return *static_cast<I*>(&facade);
+ }
+
+ template <class I, class V, class TC, class R, class D>
+ static I const& derived(iterator_facade<I,V,TC,R,D> const& facade)
+ {
+ return *static_cast<I const*>(&facade);
+ }
+
+ private:
+ // objects of this class are useless
+ iterator_core_access(); //undefined
+ };
+
+ //
+ // iterator_facade - use as a public base class for defining new
+ // standard-conforming iterators.
+ //
+ template <
+ class Derived // The derived iterator type being constructed
+ , class Value
+ , class CategoryOrTraversal
+ , class Reference = Value&
+ , class Difference = std::ptrdiff_t
+ >
+ class iterator_facade
+# ifdef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
+ : public ndnboost::detail::iterator_facade_types<
+ Value, CategoryOrTraversal, Reference, Difference
+ >::base
+# undef BOOST_ITERATOR_FACADE_NEEDS_ITERATOR_BASE
+# endif
+ {
+ private:
+ //
+ // Curiously Recurring Template interface.
+ //
+ Derived& derived()
+ {
+ return *static_cast<Derived*>(this);
+ }
+
+ Derived const& derived() const
+ {
+ return *static_cast<Derived const*>(this);
+ }
+
+ typedef ndnboost::detail::iterator_facade_types<
+ Value, CategoryOrTraversal, Reference, Difference
+ > associated_types;
+
+ typedef ndnboost::detail::operator_arrow_dispatch<
+ Reference
+ , typename associated_types::pointer
+ > operator_arrow_dispatch_;
+
+ protected:
+ // For use by derived classes
+ typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
+
+ public:
+
+ typedef typename associated_types::value_type value_type;
+ typedef Reference reference;
+ typedef Difference difference_type;
+
+ typedef typename operator_arrow_dispatch_::result_type pointer;
+
+ typedef typename associated_types::iterator_category iterator_category;
+
+ reference operator*() const
+ {
+ return iterator_core_access::dereference(this->derived());
+ }
+
+ pointer operator->() const
+ {
+ return operator_arrow_dispatch_::apply(*this->derived());
+ }
+
+ typename ndnboost::detail::operator_brackets_result<Derived,Value,reference>::type
+ operator[](difference_type n) const
+ {
+ typedef ndnboost::detail::use_operator_brackets_proxy<Value,Reference> use_proxy;
+
+ return ndnboost::detail::make_operator_brackets_result<Derived>(
+ this->derived() + n
+ , use_proxy()
+ );
+ }
+
+ Derived& operator++()
+ {
+ iterator_core_access::increment(this->derived());
+ return this->derived();
+ }
+
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ typename ndnboost::detail::postfix_increment_result<Derived,Value,Reference,CategoryOrTraversal>::type
+ operator++(int)
+ {
+ typename ndnboost::detail::postfix_increment_result<Derived,Value,Reference,CategoryOrTraversal>::type
+ tmp(this->derived());
+ ++*this;
+ return tmp;
+ }
+# endif
+
+ Derived& operator--()
+ {
+ iterator_core_access::decrement(this->derived());
+ return this->derived();
+ }
+
+ Derived operator--(int)
+ {
+ Derived tmp(this->derived());
+ --*this;
+ return tmp;
+ }
+
+ Derived& operator+=(difference_type n)
+ {
+ iterator_core_access::advance(this->derived(), n);
+ return this->derived();
+ }
+
+ Derived& operator-=(difference_type n)
+ {
+ iterator_core_access::advance(this->derived(), -n);
+ return this->derived();
+ }
+
+ Derived operator-(difference_type x) const
+ {
+ Derived result(this->derived());
+ return result -= x;
+ }
+
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ // There appears to be a bug which trashes the data of classes
+ // derived from iterator_facade when they are assigned unless we
+ // define this assignment operator. This bug is only revealed
+ // (so far) in STLPort debug mode, but it's clearly a codegen
+ // problem so we apply the workaround for all MSVC6.
+ iterator_facade& operator=(iterator_facade const&)
+ {
+ return *this;
+ }
+# endif
+ };
+
+# if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+ template <class I, class V, class TC, class R, class D>
+ inline typename ndnboost::detail::postfix_increment_result<I,V,R,TC>::type
+ operator++(
+ iterator_facade<I,V,TC,R,D>& i
+ , int
+ )
+ {
+ typename ndnboost::detail::postfix_increment_result<I,V,R,TC>::type
+ tmp(*static_cast<I*>(&i));
+
+ ++i;
+
+ return tmp;
+ }
+# endif
+
+
+ //
+ // Comparison operator implementation. The library supplied operators
+ // enables the user to provide fully interoperable constant/mutable
+ // iterator types. I.e. the library provides all operators
+ // for all mutable/constant iterator combinations.
+ //
+ // Note though that this kind of interoperability for constant/mutable
+ // iterators is not required by the standard for container iterators.
+ // All the standard asks for is a conversion mutable -> constant.
+ // Most standard library implementations nowadays provide fully interoperable
+ // iterator implementations, but there are still heavily used implementations
+ // that do not provide them. (Actually it's even worse, they do not provide
+ // them for only a few iterators.)
+ //
+ // ?? Maybe a BOOST_ITERATOR_NO_FULL_INTEROPERABILITY macro should
+ // enable the user to turn off mixed type operators
+ //
+ // The library takes care to provide only the right operator overloads.
+ // I.e.
+ //
+ // bool operator==(Iterator, Iterator);
+ // bool operator==(ConstIterator, Iterator);
+ // bool operator==(Iterator, ConstIterator);
+ // bool operator==(ConstIterator, ConstIterator);
+ //
+ // ...
+ //
+ // In order to do so it uses c++ idioms that are not yet widely supported
+ // by current compiler releases. The library is designed to degrade gracefully
+ // in the face of compiler deficiencies. In general compiler
+ // deficiencies result in less strict error checking and more obscure
+ // error messages, functionality is not affected.
+ //
+ // For full operation compiler support for "Substitution Failure Is Not An Error"
+ // (aka. enable_if) and ndnboost::is_convertible is required.
+ //
+ // The following problems occur if support is lacking.
+ //
+ // Pseudo code
+ //
+ // ---------------
+ // AdaptorA<Iterator1> a1;
+ // AdaptorA<Iterator2> a2;
+ //
+ // // This will result in a no such overload error in full operation
+ // // If enable_if or is_convertible is not supported
+ // // The instantiation will fail with an error hopefully indicating that
+ // // there is no operator== for Iterator1, Iterator2
+ // // The same will happen if no enable_if is used to remove
+ // // false overloads from the templated conversion constructor
+ // // of AdaptorA.
+ //
+ // a1 == a2;
+ // ----------------
+ //
+ // AdaptorA<Iterator> a;
+ // AdaptorB<Iterator> b;
+ //
+ // // This will result in a no such overload error in full operation
+ // // If enable_if is not supported the static assert used
+ // // in the operator implementation will fail.
+ // // This will accidently work if is_convertible is not supported.
+ //
+ // a == b;
+ // ----------------
+ //
+
+# ifdef BOOST_NO_ONE_WAY_ITERATOR_INTEROP
+# define BOOST_ITERATOR_CONVERTIBLE(a,b) mpl::true_()
+# else
+# define BOOST_ITERATOR_CONVERTIBLE(a,b) is_convertible<a,b>()
+# endif
+
+# define BOOST_ITERATOR_FACADE_INTEROP(op, result_type, return_prefix, base_op) \
+ BOOST_ITERATOR_FACADE_INTEROP_HEAD(inline, op, result_type) \
+ { \
+ /* For those compilers that do not support enable_if */ \
+ BOOST_STATIC_ASSERT(( \
+ is_interoperable< Derived1, Derived2 >::value \
+ )); \
+ return_prefix iterator_core_access::base_op( \
+ *static_cast<Derived1 const*>(&lhs) \
+ , *static_cast<Derived2 const*>(&rhs) \
+ , BOOST_ITERATOR_CONVERTIBLE(Derived2,Derived1) \
+ ); \
+ }
+
+# define BOOST_ITERATOR_FACADE_RELATION(op, return_prefix, base_op) \
+ BOOST_ITERATOR_FACADE_INTEROP( \
+ op \
+ , ndnboost::detail::always_bool2 \
+ , return_prefix \
+ , base_op \
+ )
+
+ BOOST_ITERATOR_FACADE_RELATION(==, return, equal)
+ BOOST_ITERATOR_FACADE_RELATION(!=, return !, equal)
+
+ BOOST_ITERATOR_FACADE_RELATION(<, return 0 >, distance_from)
+ BOOST_ITERATOR_FACADE_RELATION(>, return 0 <, distance_from)
+ BOOST_ITERATOR_FACADE_RELATION(<=, return 0 >=, distance_from)
+ BOOST_ITERATOR_FACADE_RELATION(>=, return 0 <=, distance_from)
+# undef BOOST_ITERATOR_FACADE_RELATION
+
+ // operator- requires an additional part in the static assertion
+ BOOST_ITERATOR_FACADE_INTEROP(
+ -
+ , ndnboost::detail::choose_difference_type
+ , return
+ , distance_from
+ )
+# undef BOOST_ITERATOR_FACADE_INTEROP
+# undef BOOST_ITERATOR_FACADE_INTEROP_HEAD
+
+# define BOOST_ITERATOR_FACADE_PLUS(args) \
+ BOOST_ITERATOR_FACADE_PLUS_HEAD(inline, args) \
+ { \
+ Derived tmp(static_cast<Derived const&>(i)); \
+ return tmp += n; \
+ }
+
+BOOST_ITERATOR_FACADE_PLUS((
+ iterator_facade<Derived, V, TC, R, D> const& i
+ , typename Derived::difference_type n
+))
+
+BOOST_ITERATOR_FACADE_PLUS((
+ typename Derived::difference_type n
+ , iterator_facade<Derived, V, TC, R, D> const& i
+))
+# undef BOOST_ITERATOR_FACADE_PLUS
+# undef BOOST_ITERATOR_FACADE_PLUS_HEAD
+
+} // namespace ndnboost
+
+#include <ndnboost/iterator/detail/config_undef.hpp>
+
+#endif // BOOST_ITERATOR_FACADE_23022003THW_HPP
diff --git a/ndnboost/iterator/reverse_iterator.hpp b/ndnboost/iterator/reverse_iterator.hpp
new file mode 100644
index 0000000..924112f
--- /dev/null
+++ b/ndnboost/iterator/reverse_iterator.hpp
@@ -0,0 +1,69 @@
+// (C) Copyright David Abrahams 2002.
+// (C) Copyright Jeremy Siek 2002.
+// (C) Copyright Thomas Witt 2002.
+// 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)
+#ifndef BOOST_REVERSE_ITERATOR_23022003THW_HPP
+#define BOOST_REVERSE_ITERATOR_23022003THW_HPP
+
+#include <ndnboost/next_prior.hpp>
+#include <ndnboost/iterator.hpp>
+#include <ndnboost/iterator/iterator_adaptor.hpp>
+
+namespace ndnboost
+{
+
+ //
+ //
+ //
+ template <class Iterator>
+ class reverse_iterator
+ : public iterator_adaptor< reverse_iterator<Iterator>, Iterator >
+ {
+ typedef iterator_adaptor< reverse_iterator<Iterator>, Iterator > super_t;
+
+ friend class iterator_core_access;
+
+ public:
+ reverse_iterator() {}
+
+ explicit reverse_iterator(Iterator x)
+ : super_t(x) {}
+
+ template<class OtherIterator>
+ reverse_iterator(
+ reverse_iterator<OtherIterator> const& r
+ , typename enable_if_convertible<OtherIterator, Iterator>::type* = 0
+ )
+ : super_t(r.base())
+ {}
+
+ private:
+ typename super_t::reference dereference() const { return *ndnboost::prior(this->base()); }
+
+ void increment() { --this->base_reference(); }
+ void decrement() { ++this->base_reference(); }
+
+ void advance(typename super_t::difference_type n)
+ {
+ this->base_reference() += -n;
+ }
+
+ template <class OtherIterator>
+ typename super_t::difference_type
+ distance_to(reverse_iterator<OtherIterator> const& y) const
+ {
+ return this->base_reference() - y.base();
+ }
+ };
+
+ template <class BidirectionalIterator>
+ reverse_iterator<BidirectionalIterator> make_reverse_iterator(BidirectionalIterator x)
+ {
+ return reverse_iterator<BidirectionalIterator>(x);
+ }
+
+} // namespace ndnboost
+
+#endif // BOOST_REVERSE_ITERATOR_23022003THW_HPP
diff --git a/ndnboost/lambda/bind.hpp b/ndnboost/lambda/bind.hpp
new file mode 100644
index 0000000..3ec3bab
--- /dev/null
+++ b/ndnboost/lambda/bind.hpp
@@ -0,0 +1,19 @@
+// -- bind.hpp -- Boost Lambda Library --------------------------------------
+
+// Copyright (C) 1999-2001 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Gary Powell (gwpowell@hotmail.com)
+//
+// 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)
+//
+// For more information, see http://www.boost.org
+
+#ifndef BOOST_LAMBDA_BIND_HPP
+#define BOOST_LAMBDA_BIND_HPP
+
+#include "ndnboost/lambda/core.hpp"
+
+#include "ndnboost/lambda/detail/bind_functions.hpp"
+
+#endif
diff --git a/ndnboost/lambda/core.hpp b/ndnboost/lambda/core.hpp
new file mode 100644
index 0000000..1ff8342
--- /dev/null
+++ b/ndnboost/lambda/core.hpp
@@ -0,0 +1,79 @@
+// -- core.hpp -- Boost Lambda Library -------------------------------------
+//
+// Copyright (C) 2000 Gary Powell (powellg@amazon.com)
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+//
+// Includes the core of LL, without any real features for client:
+//
+// tuples, lambda functors, return type deduction templates,
+// argument substitution mechanism (select functions)
+//
+// Some functionality comes as well:
+// Assignment and subscript operators, as well as function
+// call operator for placeholder variables.
+// -------------------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_CORE_HPP
+#define BOOST_LAMBDA_CORE_HPP
+
+#include "ndnboost/type_traits/transform_traits.hpp"
+#include "ndnboost/type_traits/cv_traits.hpp"
+
+#include "ndnboost/tuple/tuple.hpp"
+
+// inject some of the tuple names into lambda
+namespace ndnboost {
+namespace lambda {
+
+using ::ndnboost::tuples::tuple;
+using ::ndnboost::tuples::null_type;
+
+} // lambda
+} // boost
+
+#include "ndnboost/lambda/detail/lambda_config.hpp"
+#include "ndnboost/lambda/detail/lambda_fwd.hpp"
+
+#include "ndnboost/lambda/detail/arity_code.hpp"
+#include "ndnboost/lambda/detail/actions.hpp"
+
+#include "ndnboost/lambda/detail/lambda_traits.hpp"
+
+#include "ndnboost/lambda/detail/function_adaptors.hpp"
+#include "ndnboost/lambda/detail/return_type_traits.hpp"
+
+#include "ndnboost/lambda/detail/select_functions.hpp"
+
+#include "ndnboost/lambda/detail/lambda_functor_base.hpp"
+
+#include "ndnboost/lambda/detail/lambda_functors.hpp"
+
+#include "ndnboost/lambda/detail/ret.hpp"
+
+namespace ndnboost {
+namespace lambda {
+
+namespace {
+
+ // These are constants types and need to be initialised
+ ndnboost::lambda::placeholder1_type free1 = ndnboost::lambda::placeholder1_type();
+ ndnboost::lambda::placeholder2_type free2 = ndnboost::lambda::placeholder2_type();
+ ndnboost::lambda::placeholder3_type free3 = ndnboost::lambda::placeholder3_type();
+
+ ndnboost::lambda::placeholder1_type& _1 = free1;
+ ndnboost::lambda::placeholder2_type& _2 = free2;
+ ndnboost::lambda::placeholder3_type& _3 = free3;
+ // _1, _2, ... naming scheme by Peter Dimov
+} // unnamed
+
+} // lambda
+} // boost
+
+
+#endif //BOOST_LAMBDA_CORE_HPP
diff --git a/ndnboost/lambda/detail/actions.hpp b/ndnboost/lambda/detail/actions.hpp
new file mode 100644
index 0000000..8892bb1
--- /dev/null
+++ b/ndnboost/lambda/detail/actions.hpp
@@ -0,0 +1,174 @@
+// -- Boost Lambda Library - actions.hpp ----------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+
+// For more information, see www.boost.org
+
+// ----------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_ACTIONS_HPP
+#define BOOST_LAMBDA_ACTIONS_HPP
+
+namespace ndnboost {
+namespace lambda {
+
+
+
+template<int Arity, class Act> class action;
+
+// these need to be defined here, since the corresponding lambda
+// functions are members of lambda_functor classes
+
+class assignment_action {};
+class subscript_action {};
+
+template <class Action> class other_action;
+
+// action for specifying the explicit return type
+template <class RET> class explicit_return_type_action {};
+
+// action for preventing the expansion of a lambda expression
+struct protect_action {};
+
+ // must be defined here, comma is a special case
+struct comma_action {};
+
+
+ // actions, for which the existence of protect is checked in return type
+ // deduction.
+
+template <class Action> struct is_protectable {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+// NOTE: comma action is protectable. Other protectable actions
+// are listed in operator_actions.hpp
+
+template<> struct is_protectable<other_action<comma_action> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+
+namespace detail {
+
+ // this type is used in return type deductions to signal that deduction
+ // did not find a result. It does not necessarily mean an error, it commonly
+ // means that something else should be tried.
+ class unspecified {};
+}
+
+ // function action is a special case: bind functions can be called with
+ // the return type specialized explicitly e.g. bind<int>(foo);
+ // If this call syntax is used, the return type is stored in the latter
+ // argument of function_action template. Otherwise the argument gets the type
+ // 'unspecified'.
+ // This argument is only relevant in the return type deduction code
+template <int I, class Result_type = detail::unspecified>
+class function_action {};
+
+template<class T> class function_action<1, T> {
+public:
+ template<class RET, class A1>
+ static RET apply(A1& a1) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1);
+ }
+};
+
+template<class T> class function_action<2, T> {
+public:
+ template<class RET, class A1, class A2>
+ static RET apply(A1& a1, A2& a2) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2);
+ }
+};
+
+template<class T> class function_action<3, T> {
+public:
+ template<class RET, class A1, class A2, class A3>
+ static RET apply(A1& a1, A2& a2, A3& a3) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3);
+ }
+};
+
+template<class T> class function_action<4, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4);
+ }
+};
+
+template<class T> class function_action<5, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4, class A5>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4, a5);
+ }
+};
+
+template<class T> class function_action<6, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4, class A5,
+ class A6>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4, a5, a6);
+ }
+};
+
+template<class T> class function_action<7, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4, a5, a6, a7);
+ }
+};
+
+template<class T> class function_action<8, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
+ A8& a8) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+};
+
+template<class T> class function_action<9, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8, class A9>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
+ A8& a8, A9& a9) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+};
+
+template<class T> class function_action<10, T> {
+public:
+ template<class RET, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8, class A9, class A10>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7,
+ A8& a8, A9& a9, A10& a10) {
+ return function_adaptor<typename ndnboost::remove_cv<A1>::type>::
+ template apply<RET>(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
+ }
+};
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/detail/arity_code.hpp b/ndnboost/lambda/detail/arity_code.hpp
new file mode 100644
index 0000000..2b762c3
--- /dev/null
+++ b/ndnboost/lambda/detail/arity_code.hpp
@@ -0,0 +1,110 @@
+// -- Boost Lambda Library -------------------------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// --------------------------------------------------
+
+#ifndef BOOST_LAMBDA_ARITY_CODE_HPP
+#define BOOST_LAMBDA_ARITY_CODE_HPP
+
+#include "ndnboost/type_traits/cv_traits.hpp"
+#include "ndnboost/type_traits/transform_traits.hpp"
+
+namespace ndnboost {
+namespace lambda {
+
+// These constants state, whether a lambda_functor instantiation results from
+// an expression which contains no placeholders (NONE),
+// only free1 placeholders (FIRST),
+// free2 placeholders and maybe free1 placeholders (SECOND),
+// free3 and maybe free1 and free2 placeholders (THIRD),
+// freeE placeholders and maybe free1 and free2 (EXCEPTION).
+// RETHROW means, that a rethrow expression is used somewhere in the lambda_functor.
+
+enum { NONE = 0x00, // Notice we are using bits as flags here.
+ FIRST = 0x01,
+ SECOND = 0x02,
+ THIRD = 0x04,
+ EXCEPTION = 0x08,
+ RETHROW = 0x10};
+
+
+template<class T>
+struct get_tuple_arity;
+
+namespace detail {
+
+template <class T> struct get_arity_;
+
+} // end detail;
+
+template <class T> struct get_arity {
+
+ BOOST_STATIC_CONSTANT(int, value = detail::get_arity_<typename ndnboost::remove_cv<typename ndnboost::remove_reference<T>::type>::type>::value);
+
+};
+
+namespace detail {
+
+template<class T>
+struct get_arity_ {
+ BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
+template<class T>
+struct get_arity_<lambda_functor<T> > {
+ BOOST_STATIC_CONSTANT(int, value = get_arity<T>::value);
+};
+
+template<class Action, class Args>
+struct get_arity_<lambda_functor_base<Action, Args> > {
+ BOOST_STATIC_CONSTANT(int, value = get_tuple_arity<Args>::value);
+};
+
+template<int I>
+struct get_arity_<placeholder<I> > {
+ BOOST_STATIC_CONSTANT(int, value = I);
+};
+
+} // detail
+
+template<class T>
+struct get_tuple_arity {
+ BOOST_STATIC_CONSTANT(int, value = get_arity<typename T::head_type>::value | get_tuple_arity<typename T::tail_type>::value);
+};
+
+
+template<>
+struct get_tuple_arity<null_type> {
+ BOOST_STATIC_CONSTANT(int, value = 0);
+};
+
+
+ // Does T have placeholder<I> as it's subexpression?
+
+template<class T, int I>
+struct has_placeholder {
+ BOOST_STATIC_CONSTANT(bool, value = (get_arity<T>::value & I) != 0);
+};
+
+template<int I, int J>
+struct includes_placeholder {
+ BOOST_STATIC_CONSTANT(bool, value = (J & I) != 0);
+};
+
+template<int I, int J>
+struct lacks_placeholder {
+ BOOST_STATIC_CONSTANT(bool, value = ((J & I) == 0));
+};
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/detail/bind_functions.hpp b/ndnboost/lambda/detail/bind_functions.hpp
new file mode 100644
index 0000000..4288067
--- /dev/null
+++ b/ndnboost/lambda/detail/bind_functions.hpp
@@ -0,0 +1,1879 @@
+// -- bind_functions.hpp -- Boost Lambda Library
+//
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see http://www.boost.org
+
+// ----------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_BIND_FUNCTIONS_HPP
+#define BOOST_LAMBDA_BIND_FUNCTIONS_HPP
+
+
+namespace ndnboost {
+namespace lambda {
+
+#ifdef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+
+ // gcc 2.96 instantiates bind functions it does not even call.
+ // These instantiations lead to incorrect types in the return type,
+ // and a compilation error results.
+ // This tweaking is to prevent the formation of the erroneous type.
+namespace detail {
+
+template<class T> struct constify_non_funcs {
+ typedef typename
+ detail::IF_type<ndnboost::is_function<T>::value,
+ ndnboost::add_reference<T>,
+ ndnboost::add_const<T>
+ >::type type;
+};
+
+}
+#endif
+// 1-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<Result(&)()>::type
+ >
+>
+
+bind(Result(& a1)()) {
+ return
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<Result(&)()>::type
+ >
+ ( typename detail::bind_tuple_mapper<Result(&)()>::type
+ (a1)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, function_action<1> >,
+ typename detail::bind_tuple_mapper<const Arg1>::type
+ >
+>
+
+bind(const Arg1& a1) {
+ return
+ lambda_functor_base<
+ action<1, function_action<1> >,
+ typename detail::bind_tuple_mapper<const Arg1>::type
+ >
+ ( typename detail::bind_tuple_mapper<const Arg1>::type
+ (a1)
+ );
+}
+
+template <class Result, class Arg1>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<const Arg1>::type
+ >
+>
+
+bind(const Arg1& a1) {
+ return
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<const Arg1>::type
+ >
+ ( typename detail::bind_tuple_mapper<const Arg1>::type
+ (a1)
+ );
+}
+
+
+ #else
+template <class Arg1>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, function_action<1> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type
+ >::type
+ >
+>
+
+bind(const Arg1& a1) {
+ return
+ lambda_functor_base<
+ action<1, function_action<1> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type
+ >::type
+ (a1)
+ );
+}
+
+template <class Result, class Arg1>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type
+ >::type
+ >
+>
+
+bind(const Arg1& a1) {
+ return
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type
+ >::type
+ (a1)
+ );
+}
+
+template <class Result>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<Result(*)()>::type
+ >
+>
+
+bind(Result(* const & a1)()) {
+ return
+ lambda_functor_base<
+ action<1, function_action<1, Result> >,
+ typename detail::bind_tuple_mapper<Result(*)()>::type
+ >
+ ( typename detail::bind_tuple_mapper<Result(*)()>::type
+ (a1)
+ );
+}
+
+
+#endif
+
+// 2-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<Result(&)(Par1), const Arg2>::type
+ >
+>
+
+bind(Result(&a1)(Par1), const Arg2& a2) {
+ return
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<Result(&)(Par1), const Arg2>::type
+ >
+ ( typename detail::bind_tuple_mapper<Result(&)(Par1), const Arg2>::type
+ (a1, a2)
+ );
+}
+#endif
+
+#ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, function_action<2> >,
+ typename detail::bind_tuple_mapper<const Arg1, const Arg2>::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2) {
+ return
+ lambda_functor_base<
+ action<2, function_action<2> >,
+ typename detail::bind_tuple_mapper<const Arg1, const Arg2>::type
+ >
+ ( typename detail::bind_tuple_mapper<const Arg1, const Arg2>::type
+ (a1, a2)
+ );
+}
+
+template <class Result, class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<const Arg1, const Arg2>::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2) {
+ return
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<const Arg1, const Arg2>::type
+ >
+ ( typename detail::bind_tuple_mapper<const Arg1, const Arg2>::type
+ (a1, a2)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, function_action<2> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2) {
+ return
+ lambda_functor_base<
+ action<2, function_action<2> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2
+ >::type
+ (a1, a2)
+ );
+}
+
+template <class Result, class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2) {
+ return
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2
+ >::type
+ (a1, a2)
+ );
+}
+
+template <class Result, class Par1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<Result(*)(Par1), const Arg2>::type
+ >
+>
+
+bind(Result(* const & a1)(Par1), const Arg2& a2) {
+ return
+ lambda_functor_base<
+ action<2, function_action<2, Result> >,
+ typename detail::bind_tuple_mapper<Result(*)(Par1), const Arg2>::type
+ >
+ ( typename detail::bind_tuple_mapper<Result(*)(Par1), const Arg2>::type
+ (a1, a2)
+ );
+}
+
+
+ #endif
+
+// 3-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Arg2, class Arg3>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2), const Arg2, const Arg3
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2), const Arg2& a2, const Arg3& a3) {
+ return
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2), const Arg2, const Arg3
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2), const Arg2, const Arg3
+ >::type
+ (a1, a2, a3)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<3, function_action<3> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3) {
+ return
+ lambda_functor_base<
+ action<3, function_action<3> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3
+ >::type
+ (a1, a2, a3)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3) {
+ return
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3
+ >::type
+ (a1, a2, a3)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<3, function_action<3> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3) {
+ return
+ lambda_functor_base<
+ action<3, function_action<3> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3
+ >::type
+ (a1, a2, a3)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3) {
+ return
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3
+ >::type
+ (a1, a2, a3)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Arg2, class Arg3>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2), const Arg2, const Arg3
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2), const Arg2& a2, const Arg3& a3) {
+ return
+ lambda_functor_base<
+ action<3, function_action<3, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2), const Arg2, const Arg3
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2), const Arg2, const Arg3
+ >::type
+ (a1, a2, a3)
+ );
+}
+
+
+ #endif
+
+// 4-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Arg2,
+ class Arg3, class Arg4>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3), const Arg2, const Arg3, const Arg4
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3), const Arg2& a2, const Arg3& a3,
+ const Arg4& a4) {
+ return
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3), const Arg2, const Arg3, const Arg4
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3), const Arg2, const Arg3, const Arg4
+ >::type
+ (a1, a2, a3, a4)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<4, function_action<4> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4) {
+ return
+ lambda_functor_base<
+ action<4, function_action<4> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4
+ >::type
+ (a1, a2, a3, a4)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4) {
+ return
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4
+ >::type
+ (a1, a2, a3, a4)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<4, function_action<4> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4) {
+ return
+ lambda_functor_base<
+ action<4, function_action<4> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4
+ >::type
+ (a1, a2, a3, a4)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4) {
+ return
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4
+ >::type
+ (a1, a2, a3, a4)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Arg2,
+ class Arg3, class Arg4>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3), const Arg2, const Arg3, const Arg4
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3), const Arg2& a2,
+ const Arg3& a3, const Arg4& a4) {
+ return
+ lambda_functor_base<
+ action<4, function_action<4, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3), const Arg2, const Arg3, const Arg4
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3), const Arg2, const Arg3, const Arg4
+ >::type
+ (a1, a2, a3, a4)
+ );
+}
+
+
+ #endif
+
+// 5-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Arg2, class Arg3, class Arg4, class Arg5>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4), const Arg2, const Arg3, const Arg4,
+ const Arg5
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3, Par4), const Arg2& a2, const Arg3& a3,
+ const Arg4& a4, const Arg5& a5) {
+ return
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4), const Arg2, const Arg3, const Arg4,
+ const Arg5
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4), const Arg2, const Arg3, const Arg4,
+ const Arg5
+ >::type
+ (a1, a2, a3, a4, a5)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<5, function_action<5> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5) {
+ return
+ lambda_functor_base<
+ action<5, function_action<5> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5
+ >::type
+ (a1, a2, a3, a4, a5)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5) {
+ return
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5
+ >::type
+ (a1, a2, a3, a4, a5)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<5, function_action<5> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5) {
+ return
+ lambda_functor_base<
+ action<5, function_action<5> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5
+ >::type
+ (a1, a2, a3, a4, a5)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5) {
+ return
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5
+ >::type
+ (a1, a2, a3, a4, a5)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Arg2, class Arg3, class Arg4, class Arg5>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4), const Arg2, const Arg3, const Arg4,
+ const Arg5
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3, Par4), const Arg2& a2,
+ const Arg3& a3, const Arg4& a4, const Arg5& a5) {
+ return
+ lambda_functor_base<
+ action<5, function_action<5, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4), const Arg2, const Arg3, const Arg4,
+ const Arg5
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4), const Arg2, const Arg3, const Arg4,
+ const Arg5
+ >::type
+ (a1, a2, a3, a4, a5)
+ );
+}
+
+
+ #endif
+
+// 6-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3, Par4, Par5), const Arg2& a2,
+ const Arg3& a3, const Arg4& a4, const Arg5& a5, const Arg6& a6) {
+ return
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ (a1, a2, a3, a4, a5, a6)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<6, function_action<6> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6) {
+ return
+ lambda_functor_base<
+ action<6, function_action<6> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ (a1, a2, a3, a4, a5, a6)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6) {
+ return
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ (a1, a2, a3, a4, a5, a6)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<6, function_action<6> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6) {
+ return
+ lambda_functor_base<
+ action<6, function_action<6> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ (a1, a2, a3, a4, a5, a6)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6) {
+ return
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6
+ >::type
+ (a1, a2, a3, a4, a5, a6)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3, Par4, Par5), const Arg2& a2,
+ const Arg3& a3, const Arg4& a4, const Arg5& a5, const Arg6& a6) {
+ return
+ lambda_functor_base<
+ action<6, function_action<6, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6
+ >::type
+ (a1, a2, a3, a4, a5, a6)
+ );
+}
+
+
+ #endif
+
+// 7-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2& a2,
+ const Arg3& a3, const Arg4& a4, const Arg5& a5, const Arg6& a6,
+ const Arg7& a7) {
+ return
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<7, function_action<7> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7) {
+ return
+ lambda_functor_base<
+ action<7, function_action<7> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7) {
+ return
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<7, function_action<7> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7) {
+ return
+ lambda_functor_base<
+ action<7, function_action<7> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7) {
+ return
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3, Par4, Par5, Par6),
+ const Arg2& a2, const Arg3& a3, const Arg4& a4, const Arg5& a5,
+ const Arg6& a6, const Arg7& a7) {
+ return
+ lambda_functor_base<
+ action<7, function_action<7, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6), const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7)
+ );
+}
+
+
+ #endif
+
+// 8-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Par7, class Arg2, class Arg3,
+ class Arg4, class Arg5, class Arg6, class Arg7, class Arg8>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2& a2,
+ const Arg3& a3, const Arg4& a4, const Arg5& a5, const Arg6& a6,
+ const Arg7& a7, const Arg8& a8) {
+ return
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7, class Arg8>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<8, function_action<8> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8) {
+ return
+ lambda_functor_base<
+ action<8, function_action<8> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7, class Arg8>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8) {
+ return
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7, class Arg8>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<8, function_action<8> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8) {
+ return
+ lambda_functor_base<
+ action<8, function_action<8> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7, class Arg8>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8) {
+ return
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Par7, class Arg2, class Arg3,
+ class Arg4, class Arg5, class Arg6, class Arg7, class Arg8>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3, Par4, Par5, Par6, Par7),
+ const Arg2& a2, const Arg3& a3, const Arg4& a4, const Arg5& a5,
+ const Arg6& a6, const Arg7& a7, const Arg8& a8) {
+ return
+ lambda_functor_base<
+ action<8, function_action<8, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8)
+ );
+}
+
+
+ #endif
+
+// 9-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Par7, class Par8, class Arg2,
+ class Arg3, class Arg4, class Arg5, class Arg6, class Arg7,
+ class Arg8, class Arg9>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8,
+ const Arg9
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8),
+ const Arg2& a2, const Arg3& a3, const Arg4& a4, const Arg5& a5,
+ const Arg6& a6, const Arg7& a7, const Arg8& a8, const Arg9& a9) {
+ return
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7, class Arg8, class Arg9>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<9, function_action<9> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9) {
+ return
+ lambda_functor_base<
+ action<9, function_action<9> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7, class Arg8, class Arg9>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9) {
+ return
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7, class Arg8, class Arg9>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<9, function_action<9> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7, const Arg8, const Arg9
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9) {
+ return
+ lambda_functor_base<
+ action<9, function_action<9> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7, class Arg8, class Arg9>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7, const Arg8, const Arg9
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9) {
+ return
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Par7, class Par8, class Arg2,
+ class Arg3, class Arg4, class Arg5, class Arg6, class Arg7,
+ class Arg8, class Arg9>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7, const Arg8,
+ const Arg9
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8),
+ const Arg2& a2, const Arg3& a3, const Arg4& a4, const Arg5& a5,
+ const Arg6& a6, const Arg7& a7, const Arg8& a8, const Arg9& a9) {
+ return
+ lambda_functor_base<
+ action<9, function_action<9, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8), const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9)
+ );
+}
+
+
+ #endif
+
+// 10-argument bind functions --------------------------
+#ifndef BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Par7, class Par8, class Par9,
+ class Arg2, class Arg3, class Arg4, class Arg5, class Arg6,
+ class Arg7, class Arg8, class Arg9, class Arg10>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2, const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9, const Arg10
+ >::type
+ >
+>
+
+bind(Result(&a1)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2& a2, const Arg3& a3, const Arg4& a4, const Arg5& a5,
+ const Arg6& a6, const Arg7& a7, const Arg8& a8, const Arg9& a9,
+ const Arg10& a10) {
+ return
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(&)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ );
+}
+#endif
+
+ #ifndef BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7, class Arg8, class Arg9, class Arg10>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<10, function_action<10> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9, const Arg10& a10) {
+ return
+ lambda_functor_base<
+ action<10, function_action<10> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7, class Arg8, class Arg9,
+ class Arg10>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9, const Arg10& a10) {
+ return
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ const Arg1, const Arg2, const Arg3, const Arg4, const Arg5,
+ const Arg6, const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ );
+}
+
+
+ #else
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5,
+ class Arg6, class Arg7, class Arg8, class Arg9, class Arg10>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<10, function_action<10> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7, const Arg8, const Arg9,
+ const Arg10
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9, const Arg10& a10) {
+ return
+ lambda_functor_base<
+ action<10, function_action<10> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9, const Arg10
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9, const Arg10
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ );
+}
+
+template <class Result, class Arg1, class Arg2, class Arg3, class Arg4,
+ class Arg5, class Arg6, class Arg7, class Arg8, class Arg9,
+ class Arg10>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2, const Arg3,
+ const Arg4, const Arg5, const Arg6, const Arg7, const Arg8, const Arg9,
+ const Arg10
+ >::type
+ >
+>
+
+bind(const Arg1& a1, const Arg2& a2, const Arg3& a3, const Arg4& a4,
+ const Arg5& a5, const Arg6& a6, const Arg7& a7, const Arg8& a8,
+ const Arg9& a9, const Arg10& a10) {
+ return
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9, const Arg10
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ typename detail::constify_non_funcs<Arg1>::type, const Arg2,
+ const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9, const Arg10
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ );
+}
+
+template <class Result, class Par1, class Par2, class Par3, class Par4,
+ class Par5, class Par6, class Par7, class Par8, class Par9,
+ class Arg2, class Arg3, class Arg4, class Arg5, class Arg6,
+ class Arg7, class Arg8, class Arg9, class Arg10>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2, const Arg3, const Arg4, const Arg5, const Arg6, const Arg7,
+ const Arg8, const Arg9, const Arg10
+ >::type
+ >
+>
+
+bind(Result(* const & a1)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8,
+ Par9), const Arg2& a2, const Arg3& a3, const Arg4& a4, const Arg5& a5,
+ const Arg6& a6, const Arg7& a7, const Arg8& a8, const Arg9& a9,
+ const Arg10& a10) {
+ return
+ lambda_functor_base<
+ action<10, function_action<10, Result> >,
+ typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ >
+ ( typename detail::bind_tuple_mapper<
+ Result(*)(Par1, Par2, Par3, Par4, Par5, Par6, Par7, Par8, Par9),
+ const Arg2, const Arg3, const Arg4, const Arg5, const Arg6,
+ const Arg7, const Arg8, const Arg9, const Arg10
+ >::type
+ (a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
+ );
+}
+
+
+ #endif
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/detail/function_adaptors.hpp b/ndnboost/lambda/detail/function_adaptors.hpp
new file mode 100644
index 0000000..df5367e
--- /dev/null
+++ b/ndnboost/lambda/detail/function_adaptors.hpp
@@ -0,0 +1,789 @@
+// Boost Lambda Library - function_adaptors.hpp ----------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+
+#ifndef BOOST_LAMBDA_FUNCTION_ADAPTORS_HPP
+#define BOOST_LAMBDA_FUNCTION_ADAPTORS_HPP
+
+#include "ndnboost/mpl/has_xxx.hpp"
+#include "ndnboost/tuple/tuple.hpp"
+#include "ndnboost/type_traits/same_traits.hpp"
+#include "ndnboost/type_traits/remove_reference.hpp"
+#include "ndnboost/type_traits/remove_cv.hpp"
+#include "ndnboost/type_traits/add_const.hpp"
+#include "ndnboost/type_traits/add_volatile.hpp"
+#include "ndnboost/utility/result_of.hpp"
+
+namespace ndnboost {
+namespace lambda {
+
+namespace detail {
+
+BOOST_MPL_HAS_XXX_TEMPLATE_DEF(sig)
+
+template<class Tuple>
+struct remove_references_from_elements {
+ typedef typename ndnboost::tuples::cons<
+ typename ndnboost::remove_reference<typename Tuple::head_type>::type,
+ typename remove_references_from_elements<typename Tuple::tail_type>::type
+ > type;
+};
+
+template<>
+struct remove_references_from_elements<ndnboost::tuples::null_type> {
+ typedef ndnboost::tuples::null_type type;
+};
+
+}
+
+template <class Func> struct function_adaptor {
+
+ typedef typename detail::remove_reference_and_cv<Func>::type plainF;
+
+#if !defined(BOOST_NO_RESULT_OF)
+ // Support functors that use the ndnboost::result_of return type convention.
+ template<class Tuple, int Length, bool HasSig>
+ struct result_converter;
+ template<class Tuple, int Length>
+ struct result_converter<Tuple, Length, true>
+ : plainF::template sig<
+ typename detail::remove_references_from_elements<Tuple>::type
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 0, false>
+ : result_of<plainF()>
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 1, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 2, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 3, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 4, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type,
+ typename tuples::element<4, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 5, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type,
+ typename tuples::element<4, Tuple>::type,
+ typename tuples::element<5, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 6, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type,
+ typename tuples::element<4, Tuple>::type,
+ typename tuples::element<5, Tuple>::type,
+ typename tuples::element<6, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 7, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type,
+ typename tuples::element<4, Tuple>::type,
+ typename tuples::element<5, Tuple>::type,
+ typename tuples::element<6, Tuple>::type,
+ typename tuples::element<7, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 8, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type,
+ typename tuples::element<4, Tuple>::type,
+ typename tuples::element<5, Tuple>::type,
+ typename tuples::element<6, Tuple>::type,
+ typename tuples::element<7, Tuple>::type,
+ typename tuples::element<8, Tuple>::type)
+ >
+ {};
+ template<class Tuple>
+ struct result_converter<Tuple, 9, false>
+ : result_of<plainF(
+ typename tuples::element<1, Tuple>::type,
+ typename tuples::element<2, Tuple>::type,
+ typename tuples::element<3, Tuple>::type,
+ typename tuples::element<4, Tuple>::type,
+ typename tuples::element<5, Tuple>::type,
+ typename tuples::element<6, Tuple>::type,
+ typename tuples::element<7, Tuple>::type,
+ typename tuples::element<8, Tuple>::type,
+ typename tuples::element<9, Tuple>::type)
+ >
+ {};
+
+ // we do not know the return type off-hand, we must ask it from Func
+ // To sig we pass a cons list, where the head is the function object type
+ // itself (potentially cv-qualified)
+ // and the tail contains the types of the actual arguments to be passed
+ // to the function object. The arguments can be cv qualified
+ // as well.
+ template <class Args>
+ struct sig
+ : result_converter<
+ Args
+ , tuples::length<typename Args::tail_type>::value
+ , detail::has_sig<plainF>::value
+ >
+ {};
+#else // BOOST_NO_RESULT_OF
+
+ template <class Args> class sig {
+ typedef typename detail::remove_reference_and_cv<Func>::type plainF;
+ public:
+ typedef typename plainF::template sig<
+ typename detail::remove_references_from_elements<Args>::type
+ >::type type;
+ };
+#endif
+
+ template<class RET, class A1>
+ static RET apply(A1& a1) {
+ return a1();
+ }
+ template<class RET, class A1, class A2>
+ static RET apply(A1& a1, A2& a2) {
+ return a1(a2);
+ }
+ template<class RET, class A1, class A2, class A3>
+ static RET apply(A1& a1, A2& a2, A3& a3) {
+ return a1(a2, a3);
+ }
+ template<class RET, class A1, class A2, class A3, class A4>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4) {
+ return a1(a2, a3, a4);
+ }
+ template<class RET, class A1, class A2, class A3, class A4, class A5>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return a1(a2, a3, a4, a5);
+ }
+ template<class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return a1(a2, a3, a4, a5, a6);
+ }
+ template<class RET, class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
+ A7& a7) {
+ return a1(a2, a3, a4, a5, a6, a7);
+ }
+ template<class RET, class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7, class A8>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
+ A7& a7, A8& a8) {
+ return a1(a2, a3, a4, a5, a6, a7, a8);
+ }
+ template<class RET, class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7, class A8, class A9>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
+ A7& a7, A8& a8, A9& a9) {
+ return a1(a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+ template<class RET, class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7, class A8, class A9, class A10>
+ static RET apply(A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6,
+ A7& a7, A8& a8, A9& a9, A10& a10) {
+ return a1(a2, a3, a4, a5, a6, a7, a8, a9, a10);
+ }
+};
+
+template <class Func> struct function_adaptor<const Func>; // error
+
+// -- function adaptors with data member access
+template <class Object, class T>
+struct function_adaptor<T Object::*> {
+
+ // typedef detail::unspecified type;
+
+ // T can have qualifiers and can be a reference type
+ // We get the return type by adding const, if the object through which
+ // the data member is accessed is const, and finally adding a reference
+ template<class Args> class sig {
+ typedef typename ndnboost::tuples::element<1, Args>::type argument_type;
+ typedef typename ndnboost::remove_reference<
+ argument_type
+ >::type unref_type;
+
+ typedef typename detail::IF<ndnboost::is_const<unref_type>::value,
+ typename ndnboost::add_const<T>::type,
+ T
+ >::RET properly_consted_return_type;
+
+ typedef typename detail::IF<ndnboost::is_volatile<unref_type>::value,
+ typename ndnboost::add_volatile<properly_consted_return_type>::type,
+ properly_consted_return_type
+ >::RET properly_cvd_return_type;
+
+
+ public:
+ typedef typename detail::IF<ndnboost::is_reference<argument_type>::value,
+ typename ndnboost::add_reference<properly_cvd_return_type>::type,
+ typename ndnboost::remove_cv<T>::type
+ >::RET type;
+ };
+
+ template <class RET>
+ static RET apply( T Object::*data, Object& o) {
+ return o.*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, const Object& o) {
+ return o.*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, volatile Object& o) {
+ return o.*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, const volatile Object& o) {
+ return o.*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, Object* o) {
+ return o->*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, const Object* o) {
+ return o->*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, volatile Object* o) {
+ return o->*data;
+ }
+ template <class RET>
+ static RET apply( T Object::*data, const volatile Object* o) {
+ return o->*data;
+ }
+};
+
+// -- function adaptors with 1 argument apply
+
+template <class Result>
+struct function_adaptor<Result (void)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET>
+ static Result apply(Result (*func)()) {
+ return func();
+ }
+};
+
+template <class Result>
+struct function_adaptor<Result (*)(void)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET>
+ static Result apply(Result (*func)()) {
+ return func();
+ }
+};
+
+
+// -- function adaptors with 2 argument apply
+template <class Object, class Result>
+struct function_adaptor<Result (Object::*)() const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET>
+ static Result apply( Result (Object::*func)() const, const Object* o) {
+ return (o->*func)();
+ }
+ template <class RET>
+ static Result apply( Result (Object::*func)() const, const Object& o) {
+ return (o.*func)();
+ }
+};
+
+template <class Object, class Result>
+struct function_adaptor<Result (Object::*)()> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET>
+ static Result apply( Result (Object::*func)(), Object* o) {
+ return (o->*func)();
+ }
+ template <class RET>
+ static Result apply( Result (Object::*func)(), Object& o) {
+ return (o.*func)();
+ }
+};
+
+template <class Arg1, class Result>
+struct function_adaptor<Result (Arg1)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1>
+ static Result apply(Result (*func)(Arg1), A1& a1) {
+ return func(a1);
+ }
+};
+
+template <class Arg1, class Result>
+struct function_adaptor<Result (*)(Arg1)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1>
+ static Result apply(Result (*func)(Arg1), A1& a1) {
+ return func(a1);
+ }
+};
+
+
+// -- function adaptors with 3 argument apply
+template <class Object, class Arg1, class Result>
+struct function_adaptor<Result (Object::*)(Arg1) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1>
+ static Result apply( Result (Object::*func)(Arg1) const, const Object* o,
+ A1& a1) {
+ return (o->*func)(a1);
+ }
+ template <class RET, class A1>
+ static Result apply( Result (Object::*func)(Arg1) const, const Object& o,
+ A1& a1) {
+ return (o.*func)(a1);
+ }
+};
+
+template <class Object, class Arg1, class Result>
+struct function_adaptor<Result (Object::*)(Arg1)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1>
+ static Result apply( Result (Object::*func)(Arg1), Object* o, A1& a1) {
+ return (o->*func)(a1);
+ }
+ template <class RET, class A1>
+ static Result apply( Result (Object::*func)(Arg1), Object& o, A1& a1) {
+ return (o.*func)(a1);
+ }
+};
+
+template <class Arg1, class Arg2, class Result>
+struct function_adaptor<Result (Arg1, Arg2)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2>
+ static Result apply(Result (*func)(Arg1, Arg2), A1& a1, A2& a2) {
+ return func(a1, a2);
+ }
+};
+
+template <class Arg1, class Arg2, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2>
+ static Result apply(Result (*func)(Arg1, Arg2), A1& a1, A2& a2) {
+ return func(a1, a2);
+ }
+};
+
+
+// -- function adaptors with 4 argument apply
+template <class Object, class Arg1, class Arg2, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2>
+ static Result apply( Result (Object::*func)(Arg1, Arg2) const, const Object* o, A1& a1, A2& a2) {
+ return (o->*func)(a1, a2);
+ }
+ template <class RET, class A1, class A2>
+ static Result apply( Result (Object::*func)(Arg1, Arg2) const, const Object& o, A1& a1, A2& a2) {
+ return (o.*func)(a1, a2);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2>
+ static Result apply( Result (Object::*func)(Arg1, Arg2), Object* o, A1& a1, A2& a2) {
+ return (o->*func)(a1, a2);
+ }
+ template <class RET, class A1, class A2>
+ static Result apply( Result (Object::*func)(Arg1, Arg2), Object& o, A1& a1, A2& a2) {
+ return (o.*func)(a1, a2);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3), A1& a1, A2& a2, A3& a3) {
+ return func(a1, a2, a3);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3), A1& a1, A2& a2, A3& a3) {
+ return func(a1, a2, a3);
+ }
+};
+
+
+// -- function adaptors with 5 argument apply
+template <class Object, class Arg1, class Arg2, class Arg3, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3) const, const Object* o, A1& a1, A2& a2, A3& a3) {
+ return (o->*func)(a1, a2, a3);
+ }
+ template <class RET, class A1, class A2, class A3>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3) const, const Object& o, A1& a1, A2& a2, A3& a3) {
+ return (o.*func)(a1, a2, a3);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Arg3, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3), Object* o, A1& a1, A2& a2, A3& a3) {
+ return (o->*func)(a1, a2, a3);
+ }
+ template <class RET, class A1, class A2, class A3>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3), Object& o, A1& a1, A2& a2, A3& a3) {
+ return (o.*func)(a1, a2, a3);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3, Arg4)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4), A1& a1, A2& a2, A3& a3, A4& a4) {
+ return func(a1, a2, a3, a4);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3, Arg4)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4), A1& a1, A2& a2, A3& a3, A4& a4) {
+ return func(a1, a2, a3, a4);
+ }
+};
+
+
+// -- function adaptors with 6 argument apply
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4) const, const Object* o, A1& a1, A2& a2, A3& a3, A4& a4) {
+ return (o->*func)(a1, a2, a3, a4);
+ }
+ template <class RET, class A1, class A2, class A3, class A4>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4) const, const Object& o, A1& a1, A2& a2, A3& a3, A4& a4) {
+ return (o.*func)(a1, a2, a3, a4);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4), Object* o, A1& a1, A2& a2, A3& a3, A4& a4) {
+ return (o->*func)(a1, a2, a3, a4);
+ }
+ template <class RET, class A1, class A2, class A3, class A4>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4), Object& o, A1& a1, A2& a2, A3& a3, A4& a4) {
+ return (o.*func)(a1, a2, a3, a4);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3, Arg4, Arg5)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return func(a1, a2, a3, a4, a5);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3, Arg4, Arg5)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return func(a1, a2, a3, a4, a5);
+ }
+};
+
+
+// -- function adaptors with 7 argument apply
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5) const, const Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return (o->*func)(a1, a2, a3, a4, a5);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5) const, const Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return (o.*func)(a1, a2, a3, a4, a5);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5), Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return (o->*func)(a1, a2, a3, a4, a5);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5), Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5) {
+ return (o.*func)(a1, a2, a3, a4, a5);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return func(a1, a2, a3, a4, a5, a6);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return func(a1, a2, a3, a4, a5, a6);
+ }
+};
+
+
+// -- function adaptors with 8 argument apply
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6) const, const Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return (o->*func)(a1, a2, a3, a4, a5, a6);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6) const, const Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return (o.*func)(a1, a2, a3, a4, a5, a6);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6), Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return (o->*func)(a1, a2, a3, a4, a5, a6);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6), Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6) {
+ return (o.*func)(a1, a2, a3, a4, a5, a6);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return func(a1, a2, a3, a4, a5, a6, a7);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return func(a1, a2, a3, a4, a5, a6, a7);
+ }
+};
+
+
+// -- function adaptors with 9 argument apply
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7) const, const Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return (o->*func)(a1, a2, a3, a4, a5, a6, a7);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7) const, const Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return (o.*func)(a1, a2, a3, a4, a5, a6, a7);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7), Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return (o->*func)(a1, a2, a3, a4, a5, a6, a7);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7), Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7) {
+ return (o.*func)(a1, a2, a3, a4, a5, a6, a7);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8) {
+ return func(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8) {
+ return func(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+};
+
+
+// -- function adaptors with 10 argument apply
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8) const> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8) const, const Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8) {
+ return (o->*func)(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8) const, const Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8) {
+ return (o.*func)(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+};
+
+template <class Object, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Result>
+struct function_adaptor<Result (Object::*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8), Object* o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8) {
+ return (o->*func)(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+ static Result apply( Result (Object::*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8), Object& o, A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8) {
+ return (o.*func)(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Arg9, class Result>
+struct function_adaptor<Result (Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8, A9& a9) {
+ return func(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+};
+
+template <class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Arg9, class Result>
+struct function_adaptor<Result (*)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)> {
+
+ template<class T> struct sig { typedef Result type; };
+ template <class RET, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+ static Result apply(Result (*func)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9), A1& a1, A2& a2, A3& a3, A4& a4, A5& a5, A6& a6, A7& a7, A8& a8, A9& a9) {
+ return func(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+};
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/is_instance_of.hpp b/ndnboost/lambda/detail/is_instance_of.hpp
new file mode 100644
index 0000000..3e91c66
--- /dev/null
+++ b/ndnboost/lambda/detail/is_instance_of.hpp
@@ -0,0 +1,104 @@
+// Boost Lambda Library - is_instance_of.hpp ---------------------
+
+// Copyright (C) 2001 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// ---------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_IS_INSTANCE_OF
+#define BOOST_LAMBDA_IS_INSTANCE_OF
+
+#include "ndnboost/config.hpp" // for BOOST_STATIC_CONSTANT
+#include "ndnboost/type_traits/conversion_traits.hpp" // for is_convertible
+#include "ndnboost/preprocessor/enum_shifted_params.hpp"
+#include "ndnboost/preprocessor/repeat_2nd.hpp"
+
+// is_instance_of --------------------------------
+//
+// is_instance_of_n<A, B>::value is true, if type A is
+// an instantiation of a template B, or A derives from an instantiation
+// of template B
+//
+// n is the number of template arguments for B
+//
+// Example:
+// is_instance_of_2<std::istream, basic_stream>::value == true
+
+// The original implementation was somewhat different, with different versions
+// for different compilers. However, there was still a problem
+// with gcc.3.0.2 and 3.0.3 compilers, which didn't think regard
+// is_instance_of_N<...>::value was a constant.
+// John Maddock suggested the way around this problem by building
+// is_instance_of templates using ndnboost::is_convertible.
+// Now we only have one version of is_instance_of templates, which delagate
+// all the nasty compiler tricks to is_convertible.
+
+#define BOOST_LAMBDA_CLASS(z, N,A) BOOST_PP_COMMA_IF(N) class
+#define BOOST_LAMBDA_CLASS_ARG(z, N,A) BOOST_PP_COMMA_IF(N) class A##N
+#define BOOST_LAMBDA_ARG(z, N,A) BOOST_PP_COMMA_IF(N) A##N
+
+#define BOOST_LAMBDA_CLASS_LIST(n, NAME) BOOST_PP_REPEAT(n, BOOST_LAMBDA_CLASS, NAME)
+
+#define BOOST_LAMBDA_CLASS_ARG_LIST(n, NAME) BOOST_PP_REPEAT(n, BOOST_LAMBDA_CLASS_ARG, NAME)
+
+#define BOOST_LAMBDA_ARG_LIST(n, NAME) BOOST_PP_REPEAT(n, BOOST_LAMBDA_ARG, NAME)
+
+namespace ndnboost {
+namespace lambda {
+
+#define BOOST_LAMBDA_IS_INSTANCE_OF_TEMPLATE(INDEX) \
+ \
+namespace detail { \
+ \
+template <template<BOOST_LAMBDA_CLASS_LIST(INDEX,T)> class F> \
+struct BOOST_PP_CAT(conversion_tester_,INDEX) { \
+ template<BOOST_LAMBDA_CLASS_ARG_LIST(INDEX,A)> \
+ BOOST_PP_CAT(conversion_tester_,INDEX) \
+ (const F<BOOST_LAMBDA_ARG_LIST(INDEX,A)>&); \
+}; \
+ \
+} /* end detail */ \
+ \
+template <class From, template <BOOST_LAMBDA_CLASS_LIST(INDEX,T)> class To> \
+struct BOOST_PP_CAT(is_instance_of_,INDEX) \
+{ \
+ private: \
+ typedef ::ndnboost::is_convertible< \
+ From, \
+ BOOST_PP_CAT(detail::conversion_tester_,INDEX)<To> \
+ > helper_type; \
+ \
+public: \
+ BOOST_STATIC_CONSTANT(bool, value = helper_type::value); \
+};
+
+
+#define BOOST_LAMBDA_HELPER(z, N, A) BOOST_LAMBDA_IS_INSTANCE_OF_TEMPLATE( BOOST_PP_INC(N) )
+
+// Generate the traits for 1-4 argument templates
+
+BOOST_PP_REPEAT_2ND(4,BOOST_LAMBDA_HELPER,FOO)
+
+#undef BOOST_LAMBDA_HELPER
+#undef BOOST_LAMBDA_IS_INSTANCE_OF_TEMPLATE
+#undef BOOST_LAMBDA_CLASS
+#undef BOOST_LAMBDA_ARG
+#undef BOOST_LAMBDA_CLASS_ARG
+#undef BOOST_LAMBDA_CLASS_LIST
+#undef BOOST_LAMBDA_ARG_LIST
+#undef BOOST_LAMBDA_CLASS_ARG_LIST
+
+} // lambda
+} // boost
+
+#endif
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/lambda_config.hpp b/ndnboost/lambda/detail/lambda_config.hpp
new file mode 100644
index 0000000..9fd1a7b
--- /dev/null
+++ b/ndnboost/lambda/detail/lambda_config.hpp
@@ -0,0 +1,48 @@
+// Boost Lambda Library - lambda_config.hpp ------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// ---------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_LAMBDA_CONFIG_HPP
+#define BOOST_LAMBDA_LAMBDA_CONFIG_HPP
+
+// add to boost/config.hpp
+// for now
+
+
+# if defined __GNUC__
+# if (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# define BOOST_REF_TO_FUNC_CONFLICTS_WITH_REF_TO_T
+# define BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+# endif
+# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
+# define BOOST_NO_TEMPLATED_STREAMS
+# define BOOST_LAMBDA_INCORRECT_BIND_OVERLOADING
+# endif
+# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 95)
+# define BOOST_LAMBDA_FAILS_IN_TEMPLATE_KEYWORD_AFTER_SCOPE_OPER
+# endif
+# endif // __GNUC__
+
+
+#if defined __KCC
+
+#define BOOST_NO_FDECL_TEMPLATES_AS_TEMPLATE_TEMPLATE_PARAMS
+
+#endif // __KCC
+
+#endif
+
+
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/lambda_functor_base.hpp b/ndnboost/lambda/detail/lambda_functor_base.hpp
new file mode 100644
index 0000000..2c90f56
--- /dev/null
+++ b/ndnboost/lambda/detail/lambda_functor_base.hpp
@@ -0,0 +1,615 @@
+// Boost Lambda Library lambda_functor_base.hpp -----------------------------
+//
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// ------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP
+#define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_HPP
+
+#include "ndnboost/type_traits/add_reference.hpp"
+#include "ndnboost/type_traits/add_const.hpp"
+#include "ndnboost/type_traits/remove_const.hpp"
+#include "ndnboost/lambda/detail/lambda_fwd.hpp"
+#include "ndnboost/lambda/detail/lambda_traits.hpp"
+
+namespace ndnboost {
+namespace lambda {
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
+#pragma warning(disable:4512) //assignment operator could not be generated
+#endif
+
+ // for return type deductions we wrap bound argument to this class,
+ // which fulfils the base class contract for lambda_functors
+template <class T>
+class identity {
+
+ T elem;
+public:
+
+ typedef T element_t;
+
+ // take all parameters as const references. Note that non-const references
+ // stay as they are.
+ typedef typename ndnboost::add_reference<
+ typename ndnboost::add_const<T>::type
+ >::type par_t;
+
+ explicit identity(par_t t) : elem(t) {}
+
+ template <typename SigArgs>
+ struct sig { typedef typename ndnboost::remove_const<element_t>::type type; };
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return elem; }
+};
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
+
+template <class T>
+inline lambda_functor<identity<T&> > var(T& t) { return identity<T&>(t); }
+
+ // for lambda functors, var is an identity operator. It was forbidden
+ // at some point, but we might want to var something that can be a
+ // non-lambda functor or a lambda functor.
+template <class T>
+lambda_functor<T> var(const lambda_functor<T>& t) { return t; }
+
+template <class T> struct var_type {
+ typedef lambda_functor<identity<T&> > type;
+};
+
+
+template <class T>
+inline
+lambda_functor<identity<typename bound_argument_conversion<const T>::type> >
+constant(const T& t) {
+ return identity<typename bound_argument_conversion<const T>::type>(t);
+}
+template <class T>
+lambda_functor<T> constant(const lambda_functor<T>& t) { return t; }
+
+template <class T> struct constant_type {
+ typedef
+ lambda_functor<
+ identity<typename bound_argument_conversion<const T>::type>
+ > type;
+};
+
+
+
+template <class T>
+inline lambda_functor<identity<const T&> > constant_ref(const T& t) {
+ return identity<const T&>(t);
+}
+template <class T>
+lambda_functor<T> constant_ref(const lambda_functor<T>& t) { return t; }
+
+template <class T> struct constant_ref_type {
+ typedef
+ lambda_functor<identity<const T&> > type;
+};
+
+
+
+ // as_lambda_functor turns any types to lambda functors
+ // non-lambda_functors will be bound argument types
+template <class T>
+struct as_lambda_functor {
+ typedef typename
+ detail::remove_reference_and_cv<T>::type plain_T;
+ typedef typename
+ detail::IF<is_lambda_functor<plain_T>::value,
+ plain_T,
+ lambda_functor<
+ identity<typename bound_argument_conversion<T>::type>
+ >
+ >::RET type;
+};
+
+// turns arbitrary objects into lambda functors
+template <class T>
+inline
+lambda_functor<identity<typename bound_argument_conversion<const T>::type> >
+to_lambda_functor(const T& t) {
+ return identity<typename bound_argument_conversion<const T>::type>(t);
+}
+
+template <class T>
+inline lambda_functor<T>
+to_lambda_functor(const lambda_functor<T>& t) {
+ return t;
+}
+
+namespace detail {
+
+
+
+// In a call constify_rvals<T>::go(x)
+// x should be of type T. If T is a non-reference type, do
+// returns x as const reference.
+// Otherwise the type doesn't change.
+// The purpose of this class is to avoid
+// 'cannot bind temporaries to non-const references' errors.
+template <class T> struct constify_rvals {
+ template<class U>
+ static inline const U& go(const U& u) { return u; }
+};
+
+template <class T> struct constify_rvals<T&> {
+ template<class U>
+ static inline U& go(U& u) { return u; }
+};
+
+ // check whether one of the elements of a tuple (cons list) is of type
+ // null_type. Needed, because the compiler goes ahead and instantiates
+ // sig template for nullary case even if the nullary operator() is not
+ // called
+template <class T> struct is_null_type
+{ BOOST_STATIC_CONSTANT(bool, value = false); };
+
+template <> struct is_null_type<null_type>
+{ BOOST_STATIC_CONSTANT(bool, value = true); };
+
+template<class Tuple> struct has_null_type {
+ BOOST_STATIC_CONSTANT(bool, value = (is_null_type<typename Tuple::head_type>::value || has_null_type<typename Tuple::tail_type>::value));
+};
+template<> struct has_null_type<null_type> {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+
+// helpers -------------------
+
+
+template<class Args, class SigArgs>
+class deduce_argument_types_ {
+ typedef typename as_lambda_functor<typename Args::head_type>::type lf_t;
+ typedef typename lf_t::inherited::template sig<SigArgs>::type el_t;
+public:
+ typedef
+ ndnboost::tuples::cons<
+ el_t,
+ typename deduce_argument_types_<typename Args::tail_type, SigArgs>::type
+ > type;
+};
+
+template<class SigArgs>
+class deduce_argument_types_<null_type, SigArgs> {
+public:
+ typedef null_type type;
+};
+
+
+// // note that tuples cannot have plain function types as elements.
+// // Hence, all other types will be non-const, except references to
+// // functions.
+// template <class T> struct remove_reference_except_from_functions {
+// typedef typename ndnboost::remove_reference<T>::type t;
+// typedef typename detail::IF<ndnboost::is_function<t>::value, T, t>::RET type;
+// };
+
+template<class Args, class SigArgs>
+class deduce_non_ref_argument_types_ {
+ typedef typename as_lambda_functor<typename Args::head_type>::type lf_t;
+ typedef typename lf_t::inherited::template sig<SigArgs>::type el_t;
+public:
+ typedef
+ ndnboost::tuples::cons<
+ // typename detail::remove_reference_except_from_functions<el_t>::type,
+ typename ndnboost::remove_reference<el_t>::type,
+ typename deduce_non_ref_argument_types_<typename Args::tail_type, SigArgs>::type
+ > type;
+};
+
+template<class SigArgs>
+class deduce_non_ref_argument_types_<null_type, SigArgs> {
+public:
+ typedef null_type type;
+};
+
+ // -------------
+
+// take stored Args and Open Args, and return a const list with
+// deduced elements (real return types)
+template<class Args, class SigArgs>
+class deduce_argument_types {
+ typedef typename deduce_argument_types_<Args, SigArgs>::type t1;
+public:
+ typedef typename detail::IF<
+ has_null_type<t1>::value, null_type, t1
+ >::RET type;
+};
+
+// take stored Args and Open Args, and return a const list with
+// deduced elements (references are stripped from the element types)
+
+template<class Args, class SigArgs>
+class deduce_non_ref_argument_types {
+ typedef typename deduce_non_ref_argument_types_<Args, SigArgs>::type t1;
+public:
+ typedef typename detail::IF<
+ has_null_type<t1>::value, null_type, t1
+ >::RET type;
+};
+
+template <int N, class Args, class SigArgs>
+struct nth_return_type_sig {
+ typedef typename
+ as_lambda_functor<
+ typename ndnboost::tuples::element<N, Args>::type
+ // typename tuple_element_as_reference<N, Args>::type
+ >::type lf_type;
+
+ typedef typename lf_type::inherited::template sig<SigArgs>::type type;
+};
+
+template<int N, class Tuple> struct element_or_null {
+ typedef typename ndnboost::tuples::element<N, Tuple>::type type;
+};
+
+template<int N> struct element_or_null<N, null_type> {
+ typedef null_type type;
+};
+
+
+
+
+} // end detail
+
+ // -- lambda_functor base ---------------------
+
+// the explicit_return_type_action case -----------------------------------
+template<class RET, class Args>
+class lambda_functor_base<explicit_return_type_action<RET>, Args>
+{
+public:
+ Args args;
+
+ typedef RET result_type;
+
+ explicit lambda_functor_base(const Args& a) : args(a) {}
+
+ template <class SigArgs> struct sig { typedef RET type; };
+
+ template<class RET_, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const
+ {
+ return detail::constify_rvals<RET>::go(
+ detail::r_select<RET>::go(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS));
+ }
+};
+
+// the protect_action case -----------------------------------
+template<class Args>
+class lambda_functor_base<protect_action, Args>
+{
+public:
+ Args args;
+public:
+
+ explicit lambda_functor_base(const Args& a) : args(a) {}
+
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const
+ {
+ CALL_USE_ARGS;
+ return ndnboost::tuples::get<0>(args);
+ }
+
+ template<class SigArgs> struct sig {
+ // typedef typename detail::tuple_element_as_reference<0, SigArgs>::type type;
+ typedef typename ndnboost::tuples::element<0, Args>::type type;
+ };
+};
+
+// Do nothing --------------------------------------------------------
+class do_nothing_action {};
+
+template<class Args>
+class lambda_functor_base<do_nothing_action, Args> {
+ // Args args;
+public:
+ // explicit lambda_functor_base(const Args& a) {}
+ lambda_functor_base() {}
+
+
+ template<class RET, CALL_TEMPLATE_ARGS> RET call(CALL_FORMAL_ARGS) const {
+ return CALL_USE_ARGS;
+ }
+
+ template<class SigArgs> struct sig { typedef void type; };
+};
+
+
+// These specializations provide a shorter notation to define actions.
+// These lambda_functor_base instances take care of the recursive evaluation
+// of the arguments and pass the evaluated arguments to the apply function
+// of an action class. To make action X work with these classes, one must
+// instantiate the lambda_functor_base as:
+// lambda_functor_base<action<ARITY, X>, Args>
+// Where ARITY is the arity of the apply function in X
+
+// The return type is queried as:
+// return_type_N<X, EvaluatedArgumentTypes>::type
+// for which there must be a specialization.
+
+// Function actions, casts, throws,... all go via these classes.
+
+
+template<class Act, class Args>
+class lambda_functor_base<action<0, Act>, Args>
+{
+public:
+// Args args; not needed
+ explicit lambda_functor_base(const Args& /*a*/) {}
+
+ template<class SigArgs> struct sig {
+ typedef typename return_type_N<Act, null_type>::type type;
+ };
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const {
+ CALL_USE_ARGS;
+ return Act::template apply<RET>();
+ }
+};
+
+
+#if defined BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART
+#error "Multiple defines of BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART"
+#endif
+
+
+#define BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(ARITY) \
+template<class Act, class Args> \
+class lambda_functor_base<action<ARITY, Act>, Args> \
+{ \
+public: \
+ Args args; \
+ \
+ explicit lambda_functor_base(const Args& a) : args(a) {} \
+ \
+ template<class SigArgs> struct sig { \
+ typedef typename \
+ detail::deduce_argument_types<Args, SigArgs>::type rets_t; \
+ public: \
+ typedef typename \
+ return_type_N_prot<Act, rets_t>::type type; \
+ }; \
+ \
+ \
+ template<class RET, CALL_TEMPLATE_ARGS> \
+ RET call(CALL_FORMAL_ARGS) const { \
+ using ndnboost::tuples::get; \
+ using detail::constify_rvals; \
+ using detail::r_select; \
+ using detail::element_or_null; \
+ using detail::deduce_argument_types;
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(1)
+
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(2)
+
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(3)
+
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(4)
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(5)
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+ typedef typename element_or_null<4, rets_t>::type rt4;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(6)
+
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+ typedef typename element_or_null<4, rets_t>::type rt4;
+ typedef typename element_or_null<5, rets_t>::type rt5;
+
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(7)
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+ typedef typename element_or_null<4, rets_t>::type rt4;
+ typedef typename element_or_null<5, rets_t>::type rt5;
+ typedef typename element_or_null<6, rets_t>::type rt6;
+
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(8)
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+ typedef typename element_or_null<4, rets_t>::type rt4;
+ typedef typename element_or_null<5, rets_t>::type rt5;
+ typedef typename element_or_null<6, rets_t>::type rt6;
+ typedef typename element_or_null<7, rets_t>::type rt7;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt7>::go(r_select<rt7>::go(get<7>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(9)
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+ typedef typename element_or_null<4, rets_t>::type rt4;
+ typedef typename element_or_null<5, rets_t>::type rt5;
+ typedef typename element_or_null<6, rets_t>::type rt6;
+ typedef typename element_or_null<7, rets_t>::type rt7;
+ typedef typename element_or_null<8, rets_t>::type rt8;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt7>::go(r_select<rt7>::go(get<7>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt8>::go(r_select<rt8>::go(get<8>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART(10)
+ typedef typename
+ deduce_argument_types<Args, tuple<CALL_REFERENCE_TYPES> >::type rets_t;
+ typedef typename element_or_null<0, rets_t>::type rt0;
+ typedef typename element_or_null<1, rets_t>::type rt1;
+ typedef typename element_or_null<2, rets_t>::type rt2;
+ typedef typename element_or_null<3, rets_t>::type rt3;
+ typedef typename element_or_null<4, rets_t>::type rt4;
+ typedef typename element_or_null<5, rets_t>::type rt5;
+ typedef typename element_or_null<6, rets_t>::type rt6;
+ typedef typename element_or_null<7, rets_t>::type rt7;
+ typedef typename element_or_null<8, rets_t>::type rt8;
+ typedef typename element_or_null<9, rets_t>::type rt9;
+
+ return Act::template apply<RET>(
+ constify_rvals<rt0>::go(r_select<rt0>::go(get<0>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt1>::go(r_select<rt1>::go(get<1>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt2>::go(r_select<rt2>::go(get<2>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt3>::go(r_select<rt3>::go(get<3>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt4>::go(r_select<rt4>::go(get<4>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt5>::go(r_select<rt5>::go(get<5>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt6>::go(r_select<rt6>::go(get<6>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt7>::go(r_select<rt7>::go(get<7>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt8>::go(r_select<rt8>::go(get<8>(args), CALL_ACTUAL_ARGS)),
+ constify_rvals<rt9>::go(r_select<rt9>::go(get<9>(args), CALL_ACTUAL_ARGS))
+ );
+ }
+};
+
+#undef BOOST_LAMBDA_LAMBDA_FUNCTOR_BASE_FIRST_PART
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/detail/lambda_functors.hpp b/ndnboost/lambda/detail/lambda_functors.hpp
new file mode 100644
index 0000000..a6a9a7c
--- /dev/null
+++ b/ndnboost/lambda/detail/lambda_functors.hpp
@@ -0,0 +1,357 @@
+// Boost Lambda Library - lambda_functors.hpp -------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see http://www.boost.org
+
+// ------------------------------------------------
+
+#ifndef BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP
+#define BOOST_LAMBDA_LAMBDA_FUNCTORS_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/utility/result_of.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
+
+#include <ndnboost/mpl/or.hpp>
+#include <ndnboost/utility/enable_if.hpp>
+#include <ndnboost/type_traits/is_array.hpp>
+
+#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1)\
+ typename lazy_disable_if<is_array<A1>, typename R1 >::type
+#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) \
+ typename lazy_disable_if<mpl::or_<is_array<A1>, is_array<A2> >, typename R1, R2 >::type
+#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) \
+ typename lazy_disable_if<mpl::or_<is_array<A1>, is_array<A2>, is_array<A3> >, typename R1, R2, R3 >::type
+
+#else
+
+#define BOOST_LAMBDA_DISABLE_IF_ARRAY1(A1, R1) typename R1::type
+#define BOOST_LAMBDA_DISABLE_IF_ARRAY2(A1, A2, R1, R2) typename R1, R2::type
+#define BOOST_LAMBDA_DISABLE_IF_ARRAY3(A1, A2, A3, R1, R2, R3) typename R1, R2, R3::type
+
+#endif
+
+namespace ndnboost {
+namespace lambda {
+
+// -- lambda_functor --------------------------------------------
+// --------------------------------------------------------------
+
+//inline const null_type const_null_type() { return null_type(); }
+
+namespace detail {
+namespace {
+
+ static const null_type constant_null_type = null_type();
+
+} // unnamed
+} // detail
+
+class unused {};
+
+#define cnull_type() detail::constant_null_type
+
+// -- free variables types --------------------------------------------------
+
+ // helper to work around the case where the nullary return type deduction
+ // is always performed, even though the functor is not nullary
+namespace detail {
+ template<int N, class Tuple> struct get_element_or_null_type {
+ typedef typename
+ detail::tuple_element_as_reference<N, Tuple>::type type;
+ };
+ template<int N> struct get_element_or_null_type<N, null_type> {
+ typedef null_type type;
+ };
+}
+
+template <int I> struct placeholder;
+
+template<> struct placeholder<FIRST> {
+
+ template<class SigArgs> struct sig {
+ typedef typename detail::get_element_or_null_type<0, SigArgs>::type type;
+ };
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const {
+ BOOST_STATIC_ASSERT(ndnboost::is_reference<RET>::value);
+ CALL_USE_ARGS; // does nothing, prevents warnings for unused args
+ return a;
+ }
+};
+
+template<> struct placeholder<SECOND> {
+
+ template<class SigArgs> struct sig {
+ typedef typename detail::get_element_or_null_type<1, SigArgs>::type type;
+ };
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return b; }
+};
+
+template<> struct placeholder<THIRD> {
+
+ template<class SigArgs> struct sig {
+ typedef typename detail::get_element_or_null_type<2, SigArgs>::type type;
+ };
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return c; }
+};
+
+template<> struct placeholder<EXCEPTION> {
+
+ template<class SigArgs> struct sig {
+ typedef typename detail::get_element_or_null_type<3, SigArgs>::type type;
+ };
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const { CALL_USE_ARGS; return env; }
+};
+
+typedef const lambda_functor<placeholder<FIRST> > placeholder1_type;
+typedef const lambda_functor<placeholder<SECOND> > placeholder2_type;
+typedef const lambda_functor<placeholder<THIRD> > placeholder3_type;
+
+
+///////////////////////////////////////////////////////////////////////////////
+
+
+// free variables are lambda_functors. This is to allow uniform handling with
+// other lambda_functors.
+// -------------------------------------------------------------------
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(push)
+#pragma warning(disable:4512) //assignment operator could not be generated
+#endif
+
+// -- lambda_functor NONE ------------------------------------------------
+template <class T>
+class lambda_functor : public T
+{
+
+BOOST_STATIC_CONSTANT(int, arity_bits = get_arity<T>::value);
+
+public:
+ typedef T inherited;
+
+ lambda_functor() {}
+ lambda_functor(const lambda_functor& l) : inherited(l) {}
+
+ lambda_functor(const T& t) : inherited(t) {}
+
+ template <class SigArgs> struct sig {
+ typedef typename inherited::template
+ sig<typename SigArgs::tail_type>::type type;
+ };
+
+ // Note that this return type deduction template is instantiated, even
+ // if the nullary
+ // operator() is not called at all. One must make sure that it does not fail.
+ typedef typename
+ inherited::template sig<null_type>::type
+ nullary_return_type;
+
+ // Support for ndnboost::result_of.
+ template <class Sig> struct result;
+ template <class F>
+ struct result<F()> {
+ typedef nullary_return_type type;
+ };
+ template <class F, class A>
+ struct result<F(A)> {
+ typedef typename sig<tuple<F, A> >::type type;
+ };
+ template <class F, class A, class B>
+ struct result<F(A, B)> {
+ typedef typename sig<tuple<F, A, B> >::type type;
+ };
+ template <class F, class A, class B, class C>
+ struct result<F(A, B, C)> {
+ typedef typename sig<tuple<F, A, B, C> >::type type;
+ };
+
+ nullary_return_type operator()() const {
+ return inherited::template
+ call<nullary_return_type>
+ (cnull_type(), cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A>
+ typename inherited::template sig<tuple<A&> >::type
+ operator()(A& a) const {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A&> >::type
+ >(a, cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A>
+ BOOST_LAMBDA_DISABLE_IF_ARRAY1(A, inherited::template sig<tuple<A const&> >)
+ operator()(A const& a) const {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A const&> >::type
+ >(a, cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ typename inherited::template sig<tuple<A&, B&> >::type
+ operator()(A& a, B& b) const {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A&, B&> >::type
+ >(a, b, cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A const&, B&> >)
+ operator()(A const& a, B& b) const {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A const&, B&> >::type
+ >(a, b, cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A&, B const&> >)
+ operator()(A& a, B const& b) const {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A&, B const&> >::type
+ >(a, b, cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ BOOST_LAMBDA_DISABLE_IF_ARRAY2(A, B, inherited::template sig<tuple<A const&, B const&> >)
+ operator()(A const& a, B const& b) const {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A const&, B const&> >::type
+ >(a, b, cnull_type(), cnull_type());
+ }
+
+ template<class A, class B, class C>
+ typename inherited::template sig<tuple<A&, B&, C&> >::type
+ operator()(A& a, B& b, C& c) const
+ {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A&, B&, C&> >::type
+ >(a, b, c, cnull_type());
+ }
+
+ template<class A, class B, class C>
+ BOOST_LAMBDA_DISABLE_IF_ARRAY3(A, B, C, inherited::template sig<tuple<A const&, B const&, C const&> >)
+ operator()(A const& a, B const& b, C const& c) const
+ {
+ return inherited::template call<
+ typename inherited::template sig<tuple<A const&, B const&, C const&> >::type
+ >(a, b, c, cnull_type());
+ }
+
+ // for internal calls with env
+ template<CALL_TEMPLATE_ARGS>
+ typename inherited::template sig<tuple<CALL_REFERENCE_TYPES> >::type
+ internal_call(CALL_FORMAL_ARGS) const {
+ return inherited::template
+ call<typename inherited::template
+ sig<tuple<CALL_REFERENCE_TYPES> >::type>(CALL_ACTUAL_ARGS);
+ }
+
+ template<class A>
+ const lambda_functor<lambda_functor_base<
+ other_action<assignment_action>,
+ ndnboost::tuple<lambda_functor,
+ typename const_copy_argument <const A>::type> > >
+ operator=(const A& a) const {
+ return lambda_functor_base<
+ other_action<assignment_action>,
+ ndnboost::tuple<lambda_functor,
+ typename const_copy_argument <const A>::type> >
+ ( ndnboost::tuple<lambda_functor,
+ typename const_copy_argument <const A>::type>(*this, a) );
+ }
+
+ template<class A>
+ const lambda_functor<lambda_functor_base<
+ other_action<subscript_action>,
+ ndnboost::tuple<lambda_functor,
+ typename const_copy_argument <const A>::type> > >
+ operator[](const A& a) const {
+ return lambda_functor_base<
+ other_action<subscript_action>,
+ ndnboost::tuple<lambda_functor,
+ typename const_copy_argument <const A>::type> >
+ ( ndnboost::tuple<lambda_functor,
+ typename const_copy_argument <const A>::type>(*this, a ) );
+ }
+};
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
+#pragma warning(pop)
+#endif
+
+} // namespace lambda
+} // namespace ndnboost
+
+namespace ndnboost {
+
+#if !defined(BOOST_RESULT_OF_USE_DECLTYPE) || defined(BOOST_NO_DECLTYPE)
+
+template<class T>
+struct result_of<ndnboost::lambda::lambda_functor<T>()>
+{
+ typedef typename ndnboost::lambda::lambda_functor<T>::nullary_return_type type;
+};
+
+template<class T>
+struct result_of<const ndnboost::lambda::lambda_functor<T>()>
+{
+ typedef typename ndnboost::lambda::lambda_functor<T>::nullary_return_type type;
+};
+
+#endif
+
+template<class T>
+struct tr1_result_of<ndnboost::lambda::lambda_functor<T>()>
+{
+ typedef typename ndnboost::lambda::lambda_functor<T>::nullary_return_type type;
+};
+
+template<class T>
+struct tr1_result_of<const ndnboost::lambda::lambda_functor<T>()>
+{
+ typedef typename ndnboost::lambda::lambda_functor<T>::nullary_return_type type;
+};
+
+}
+
+// is_placeholder
+
+#include <ndnboost/is_placeholder.hpp>
+
+namespace ndnboost
+{
+
+template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder<lambda::FIRST> > >
+{
+ enum _vt { value = 1 };
+};
+
+template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder<lambda::SECOND> > >
+{
+ enum _vt { value = 2 };
+};
+
+template<> struct is_placeholder< lambda::lambda_functor< lambda::placeholder<lambda::THIRD> > >
+{
+ enum _vt { value = 3 };
+};
+
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/detail/lambda_fwd.hpp b/ndnboost/lambda/detail/lambda_fwd.hpp
new file mode 100644
index 0000000..e0253b7
--- /dev/null
+++ b/ndnboost/lambda/detail/lambda_fwd.hpp
@@ -0,0 +1,74 @@
+// lambda_fwd.hpp - Boost Lambda Library -------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// -------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_FWD_HPP
+#define BOOST_LAMBDA_FWD_HPP
+
+namespace ndnboost {
+namespace lambda {
+
+namespace detail {
+
+template<class T> struct generate_error;
+
+}
+// -- placeholders --------------------------------------------
+
+template <int I> struct placeholder;
+
+// function_adaptors
+template <class Func>
+struct function_adaptor;
+
+template <int I, class Act> class action;
+
+template <class Base>
+class lambda_functor;
+
+template <class Act, class Args>
+class lambda_functor_base;
+
+} // namespace lambda
+} // namespace ndnboost
+
+
+// #define CALL_TEMPLATE_ARGS class A, class Env
+// #define CALL_FORMAL_ARGS A& a, Env& env
+// #define CALL_ACTUAL_ARGS a, env
+// #define CALL_ACTUAL_ARGS_NO_ENV a
+// #define CALL_REFERENCE_TYPES A&, Env&
+// #define CALL_PLAIN_TYPES A, Env
+#define CALL_TEMPLATE_ARGS class A, class B, class C, class Env
+#define CALL_FORMAL_ARGS A& a, B& b, C& c, Env& env
+#define CALL_ACTUAL_ARGS a, b, c, env
+#define CALL_ACTUAL_ARGS_NO_ENV a, b, c
+#define CALL_REFERENCE_TYPES A&, B&, C&, Env&
+#define CALL_PLAIN_TYPES A, B, C, Env
+
+namespace ndnboost {
+namespace lambda {
+namespace detail {
+
+template<class A1, class A2, class A3, class A4>
+void do_nothing(A1&, A2&, A3&, A4&) {}
+
+} // detail
+} // lambda
+} // boost
+
+// prevent the warnings from unused arguments
+#define CALL_USE_ARGS \
+::ndnboost::lambda::detail::do_nothing(a, b, c, env)
+
+
+
+#endif
diff --git a/ndnboost/lambda/detail/lambda_traits.hpp b/ndnboost/lambda/detail/lambda_traits.hpp
new file mode 100644
index 0000000..aa241b6
--- /dev/null
+++ b/ndnboost/lambda/detail/lambda_traits.hpp
@@ -0,0 +1,578 @@
+// - lambda_traits.hpp --- Boost Lambda Library ----------------------------
+//
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+// -------------------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_LAMBDA_TRAITS_HPP
+#define BOOST_LAMBDA_LAMBDA_TRAITS_HPP
+
+#include "ndnboost/type_traits/transform_traits.hpp"
+#include "ndnboost/type_traits/cv_traits.hpp"
+#include "ndnboost/type_traits/function_traits.hpp"
+#include "ndnboost/type_traits/object_traits.hpp"
+#include "ndnboost/tuple/tuple.hpp"
+
+namespace ndnboost {
+namespace lambda {
+
+// -- if construct ------------------------------------------------
+// Proposed by Krzysztof Czarnecki and Ulrich Eisenecker
+
+namespace detail {
+
+template <bool If, class Then, class Else> struct IF { typedef Then RET; };
+
+template <class Then, class Else> struct IF<false, Then, Else> {
+ typedef Else RET;
+};
+
+
+// An if construct that doesn't instantiate the non-matching template:
+
+// Called as:
+// IF_type<condition, A, B>::type
+// The matching template must define the typeded 'type'
+// I.e. A::type if condition is true, B::type if condition is false
+// Idea from Vesa Karvonen (from C&E as well I guess)
+template<class T>
+struct IF_type_
+{
+ typedef typename T::type type;
+};
+
+
+template<bool C, class T, class E>
+struct IF_type
+{
+ typedef typename
+ IF_type_<typename IF<C, T, E>::RET >::type type;
+};
+
+// helper that can be used to give typedef T to some type
+template <class T> struct identity_mapping { typedef T type; };
+
+// An if construct for finding an integral constant 'value'
+// Does not instantiate the non-matching branch
+// Called as IF_value<condition, A, B>::value
+// If condition is true A::value must be defined, otherwise B::value
+
+template<class T>
+struct IF_value_
+{
+ BOOST_STATIC_CONSTANT(int, value = T::value);
+};
+
+
+template<bool C, class T, class E>
+struct IF_value
+{
+ BOOST_STATIC_CONSTANT(int, value = (IF_value_<typename IF<C, T, E>::RET>::value));
+};
+
+
+// --------------------------------------------------------------
+
+// removes reference from other than function types:
+template<class T> class remove_reference_if_valid
+{
+
+ typedef typename ndnboost::remove_reference<T>::type plainT;
+public:
+ typedef typename IF<
+ ndnboost::is_function<plainT>::value,
+ T,
+ plainT
+ >::RET type;
+
+};
+
+
+template<class T> struct remove_reference_and_cv {
+ typedef typename ndnboost::remove_cv<
+ typename ndnboost::remove_reference<T>::type
+ >::type type;
+};
+
+
+
+// returns a reference to the element of tuple T
+template<int N, class T> struct tuple_element_as_reference {
+ typedef typename
+ ndnboost::tuples::access_traits<
+ typename ndnboost::tuples::element<N, T>::type
+ >::non_const_type type;
+};
+
+// returns the cv and reverence stripped type of a tuple element
+template<int N, class T> struct tuple_element_stripped {
+ typedef typename
+ remove_reference_and_cv<
+ typename ndnboost::tuples::element<N, T>::type
+ >::type type;
+};
+
+// is_lambda_functor -------------------------------------------------
+
+template <class T> struct is_lambda_functor_ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+};
+
+template <class Arg> struct is_lambda_functor_<lambda_functor<Arg> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+} // end detail
+
+
+template <class T> struct is_lambda_functor {
+ BOOST_STATIC_CONSTANT(bool,
+ value =
+ detail::is_lambda_functor_<
+ typename detail::remove_reference_and_cv<T>::type
+ >::value);
+};
+
+
+namespace detail {
+
+// -- parameter_traits_ ---------------------------------------------
+
+// An internal parameter type traits class that respects
+// the reference_wrapper class.
+
+// The conversions performed are:
+// references -> compile_time_error
+// T1 -> T2,
+// reference_wrapper<T> -> T&
+// const array -> ref to const array
+// array -> ref to array
+// function -> ref to function
+
+// ------------------------------------------------------------------------
+
+template<class T1, class T2>
+struct parameter_traits_ {
+ typedef T2 type;
+};
+
+// Do not instantiate with reference types
+template<class T, class Any> struct parameter_traits_<T&, Any> {
+ typedef typename
+ generate_error<T&>::
+ parameter_traits_class_instantiated_with_reference_type type;
+};
+
+// Arrays can't be stored as plain types; convert them to references
+template<class T, int n, class Any> struct parameter_traits_<T[n], Any> {
+ typedef T (&type)[n];
+};
+
+template<class T, int n, class Any>
+struct parameter_traits_<const T[n], Any> {
+ typedef const T (&type)[n];
+};
+
+template<class T, int n, class Any>
+struct parameter_traits_<volatile T[n], Any> {
+ typedef volatile T (&type)[n];
+};
+template<class T, int n, class Any>
+struct parameter_traits_<const volatile T[n], Any> {
+ typedef const volatile T (&type)[n];
+};
+
+
+template<class T, class Any>
+struct parameter_traits_<ndnboost::reference_wrapper<T>, Any >{
+ typedef T& type;
+};
+
+template<class T, class Any>
+struct parameter_traits_<const ndnboost::reference_wrapper<T>, Any >{
+ typedef T& type;
+};
+
+template<class T, class Any>
+struct parameter_traits_<volatile ndnboost::reference_wrapper<T>, Any >{
+ typedef T& type;
+};
+
+template<class T, class Any>
+struct parameter_traits_<const volatile ndnboost::reference_wrapper<T>, Any >{
+ typedef T& type;
+};
+
+template<class Any>
+struct parameter_traits_<void, Any> {
+ typedef void type;
+};
+
+template<class Arg, class Any>
+struct parameter_traits_<lambda_functor<Arg>, Any > {
+ typedef lambda_functor<Arg> type;
+};
+
+template<class Arg, class Any>
+struct parameter_traits_<const lambda_functor<Arg>, Any > {
+ typedef lambda_functor<Arg> type;
+};
+
+// Are the volatile versions needed?
+template<class Arg, class Any>
+struct parameter_traits_<volatile lambda_functor<Arg>, Any > {
+ typedef lambda_functor<Arg> type;
+};
+
+template<class Arg, class Any>
+struct parameter_traits_<const volatile lambda_functor<Arg>, Any > {
+ typedef lambda_functor<Arg> type;
+};
+
+} // end namespace detail
+
+
+// ------------------------------------------------------------------------
+// traits classes for lambda expressions (bind functions, operators ...)
+
+// must be instantiated with non-reference types
+
+// The default is const plain type -------------------------
+// const T -> const T,
+// T -> const T,
+// references -> compile_time_error
+// reference_wrapper<T> -> T&
+// array -> const ref array
+template<class T>
+struct const_copy_argument {
+ typedef typename
+ detail::parameter_traits_<
+ T,
+ typename detail::IF<ndnboost::is_function<T>::value, T&, const T>::RET
+ >::type type;
+};
+
+// T may be a function type. Without the IF test, const would be added
+// to a function type, which is illegal.
+
+// all arrays are converted to const.
+// This traits template is used for 'const T&' parameter passing
+// and thus the knowledge of the potential
+// non-constness of an actual argument is lost.
+template<class T, int n> struct const_copy_argument <T[n]> {
+ typedef const T (&type)[n];
+};
+template<class T, int n> struct const_copy_argument <volatile T[n]> {
+ typedef const volatile T (&type)[n];
+};
+
+template<class T>
+struct const_copy_argument<T&> {};
+// do not instantiate with references
+ // typedef typename detail::generate_error<T&>::references_not_allowed type;
+
+
+template<>
+struct const_copy_argument<void> {
+ typedef void type;
+};
+
+
+// Does the same as const_copy_argument, but passes references through as such
+template<class T>
+struct bound_argument_conversion {
+ typedef typename const_copy_argument<T>::type type;
+};
+
+template<class T>
+struct bound_argument_conversion<T&> {
+ typedef T& type;
+};
+
+// The default is non-const reference -------------------------
+// const T -> const T&,
+// T -> T&,
+// references -> compile_time_error
+// reference_wrapper<T> -> T&
+template<class T>
+struct reference_argument {
+ typedef typename detail::parameter_traits_<T, T&>::type type;
+};
+
+template<class T>
+struct reference_argument<T&> {
+ typedef typename detail::generate_error<T&>::references_not_allowed type;
+};
+
+template<class Arg>
+struct reference_argument<lambda_functor<Arg> > {
+ typedef lambda_functor<Arg> type;
+};
+
+template<class Arg>
+struct reference_argument<const lambda_functor<Arg> > {
+ typedef lambda_functor<Arg> type;
+};
+
+// Are the volatile versions needed?
+template<class Arg>
+struct reference_argument<volatile lambda_functor<Arg> > {
+ typedef lambda_functor<Arg> type;
+};
+
+template<class Arg>
+struct reference_argument<const volatile lambda_functor<Arg> > {
+ typedef lambda_functor<Arg> type;
+};
+
+template<>
+struct reference_argument<void> {
+ typedef void type;
+};
+
+namespace detail {
+
+// Array to pointer conversion
+template <class T>
+struct array_to_pointer {
+ typedef T type;
+};
+
+template <class T, int N>
+struct array_to_pointer <const T[N]> {
+ typedef const T* type;
+};
+template <class T, int N>
+struct array_to_pointer <T[N]> {
+ typedef T* type;
+};
+
+template <class T, int N>
+struct array_to_pointer <const T (&) [N]> {
+ typedef const T* type;
+};
+template <class T, int N>
+struct array_to_pointer <T (&) [N]> {
+ typedef T* type;
+};
+
+
+// ---------------------------------------------------------------------------
+// The call_traits for bind
+// Respects the reference_wrapper class.
+
+// These templates are used outside of bind functions as well.
+// the bind_tuple_mapper provides a shorter notation for default
+// bound argument storing semantics, if all arguments are treated
+// uniformly.
+
+// from template<class T> foo(const T& t) : bind_traits<const T>::type
+// from template<class T> foo(T& t) : bind_traits<T>::type
+
+// Conversions:
+// T -> const T,
+// cv T -> cv T,
+// T& -> T&
+// reference_wrapper<T> -> T&
+// const reference_wrapper<T> -> T&
+// array -> const ref array
+
+// make bound arguments const, this is a deliberate design choice, the
+// purpose is to prevent side effects to bound arguments that are stored
+// as copies
+template<class T>
+struct bind_traits {
+ typedef const T type;
+};
+
+template<class T>
+struct bind_traits<T&> {
+ typedef T& type;
+};
+
+// null_types are an exception, we always want to store them as non const
+// so that other templates can assume that null_type is always without const
+template<>
+struct bind_traits<null_type> {
+ typedef null_type type;
+};
+
+// the bind_tuple_mapper, bind_type_generators may
+// introduce const to null_type
+template<>
+struct bind_traits<const null_type> {
+ typedef null_type type;
+};
+
+// Arrays can't be stored as plain types; convert them to references.
+// All arrays are converted to const. This is because bind takes its
+// parameters as const T& and thus the knowledge of the potential
+// non-constness of actual argument is lost.
+template<class T, int n> struct bind_traits <T[n]> {
+ typedef const T (&type)[n];
+};
+
+template<class T, int n>
+struct bind_traits<const T[n]> {
+ typedef const T (&type)[n];
+};
+
+template<class T, int n> struct bind_traits<volatile T[n]> {
+ typedef const volatile T (&type)[n];
+};
+
+template<class T, int n>
+struct bind_traits<const volatile T[n]> {
+ typedef const volatile T (&type)[n];
+};
+
+template<class R>
+struct bind_traits<R()> {
+ typedef R(&type)();
+};
+
+template<class R, class Arg1>
+struct bind_traits<R(Arg1)> {
+ typedef R(&type)(Arg1);
+};
+
+template<class R, class Arg1, class Arg2>
+struct bind_traits<R(Arg1, Arg2)> {
+ typedef R(&type)(Arg1, Arg2);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3>
+struct bind_traits<R(Arg1, Arg2, Arg3)> {
+ typedef R(&type)(Arg1, Arg2, Arg3);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3, class Arg4>
+struct bind_traits<R(Arg1, Arg2, Arg3, Arg4)> {
+ typedef R(&type)(Arg1, Arg2, Arg3, Arg4);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5>
+struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5)> {
+ typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6>
+struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6)> {
+ typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7>
+struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7)> {
+ typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8>
+struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8)> {
+ typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8);
+};
+
+template<class R, class Arg1, class Arg2, class Arg3, class Arg4, class Arg5, class Arg6, class Arg7, class Arg8, class Arg9>
+struct bind_traits<R(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9)> {
+ typedef R(&type)(Arg1, Arg2, Arg3, Arg4, Arg5, Arg6, Arg7, Arg8, Arg9);
+};
+
+template<class T>
+struct bind_traits<reference_wrapper<T> >{
+ typedef T& type;
+};
+
+template<class T>
+struct bind_traits<const reference_wrapper<T> >{
+ typedef T& type;
+};
+
+template<>
+struct bind_traits<void> {
+ typedef void type;
+};
+
+
+
+template <
+ class T0 = null_type, class T1 = null_type, class T2 = null_type,
+ class T3 = null_type, class T4 = null_type, class T5 = null_type,
+ class T6 = null_type, class T7 = null_type, class T8 = null_type,
+ class T9 = null_type
+>
+struct bind_tuple_mapper {
+ typedef
+ tuple<typename bind_traits<T0>::type,
+ typename bind_traits<T1>::type,
+ typename bind_traits<T2>::type,
+ typename bind_traits<T3>::type,
+ typename bind_traits<T4>::type,
+ typename bind_traits<T5>::type,
+ typename bind_traits<T6>::type,
+ typename bind_traits<T7>::type,
+ typename bind_traits<T8>::type,
+ typename bind_traits<T9>::type> type;
+};
+
+// bind_traits, except map const T& -> const T
+ // this is needed e.g. in currying. Const reference arguments can
+ // refer to temporaries, so it is not safe to store them as references.
+ template <class T> struct remove_const_reference {
+ typedef typename bind_traits<T>::type type;
+ };
+
+ template <class T> struct remove_const_reference<const T&> {
+ typedef const T type;
+ };
+
+
+// maps the bind argument types to the resulting lambda functor type
+template <
+ class T0 = null_type, class T1 = null_type, class T2 = null_type,
+ class T3 = null_type, class T4 = null_type, class T5 = null_type,
+ class T6 = null_type, class T7 = null_type, class T8 = null_type,
+ class T9 = null_type
+>
+class bind_type_generator {
+
+ typedef typename
+ detail::bind_tuple_mapper<
+ T0, T1, T2, T3, T4, T5, T6, T7, T8, T9
+ >::type args_t;
+
+ BOOST_STATIC_CONSTANT(int, nof_elems = ndnboost::tuples::length<args_t>::value);
+
+ typedef
+ action<
+ nof_elems,
+ function_action<nof_elems>
+ > action_type;
+
+public:
+ typedef
+ lambda_functor<
+ lambda_functor_base<
+ action_type,
+ args_t
+ >
+ > type;
+
+};
+
+
+
+} // detail
+
+template <class T> inline const T& make_const(const T& t) { return t; }
+
+
+} // end of namespace lambda
+} // end of namespace ndnboost
+
+
+
+#endif // BOOST_LAMBDA_TRAITS_HPP
diff --git a/ndnboost/lambda/detail/member_ptr.hpp b/ndnboost/lambda/detail/member_ptr.hpp
new file mode 100644
index 0000000..37c10ab
--- /dev/null
+++ b/ndnboost/lambda/detail/member_ptr.hpp
@@ -0,0 +1,737 @@
+// Boost Lambda Library -- member_ptr.hpp ---------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+// Copyright (C) 2000 Gary Powell (gary.powell@sierra.com)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// --------------------------------------------------------------------------
+
+#if !defined(BOOST_LAMBDA_MEMBER_PTR_HPP)
+#define BOOST_LAMBDA_MEMBER_PTR_HPP
+
+namespace ndnboost {
+namespace lambda {
+
+
+class member_pointer_action {};
+
+
+namespace detail {
+
+// the boost type_traits member_pointer traits are not enough,
+// need to know more details.
+template<class T>
+struct member_pointer {
+ typedef typename ndnboost::add_reference<T>::type type;
+ typedef detail::unspecified class_type;
+ typedef detail::unspecified qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = false);
+};
+
+template<class T, class U>
+struct member_pointer<T U::*> {
+ typedef typename ndnboost::add_reference<T>::type type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = true);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = false);
+};
+
+template<class T, class U>
+struct member_pointer<const T U::*> {
+ typedef typename ndnboost::add_reference<const T>::type type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = true);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = false);
+};
+
+template<class T, class U>
+struct member_pointer<volatile T U::*> {
+ typedef typename ndnboost::add_reference<volatile T>::type type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = true);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = false);
+};
+
+template<class T, class U>
+struct member_pointer<const volatile T U::*> {
+ typedef typename ndnboost::add_reference<const volatile T>::type type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = true);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = false);
+};
+
+// -- nonconst member functions --
+template<class T, class U>
+struct member_pointer<T (U::*)()> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1>
+struct member_pointer<T (U::*)(A1)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2>
+struct member_pointer<T (U::*)(A1, A2)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3>
+struct member_pointer<T (U::*)(A1, A2, A3)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4>
+struct member_pointer<T (U::*)(A1, A2, A3, A4)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8, class A9>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9)> {
+ typedef T type;
+ typedef U class_type;
+ typedef U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+// -- const member functions --
+template<class T, class U>
+struct member_pointer<T (U::*)() const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1>
+struct member_pointer<T (U::*)(A1) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2>
+struct member_pointer<T (U::*)(A1, A2) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3>
+struct member_pointer<T (U::*)(A1, A2, A3) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4>
+struct member_pointer<T (U::*)(A1, A2, A3, A4) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8, class A9>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const> {
+ typedef T type;
+ typedef U class_type;
+ typedef const U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+ // -- volatile --
+template<class T, class U>
+struct member_pointer<T (U::*)() volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1>
+struct member_pointer<T (U::*)(A1) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2>
+struct member_pointer<T (U::*)(A1, A2) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3>
+struct member_pointer<T (U::*)(A1, A2, A3) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4>
+struct member_pointer<T (U::*)(A1, A2, A3, A4) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8, class A9>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9) volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+ // -- const volatile
+template<class T, class U>
+struct member_pointer<T (U::*)() const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1>
+struct member_pointer<T (U::*)(A1) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2>
+struct member_pointer<T (U::*)(A1, A2) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3>
+struct member_pointer<T (U::*)(A1, A2, A3) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4>
+struct member_pointer<T (U::*)(A1, A2, A3, A4) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+template<class T, class U, class A1, class A2, class A3, class A4, class A5,
+ class A6, class A7, class A8, class A9>
+struct member_pointer<T (U::*)(A1, A2, A3, A4, A5, A6, A7, A8, A9) const volatile> {
+ typedef T type;
+ typedef U class_type;
+ typedef const volatile U qualified_class_type;
+ BOOST_STATIC_CONSTANT(bool, is_data_member = false);
+ BOOST_STATIC_CONSTANT(bool, is_function_member = true);
+};
+
+} // detail
+
+namespace detail {
+
+ // this class holds a pointer to a member function and the object.
+ // when called, it just calls the member function with the parameters
+ // provided
+
+ // It would have been possible to use existing lambda_functors to represent
+ // a bound member function like this, but to have a separate template is
+ // safer, since now this functor doesn't mix and match with lambda_functors
+ // only thing you can do with this is to call it
+
+ // note that previously instantiated classes
+ // (other_action<member_pointer_action> and member_pointer_action_helper
+ // guarantee, that A and B are
+ // such types, that for objects a and b of corresponding types, a->*b leads
+ // to the builtin ->* to be called. So types that would end in a call to
+ // a user defined ->* do not create a member_pointer_caller object.
+
+template<class RET, class A, class B>
+class member_pointer_caller {
+ A a; B b;
+
+public:
+ member_pointer_caller(const A& aa, const B& bb) : a(aa), b(bb) {}
+
+ RET operator()() const { return (a->*b)(); }
+
+ template<class A1>
+ RET operator()(const A1& a1) const { return (a->*b)(a1); }
+
+ template<class A1, class A2>
+ RET operator()(const A1& a1, const A2& a2) const { return (a->*b)(a1, a2); }
+
+ template<class A1, class A2, class A3>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3) const {
+ return (a->*b)(a1, a2, a3);
+ }
+
+ template<class A1, class A2, class A3, class A4>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3,
+ const A4& a4) const {
+ return (a->*b)(a1, a2, a3, a4);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+ const A5& a5) const {
+ return (a->*b)(a1, a2, a3, a4, a5);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+ const A5& a5, const A6& a6) const {
+ return (a->*b)(a1, a2, a3, a4, a5, a6);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+ const A5& a5, const A6& a6, const A7& a7) const {
+ return (a->*b)(a1, a2, a3, a4, a5, a6, a7);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7, class A8>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+ const A5& a5, const A6& a6, const A7& a7,
+ const A8& a8) const {
+ return (a->*b)(a1, a2, a3, a4, a5, a6, a7, a8);
+ }
+
+ template<class A1, class A2, class A3, class A4, class A5, class A6,
+ class A7, class A8, class A9>
+ RET operator()(const A1& a1, const A2& a2, const A3& a3, const A4& a4,
+ const A5& a5, const A6& a6, const A7& a7,
+ const A8& a8, const A9& a9) const {
+ return (a->*b)(a1, a2, a3, a4, a5, a6, a7, a8, a9);
+ }
+
+};
+
+// helper templates for return type deduction and action classes
+// different cases for data member, function member, neither
+
+// true-true case
+template <bool Is_data_member, bool Is_function_member>
+struct member_pointer_action_helper;
+ // cannot be both, no body provided
+
+ // data member case
+ // this means, that B is a data member and A is a pointer type,
+ // so either built-in ->* should be called, or there is an error
+template <>
+struct member_pointer_action_helper<true, false> {
+public:
+
+ template<class RET, class A, class B>
+ static RET apply(A& a, B& b) {
+ return a->*b;
+ }
+
+ template<class A, class B>
+ struct return_type {
+ private:
+ typedef typename detail::remove_reference_and_cv<B>::type plainB;
+
+ typedef typename detail::member_pointer<plainB>::type type0;
+ // we remove the reference now, as we may have to add cv:s
+ typedef typename ndnboost::remove_reference<type0>::type type1;
+
+ // A is a reference to pointer
+ // remove the top level cv qualifiers and reference
+ typedef typename
+ detail::remove_reference_and_cv<A>::type non_ref_A;
+
+ // A is a pointer type, so take the type pointed to
+ typedef typename ::ndnboost::remove_pointer<non_ref_A>::type non_pointer_A;
+
+ public:
+ // For non-reference types, we must add const and/or volatile if
+ // the pointer type has these qualifiers
+ // If the member is a reference, these do not have any effect
+ // (cv T == T if T is a reference type)
+ typedef typename detail::IF<
+ ::ndnboost::is_const<non_pointer_A>::value,
+ typename ::ndnboost::add_const<type1>::type,
+ type1
+ >::RET type2;
+ typedef typename detail::IF<
+ ::ndnboost::is_volatile<non_pointer_A>::value,
+ typename ::ndnboost::add_volatile<type2>::type,
+ type2
+ >::RET type3;
+ // add reference back
+ typedef typename ::ndnboost::add_reference<type3>::type type;
+ };
+};
+
+ // neither case
+template <>
+struct member_pointer_action_helper<false, false> {
+public:
+ template<class RET, class A, class B>
+ static RET apply(A& a, B& b) {
+// not a built in member pointer operator, just call ->*
+ return a->*b;
+ }
+ // an overloaded member pointer operators, user should have specified
+ // the return type
+ // At this point we know that there is no matching specialization for
+ // return_type_2, so try return_type_2_plain
+ template<class A, class B>
+ struct return_type {
+
+ typedef typename plain_return_type_2<
+ other_action<member_pointer_action>, A, B
+ >::type type;
+ };
+
+};
+
+
+// member pointer function case
+// This is a built in ->* call for a member function,
+// the only thing that you can do with that, is to give it some arguments
+// note, it is guaranteed that A is a pointer type, and thus it cannot
+// be a call to overloaded ->*
+template <>
+struct member_pointer_action_helper<false, true> {
+ public:
+
+ template<class RET, class A, class B>
+ static RET apply(A& a, B& b) {
+ typedef typename ::ndnboost::remove_cv<B>::type plainB;
+ typedef typename detail::member_pointer<plainB>::type ret_t;
+ typedef typename ::ndnboost::remove_cv<A>::type plainA;
+
+ // we always strip cv:s to
+ // make the two routes (calling and type deduction)
+ // to give the same results (and the const does not make any functional
+ // difference)
+ return detail::member_pointer_caller<ret_t, plainA, plainB>(a, b);
+ }
+
+ template<class A, class B>
+ struct return_type {
+ typedef typename detail::remove_reference_and_cv<B>::type plainB;
+ typedef typename detail::member_pointer<plainB>::type ret_t;
+ typedef typename detail::remove_reference_and_cv<A>::type plainA;
+
+ typedef detail::member_pointer_caller<ret_t, plainA, plainB> type;
+ };
+};
+
+} // detail
+
+template<> class other_action<member_pointer_action> {
+public:
+ template<class RET, class A, class B>
+ static RET apply(A& a, B& b) {
+ typedef typename
+ ::ndnboost::remove_cv<B>::type plainB;
+
+ return detail::member_pointer_action_helper<
+ ndnboost::is_pointer<A>::value &&
+ detail::member_pointer<plainB>::is_data_member,
+ ndnboost::is_pointer<A>::value &&
+ detail::member_pointer<plainB>::is_function_member
+ >::template apply<RET>(a, b);
+ }
+};
+
+ // return type deduction --
+
+ // If the right argument is a pointer to data member,
+ // and the left argument is of compatible pointer to class type
+ // return type is a reference to the data member type
+
+ // if right argument is a pointer to a member function, and the left
+ // argument is of a compatible type, the return type is a
+ // member_pointer_caller (see above)
+
+ // Otherwise, return type deduction fails. There is either an error,
+ // or the user is trying to call an overloaded ->*
+ // In such a case either ret<> must be used, or a return_type_2 user
+ // defined specialization must be provided
+
+
+template<class A, class B>
+struct return_type_2<other_action<member_pointer_action>, A, B> {
+private:
+ typedef typename
+ detail::remove_reference_and_cv<B>::type plainB;
+public:
+ typedef typename
+ detail::member_pointer_action_helper<
+ detail::member_pointer<plainB>::is_data_member,
+ detail::member_pointer<plainB>::is_function_member
+ >::template return_type<A, B>::type type;
+};
+
+ // this is the way the generic lambda_functor_base functions instantiate
+ // return type deduction. We turn it into return_type_2, so that the
+ // user can provide specializations on that level.
+template<class Args>
+struct return_type_N<other_action<member_pointer_action>, Args> {
+ typedef typename ndnboost::tuples::element<0, Args>::type A;
+ typedef typename ndnboost::tuples::element<1, Args>::type B;
+ typedef typename
+ return_type_2<other_action<member_pointer_action>,
+ typename ndnboost::remove_reference<A>::type,
+ typename ndnboost::remove_reference<B>::type
+ >::type type;
+};
+
+
+template<class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, other_action<member_pointer_action> >,
+ tuple<lambda_functor<Arg1>, typename const_copy_argument<Arg2>::type>
+ >
+>
+operator->*(const lambda_functor<Arg1>& a1, const Arg2& a2)
+{
+ return
+ lambda_functor_base<
+ action<2, other_action<member_pointer_action> >,
+ tuple<lambda_functor<Arg1>, typename const_copy_argument<Arg2>::type>
+ >
+ (tuple<lambda_functor<Arg1>,
+ typename const_copy_argument<Arg2>::type>(a1, a2));
+}
+
+template<class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, other_action<member_pointer_action> >,
+ tuple<lambda_functor<Arg1>, lambda_functor<Arg2> >
+ >
+>
+operator->*(const lambda_functor<Arg1>& a1, const lambda_functor<Arg2>& a2)
+{
+ return
+ lambda_functor_base<
+ action<2, other_action<member_pointer_action> >,
+ tuple<lambda_functor<Arg1>, lambda_functor<Arg2> >
+ >
+ (tuple<lambda_functor<Arg1>, lambda_functor<Arg2> >(a1, a2));
+}
+
+template<class Arg1, class Arg2>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<2, other_action<member_pointer_action> >,
+ tuple<typename const_copy_argument<Arg1>::type, lambda_functor<Arg2> >
+ >
+>
+operator->*(const Arg1& a1, const lambda_functor<Arg2>& a2)
+{
+ return
+ lambda_functor_base<
+ action<2, other_action<member_pointer_action> >,
+ tuple<typename const_copy_argument<Arg1>::type, lambda_functor<Arg2> >
+ >
+ (tuple<typename const_copy_argument<Arg1>::type,
+ lambda_functor<Arg2> >(a1, a2));
+}
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+
+#endif
+
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/operator_actions.hpp b/ndnboost/lambda/detail/operator_actions.hpp
new file mode 100644
index 0000000..4947792
--- /dev/null
+++ b/ndnboost/lambda/detail/operator_actions.hpp
@@ -0,0 +1,139 @@
+// -- operator_actions.hpp - Boost Lambda Library ----------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+
+// For more information, see http://lambda.cs.utu.fi
+
+#ifndef BOOST_LAMBDA_OPERATOR_ACTIONS_HPP
+#define BOOST_LAMBDA_OPERATOR_ACTIONS_HPP
+
+namespace ndnboost {
+namespace lambda {
+
+
+// -- artihmetic ----------------------
+
+class plus_action {};
+class minus_action {};
+class multiply_action {};
+class divide_action {};
+class remainder_action {};
+
+// -- bitwise -------------------
+
+class leftshift_action {};
+class rightshift_action {};
+class xor_action {};
+
+
+// -- bitwise/logical -------------------
+
+class and_action {};
+class or_action {};
+class not_action {};
+
+// -- relational -------------------------
+
+class less_action {};
+class greater_action {};
+class lessorequal_action {};
+class greaterorequal_action {};
+class equal_action {};
+class notequal_action {};
+
+// -- increment/decrement ------------------------------
+
+class increment_action {};
+class decrement_action {};
+
+// -- void return ------------------------------
+
+// -- other ------------------------------
+
+class addressof_action {};
+ // class comma_action {}; // defined in actions.hpp
+class contentsof_action {};
+// class member_pointer_action {}; (defined in member_ptr.hpp)
+
+
+// -- actioun group templates --------------------
+
+template <class Action> class arithmetic_action;
+template <class Action> class bitwise_action;
+template <class Action> class logical_action;
+template <class Action> class relational_action;
+template <class Action> class arithmetic_assignment_action;
+template <class Action> class bitwise_assignment_action;
+template <class Action> class unary_arithmetic_action;
+template <class Action> class pre_increment_decrement_action;
+template <class Action> class post_increment_decrement_action;
+
+// ---------------------------------------------------------
+
+ // actions, for which the existence of protect is checked in return type
+ // deduction.
+
+template <class Act> struct is_protectable<arithmetic_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act> struct is_protectable<bitwise_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act> struct is_protectable<logical_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act> struct is_protectable<relational_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act>
+struct is_protectable<arithmetic_assignment_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act> struct is_protectable<bitwise_assignment_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act> struct is_protectable<unary_arithmetic_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act>
+struct is_protectable<pre_increment_decrement_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <class Act> struct
+is_protectable<post_increment_decrement_action<Act> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+template <> struct is_protectable<other_action<addressof_action> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template <> struct is_protectable<other_action<contentsof_action> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+template<> struct is_protectable<other_action<subscript_action> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+template<> struct is_protectable<other_action<assignment_action> > {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+};
+
+// NOTE: comma action is also protectable, but the specialization is
+ // in actions.hpp
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
+
+
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/operator_lambda_func_base.hpp b/ndnboost/lambda/detail/operator_lambda_func_base.hpp
new file mode 100644
index 0000000..777726a
--- /dev/null
+++ b/ndnboost/lambda/detail/operator_lambda_func_base.hpp
@@ -0,0 +1,271 @@
+// Boost Lambda Library - operator_lambda_func_base.hpp -----------------
+//
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// ------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_OPERATOR_LAMBDA_FUNC_BASE_HPP
+#define BOOST_LAMBDA_OPERATOR_LAMBDA_FUNC_BASE_HPP
+
+namespace ndnboost {
+namespace lambda {
+
+
+// These operators cannot be implemented as apply functions of action
+// templates
+
+
+// Specialization for comma.
+template<class Args>
+class lambda_functor_base<other_action<comma_action>, Args> {
+public:
+ Args args;
+public:
+ explicit lambda_functor_base(const Args& a) : args(a) {}
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const {
+ return detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS),
+ detail::select(ndnboost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
+ }
+
+
+ template<class SigArgs> struct sig {
+ private:
+ typedef typename
+ detail::deduce_argument_types<Args, SigArgs>::type rets_t;
+ public:
+ typedef typename return_type_2_comma< // comma needs special handling
+ typename detail::element_or_null<0, rets_t>::type,
+ typename detail::element_or_null<1, rets_t>::type
+ >::type type;
+ };
+
+};
+
+namespace detail {
+
+// helper traits to make the expression shorter, takes binary action
+// bound argument tuple, open argument tuple and gives the return type
+
+template<class Action, class Bound, class Open> class binary_rt {
+ private:
+ typedef typename
+ detail::deduce_argument_types<Bound, Open>::type rets_t;
+ public:
+ typedef typename return_type_2_prot<
+ Action,
+ typename detail::element_or_null<0, rets_t>::type,
+ typename detail::element_or_null<1, rets_t>::type
+ >::type type;
+};
+
+
+ // same for unary actions
+template<class Action, class Bound, class Open> class unary_rt {
+ private:
+ typedef typename
+ detail::deduce_argument_types<Bound, Open>::type rets_t;
+ public:
+ typedef typename return_type_1_prot<
+ Action,
+ typename detail::element_or_null<0, rets_t>::type
+ >::type type;
+};
+
+
+} // end detail
+
+// Specialization for logical and (to preserve shortcircuiting)
+// this could be done with a macro as the others, code used to be different
+template<class Args>
+class lambda_functor_base<logical_action<and_action>, Args> {
+public:
+ Args args;
+public:
+ explicit lambda_functor_base(const Args& a) : args(a) {}
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const {
+ return detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS) &&
+ detail::select(ndnboost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
+ }
+ template<class SigArgs> struct sig {
+ typedef typename
+ detail::binary_rt<logical_action<and_action>, Args, SigArgs>::type type;
+ };
+};
+
+// Specialization for logical or (to preserve shortcircuiting)
+// this could be done with a macro as the others, code used to be different
+template<class Args>
+class lambda_functor_base<logical_action< or_action>, Args> {
+public:
+ Args args;
+public:
+ explicit lambda_functor_base(const Args& a) : args(a) {}
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const {
+ return detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS) ||
+ detail::select(ndnboost::tuples::get<1>(args), CALL_ACTUAL_ARGS);
+ }
+
+ template<class SigArgs> struct sig {
+ typedef typename
+ detail::binary_rt<logical_action<or_action>, Args, SigArgs>::type type;
+ };
+};
+
+// Specialization for subscript
+template<class Args>
+class lambda_functor_base<other_action<subscript_action>, Args> {
+public:
+ Args args;
+public:
+ explicit lambda_functor_base(const Args& a) : args(a) {}
+
+ template<class RET, CALL_TEMPLATE_ARGS>
+ RET call(CALL_FORMAL_ARGS) const {
+ return detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS)
+ [detail::select(ndnboost::tuples::get<1>(args), CALL_ACTUAL_ARGS)];
+ }
+
+ template<class SigArgs> struct sig {
+ typedef typename
+ detail::binary_rt<other_action<subscript_action>, Args, SigArgs>::type
+ type;
+ };
+};
+
+
+#define BOOST_LAMBDA_BINARY_ACTION(SYMBOL, ACTION_CLASS) \
+template<class Args> \
+class lambda_functor_base<ACTION_CLASS, Args> { \
+public: \
+ Args args; \
+public: \
+ explicit lambda_functor_base(const Args& a) : args(a) {} \
+ \
+ template<class RET, CALL_TEMPLATE_ARGS> \
+ RET call(CALL_FORMAL_ARGS) const { \
+ return detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS) \
+ SYMBOL \
+ detail::select(ndnboost::tuples::get<1>(args), CALL_ACTUAL_ARGS); \
+ } \
+ template<class SigArgs> struct sig { \
+ typedef typename \
+ detail::binary_rt<ACTION_CLASS, Args, SigArgs>::type type; \
+ }; \
+};
+
+#define BOOST_LAMBDA_PREFIX_UNARY_ACTION(SYMBOL, ACTION_CLASS) \
+template<class Args> \
+class lambda_functor_base<ACTION_CLASS, Args> { \
+public: \
+ Args args; \
+public: \
+ explicit lambda_functor_base(const Args& a) : args(a) {} \
+ \
+ template<class RET, CALL_TEMPLATE_ARGS> \
+ RET call(CALL_FORMAL_ARGS) const { \
+ return SYMBOL \
+ detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS); \
+ } \
+ template<class SigArgs> struct sig { \
+ typedef typename \
+ detail::unary_rt<ACTION_CLASS, Args, SigArgs>::type type; \
+ }; \
+};
+
+#define BOOST_LAMBDA_POSTFIX_UNARY_ACTION(SYMBOL, ACTION_CLASS) \
+template<class Args> \
+class lambda_functor_base<ACTION_CLASS, Args> { \
+public: \
+ Args args; \
+public: \
+ explicit lambda_functor_base(const Args& a) : args(a) {} \
+ \
+ template<class RET, CALL_TEMPLATE_ARGS> \
+ RET call(CALL_FORMAL_ARGS) const { \
+ return \
+ detail::select(ndnboost::tuples::get<0>(args), CALL_ACTUAL_ARGS) SYMBOL; \
+ } \
+ template<class SigArgs> struct sig { \
+ typedef typename \
+ detail::unary_rt<ACTION_CLASS, Args, SigArgs>::type type; \
+ }; \
+};
+
+BOOST_LAMBDA_BINARY_ACTION(+,arithmetic_action<plus_action>)
+BOOST_LAMBDA_BINARY_ACTION(-,arithmetic_action<minus_action>)
+BOOST_LAMBDA_BINARY_ACTION(*,arithmetic_action<multiply_action>)
+BOOST_LAMBDA_BINARY_ACTION(/,arithmetic_action<divide_action>)
+BOOST_LAMBDA_BINARY_ACTION(%,arithmetic_action<remainder_action>)
+
+BOOST_LAMBDA_BINARY_ACTION(<<,bitwise_action<leftshift_action>)
+BOOST_LAMBDA_BINARY_ACTION(>>,bitwise_action<rightshift_action>)
+BOOST_LAMBDA_BINARY_ACTION(&,bitwise_action<and_action>)
+BOOST_LAMBDA_BINARY_ACTION(|,bitwise_action<or_action>)
+BOOST_LAMBDA_BINARY_ACTION(^,bitwise_action<xor_action>)
+
+BOOST_LAMBDA_BINARY_ACTION(<,relational_action<less_action>)
+BOOST_LAMBDA_BINARY_ACTION(>,relational_action<greater_action>)
+BOOST_LAMBDA_BINARY_ACTION(<=,relational_action<lessorequal_action>)
+BOOST_LAMBDA_BINARY_ACTION(>=,relational_action<greaterorequal_action>)
+BOOST_LAMBDA_BINARY_ACTION(==,relational_action<equal_action>)
+BOOST_LAMBDA_BINARY_ACTION(!=,relational_action<notequal_action>)
+
+BOOST_LAMBDA_BINARY_ACTION(+=,arithmetic_assignment_action<plus_action>)
+BOOST_LAMBDA_BINARY_ACTION(-=,arithmetic_assignment_action<minus_action>)
+BOOST_LAMBDA_BINARY_ACTION(*=,arithmetic_assignment_action<multiply_action>)
+BOOST_LAMBDA_BINARY_ACTION(/=,arithmetic_assignment_action<divide_action>)
+BOOST_LAMBDA_BINARY_ACTION(%=,arithmetic_assignment_action<remainder_action>)
+
+BOOST_LAMBDA_BINARY_ACTION(<<=,bitwise_assignment_action<leftshift_action>)
+BOOST_LAMBDA_BINARY_ACTION(>>=,bitwise_assignment_action<rightshift_action>)
+BOOST_LAMBDA_BINARY_ACTION(&=,bitwise_assignment_action<and_action>)
+BOOST_LAMBDA_BINARY_ACTION(|=,bitwise_assignment_action<or_action>)
+BOOST_LAMBDA_BINARY_ACTION(^=,bitwise_assignment_action<xor_action>)
+
+BOOST_LAMBDA_BINARY_ACTION(=,other_action< assignment_action>)
+
+
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(+, unary_arithmetic_action<plus_action>)
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(-, unary_arithmetic_action<minus_action>)
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(~, bitwise_action<not_action>)
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(!, logical_action<not_action>)
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(++, pre_increment_decrement_action<increment_action>)
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(--, pre_increment_decrement_action<decrement_action>)
+
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(&,other_action<addressof_action>)
+BOOST_LAMBDA_PREFIX_UNARY_ACTION(*,other_action<contentsof_action>)
+
+BOOST_LAMBDA_POSTFIX_UNARY_ACTION(++, post_increment_decrement_action<increment_action>)
+BOOST_LAMBDA_POSTFIX_UNARY_ACTION(--, post_increment_decrement_action<decrement_action>)
+
+
+#undef BOOST_LAMBDA_POSTFIX_UNARY_ACTION
+#undef BOOST_LAMBDA_PREFIX_UNARY_ACTION
+#undef BOOST_LAMBDA_BINARY_ACTION
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
+
+
+
+
+
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/operator_return_type_traits.hpp b/ndnboost/lambda/detail/operator_return_type_traits.hpp
new file mode 100644
index 0000000..0ee927b
--- /dev/null
+++ b/ndnboost/lambda/detail/operator_return_type_traits.hpp
@@ -0,0 +1,917 @@
+// operator_return_type_traits.hpp -- Boost Lambda Library ------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+#ifndef BOOST_LAMBDA_OPERATOR_RETURN_TYPE_TRAITS_HPP
+#define BOOST_LAMBDA_OPERATOR_RETURN_TYPE_TRAITS_HPP
+
+#include "ndnboost/lambda/detail/is_instance_of.hpp"
+#include "ndnboost/type_traits/same_traits.hpp"
+
+#include "ndnboost/indirect_reference.hpp"
+#include "ndnboost/detail/container_fwd.hpp"
+
+#include <cstddef> // needed for the ptrdiff_t
+#include <iosfwd> // for istream and ostream
+
+#include <iterator> // needed for operator&
+
+namespace ndnboost {
+namespace lambda {
+namespace detail {
+
+// -- general helper templates for type deduction ------------------
+
+// Much of the type deduction code for standard arithmetic types from Gary Powell
+
+template <class A> struct promote_code { static const int value = -1; };
+// this means that a code is not defined for A
+
+// -- the next 5 types are needed in if_then_else_return
+// the promotion order is not important, but they must have distinct values.
+template <> struct promote_code<bool> { static const int value = 10; };
+template <> struct promote_code<char> { static const int value = 20; };
+template <> struct promote_code<unsigned char> { static const int value = 30; };
+template <> struct promote_code<signed char> { static const int value = 40; };
+template <> struct promote_code<short int> { static const int value = 50; };
+// ----------
+
+template <> struct promote_code<int> { static const int value = 100; };
+template <> struct promote_code<unsigned int> { static const int value = 200; };
+template <> struct promote_code<long> { static const int value = 300; };
+template <> struct promote_code<unsigned long> { static const int value = 400; };
+
+template <> struct promote_code<float> { static const int value = 500; };
+template <> struct promote_code<double> { static const int value = 600; };
+template <> struct promote_code<long double> { static const int value = 700; };
+
+// TODO: wchar_t
+
+// forward delcaration of complex.
+
+} // namespace detail
+} // namespace lambda
+} // namespace ndnboost
+
+namespace ndnboost {
+namespace lambda {
+namespace detail {
+
+template <> struct promote_code< std::complex<float> > { static const int value = 800; };
+template <> struct promote_code< std::complex<double> > { static const int value = 900; };
+template <> struct promote_code< std::complex<long double> > { static const int value = 1000; };
+
+// -- int promotion -------------------------------------------
+template <class T> struct promote_to_int { typedef T type; };
+
+template <> struct promote_to_int<bool> { typedef int type; };
+template <> struct promote_to_int<char> { typedef int type; };
+template <> struct promote_to_int<unsigned char> { typedef int type; };
+template <> struct promote_to_int<signed char> { typedef int type; };
+template <> struct promote_to_int<short int> { typedef int type; };
+
+// The unsigned short int promotion rule is this:
+// unsigned short int to signed int if a signed int can hold all values
+// of unsigned short int, otherwise go to unsigned int.
+template <> struct promote_to_int<unsigned short int>
+{
+ typedef
+ detail::IF<sizeof(int) <= sizeof(unsigned short int),
+// I had the logic reversed but ">" messes up the parsing.
+ unsigned int,
+ int>::RET type;
+};
+
+
+// TODO: think, should there be default behaviour for non-standard types?
+
+} // namespace detail
+
+// ------------------------------------------
+// Unary actions ----------------------------
+// ------------------------------------------
+
+template<class Act, class A>
+struct plain_return_type_1 {
+ typedef detail::unspecified type;
+};
+
+
+
+template<class Act, class A>
+struct plain_return_type_1<unary_arithmetic_action<Act>, A> {
+ typedef A type;
+};
+
+template<class Act, class A>
+struct return_type_1<unary_arithmetic_action<Act>, A> {
+ typedef
+ typename plain_return_type_1<
+ unary_arithmetic_action<Act>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type;
+};
+
+
+template<class A>
+struct plain_return_type_1<bitwise_action<not_action>, A> {
+ typedef A type;
+};
+
+// bitwise not, operator~()
+template<class A> struct return_type_1<bitwise_action<not_action>, A> {
+ typedef
+ typename plain_return_type_1<
+ bitwise_action<not_action>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type;
+};
+
+
+// prefix increment and decrement operators return
+// their argument by default as a non-const reference
+template<class Act, class A>
+struct plain_return_type_1<pre_increment_decrement_action<Act>, A> {
+ typedef A& type;
+};
+
+template<class Act, class A>
+struct return_type_1<pre_increment_decrement_action<Act>, A> {
+ typedef
+ typename plain_return_type_1<
+ pre_increment_decrement_action<Act>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type;
+};
+
+// post decrement just returns the same plain type.
+template<class Act, class A>
+struct plain_return_type_1<post_increment_decrement_action<Act>, A> {
+ typedef A type;
+};
+
+template<class Act, class A>
+struct return_type_1<post_increment_decrement_action<Act>, A>
+{
+ typedef
+ typename plain_return_type_1<
+ post_increment_decrement_action<Act>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type;
+};
+
+// logical not, operator!()
+template<class A>
+struct plain_return_type_1<logical_action<not_action>, A> {
+ typedef bool type;
+};
+
+template<class A>
+struct return_type_1<logical_action<not_action>, A> {
+ typedef
+ typename plain_return_type_1<
+ logical_action<not_action>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type;
+};
+
+// address of action ---------------------------------------
+
+
+template<class A>
+struct return_type_1<other_action<addressof_action>, A> {
+ typedef
+ typename plain_return_type_1<
+ other_action<addressof_action>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type1;
+
+ // If no user defined specialization for A, then return the
+ // cv qualified pointer to A
+ typedef typename detail::IF<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ typename ndnboost::remove_reference<A>::type*,
+ type1
+ >::RET type;
+};
+
+// contentsof action ------------------------------------
+
+// TODO: this deduction may lead to fail directly,
+// (if A has no specialization for iterator_traits and has no
+// typedef A::reference.
+// There is no easy way around this, cause there doesn't seem to be a way
+// to test whether a class is an iterator or not.
+
+// The default works with std::iterators.
+
+namespace detail {
+
+ // A is a nonreference type
+template <class A> struct contentsof_type {
+ typedef typename ndnboost::indirect_reference<A>::type type;
+};
+
+ // this is since the nullary () in lambda_functor is always instantiated
+template <> struct contentsof_type<null_type> {
+ typedef detail::unspecified type;
+};
+
+
+template <class A> struct contentsof_type<const A> {
+ typedef typename contentsof_type<A>::type type;
+};
+
+template <class A> struct contentsof_type<volatile A> {
+ typedef typename contentsof_type<A>::type type;
+};
+
+template <class A> struct contentsof_type<const volatile A> {
+ typedef typename contentsof_type<A>::type type;
+};
+
+ // standard iterator traits should take care of the pointer types
+ // but just to be on the safe side, we have the specializations here:
+ // these work even if A is cv-qualified.
+template <class A> struct contentsof_type<A*> {
+ typedef A& type;
+};
+template <class A> struct contentsof_type<A* const> {
+ typedef A& type;
+};
+template <class A> struct contentsof_type<A* volatile> {
+ typedef A& type;
+};
+template <class A> struct contentsof_type<A* const volatile> {
+ typedef A& type;
+};
+
+template<class A, int N> struct contentsof_type<A[N]> {
+ typedef A& type;
+};
+template<class A, int N> struct contentsof_type<const A[N]> {
+ typedef const A& type;
+};
+template<class A, int N> struct contentsof_type<volatile A[N]> {
+ typedef volatile A& type;
+};
+template<class A, int N> struct contentsof_type<const volatile A[N]> {
+ typedef const volatile A& type;
+};
+
+
+
+
+
+} // end detail
+
+template<class A>
+struct return_type_1<other_action<contentsof_action>, A> {
+
+ typedef
+ typename plain_return_type_1<
+ other_action<contentsof_action>,
+ typename detail::remove_reference_and_cv<A>::type
+ >::type type1;
+
+ // If no user defined specialization for A, then return the
+ // cv qualified pointer to A
+ typedef typename
+ detail::IF_type<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ detail::contentsof_type<
+ typename ndnboost::remove_reference<A>::type
+ >,
+ detail::identity_mapping<type1>
+ >::type type;
+};
+
+
+// ------------------------------------------------------------------
+// binary actions ---------------------------------------------------
+// ------------------------------------------------------------------
+
+// here the default case is: no user defined versions:
+template <class Act, class A, class B>
+struct plain_return_type_2 {
+ typedef detail::unspecified type;
+};
+
+namespace detail {
+
+// error classes
+class illegal_pointer_arithmetic{};
+
+// pointer arithmetic type deductions ----------------------
+// value = false means that this is not a pointer arithmetic case
+// value = true means, that this can be a pointer arithmetic case, but not necessarily is
+// This means, that for user defined operators for pointer types, say for some operator+(X, *Y),
+// the deductions must be coded at an earliel level (return_type_2).
+
+template<class Act, class A, class B>
+struct pointer_arithmetic_traits { static const bool value = false; };
+
+template<class A, class B>
+struct pointer_arithmetic_traits<plus_action, A, B> {
+
+ typedef typename
+ array_to_pointer<typename ndnboost::remove_reference<A>::type>::type AP;
+ typedef typename
+ array_to_pointer<typename ndnboost::remove_reference<B>::type>::type BP;
+
+ static const bool is_pointer_A = ndnboost::is_pointer<AP>::value;
+ static const bool is_pointer_B = ndnboost::is_pointer<BP>::value;
+
+ static const bool value = is_pointer_A || is_pointer_B;
+
+ // can't add two pointers.
+ // note, that we do not check wether the other type is valid for
+ // addition with a pointer.
+ // the compiler will catch it in the apply function
+
+ typedef typename
+ detail::IF<
+ is_pointer_A && is_pointer_B,
+ detail::return_type_deduction_failure<
+ detail::illegal_pointer_arithmetic
+ >,
+ typename detail::IF<is_pointer_A, AP, BP>::RET
+ >::RET type;
+
+};
+
+template<class A, class B>
+struct pointer_arithmetic_traits<minus_action, A, B> {
+ typedef typename
+ array_to_pointer<typename ndnboost::remove_reference<A>::type>::type AP;
+ typedef typename
+ array_to_pointer<typename ndnboost::remove_reference<B>::type>::type BP;
+
+ static const bool is_pointer_A = ndnboost::is_pointer<AP>::value;
+ static const bool is_pointer_B = ndnboost::is_pointer<BP>::value;
+
+ static const bool value = is_pointer_A || is_pointer_B;
+
+ static const bool same_pointer_type =
+ is_pointer_A && is_pointer_B &&
+ ndnboost::is_same<
+ typename ndnboost::remove_const<
+ typename ndnboost::remove_pointer<
+ typename ndnboost::remove_const<AP>::type
+ >::type
+ >::type,
+ typename ndnboost::remove_const<
+ typename ndnboost::remove_pointer<
+ typename ndnboost::remove_const<BP>::type
+ >::type
+ >::type
+ >::value;
+
+ // ptr - ptr has type ptrdiff_t
+ // note, that we do not check if, in ptr - B, B is
+ // valid for subtraction with a pointer.
+ // the compiler will catch it in the apply function
+
+ typedef typename
+ detail::IF<
+ same_pointer_type, const std::ptrdiff_t,
+ typename detail::IF<
+ is_pointer_A,
+ AP,
+ detail::return_type_deduction_failure<detail::illegal_pointer_arithmetic>
+ >::RET
+ >::RET type;
+};
+
+} // namespace detail
+
+// -- arithmetic actions ---------------------------------------------
+
+namespace detail {
+
+template<bool is_pointer_arithmetic, class Act, class A, class B>
+struct return_type_2_arithmetic_phase_1;
+
+template<class A, class B> struct return_type_2_arithmetic_phase_2;
+template<class A, class B> struct return_type_2_arithmetic_phase_3;
+
+} // namespace detail
+
+
+// drop any qualifiers from the argument types within arithmetic_action
+template<class A, class B, class Act>
+struct return_type_2<arithmetic_action<Act>, A, B>
+{
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<arithmetic_action<Act>, plain_A, plain_B>::type type1;
+
+ // if user defined return type, do not enter the whole arithmetic deductions
+ typedef typename
+ detail::IF_type<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ detail::return_type_2_arithmetic_phase_1<
+ detail::pointer_arithmetic_traits<Act, A, B>::value, Act, A, B
+ >,
+ plain_return_type_2<arithmetic_action<Act>, plain_A, plain_B>
+ >::type type;
+};
+
+namespace detail {
+
+// perform integral promotion, no pointer arithmetic
+template<bool is_pointer_arithmetic, class Act, class A, class B>
+struct return_type_2_arithmetic_phase_1
+{
+ typedef typename
+ return_type_2_arithmetic_phase_2<
+ typename remove_reference_and_cv<A>::type,
+ typename remove_reference_and_cv<B>::type
+ >::type type;
+};
+
+// pointer_arithmetic
+template<class Act, class A, class B>
+struct return_type_2_arithmetic_phase_1<true, Act, A, B>
+{
+ typedef typename
+ pointer_arithmetic_traits<Act, A, B>::type type;
+};
+
+template<class A, class B>
+struct return_type_2_arithmetic_phase_2 {
+ typedef typename
+ return_type_2_arithmetic_phase_3<
+ typename promote_to_int<A>::type,
+ typename promote_to_int<B>::type
+ >::type type;
+};
+
+// specialization for unsigned int.
+// We only have to do these two specialization because the value promotion will
+// take care of the other cases.
+// The unsigned int promotion rule is this:
+// unsigned int to long if a long can hold all values of unsigned int,
+// otherwise go to unsigned long.
+
+// struct so I don't have to type this twice.
+struct promotion_of_unsigned_int
+{
+ typedef
+ detail::IF<sizeof(long) <= sizeof(unsigned int),
+ unsigned long,
+ long>::RET type;
+};
+
+template<>
+struct return_type_2_arithmetic_phase_2<unsigned int, long>
+{
+ typedef promotion_of_unsigned_int::type type;
+};
+template<>
+struct return_type_2_arithmetic_phase_2<long, unsigned int>
+{
+ typedef promotion_of_unsigned_int::type type;
+};
+
+
+template<class A, class B> struct return_type_2_arithmetic_phase_3 {
+ enum { promote_code_A_value = promote_code<A>::value,
+ promote_code_B_value = promote_code<B>::value }; // enums for KCC
+ typedef typename
+ detail::IF<
+ promote_code_A_value == -1 || promote_code_B_value == -1,
+ detail::return_type_deduction_failure<return_type_2_arithmetic_phase_3>,
+ typename detail::IF<
+ ((int)promote_code_A_value > (int)promote_code_B_value),
+ A,
+ B
+ >::RET
+ >::RET type;
+};
+
+} // namespace detail
+
+// -- bitwise actions -------------------------------------------
+// note: for integral types deuduction is similar to arithmetic actions.
+
+// drop any qualifiers from the argument types within arithmetic action
+template<class A, class B, class Act>
+struct return_type_2<bitwise_action<Act>, A, B>
+{
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<bitwise_action<Act>, plain_A, plain_B>::type type1;
+
+ // if user defined return type, do not enter type deductions
+ typedef typename
+ detail::IF_type<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ return_type_2<arithmetic_action<plus_action>, A, B>,
+ plain_return_type_2<bitwise_action<Act>, plain_A, plain_B>
+ >::type type;
+
+ // plus_action is just a random pick, has to be a concrete instance
+
+ // TODO: This check is only valid for built-in types, overloaded types might
+ // accept floating point operators
+
+ // bitwise operators not defined for floating point types
+ // these test are not strictly needed here, since the error will be caught in
+ // the apply function
+ BOOST_STATIC_ASSERT(!(ndnboost::is_float<plain_A>::value && ndnboost::is_float<plain_B>::value));
+
+};
+
+namespace detail {
+
+#ifdef BOOST_NO_TEMPLATED_STREAMS
+
+template<class A, class B>
+struct leftshift_type {
+
+ typedef typename detail::IF<
+ ndnboost::is_convertible<
+ typename ndnboost::remove_reference<A>::type*,
+ std::ostream*
+ >::value,
+ std::ostream&,
+ typename detail::remove_reference_and_cv<A>::type
+ >::RET type;
+};
+
+template<class A, class B>
+struct rightshift_type {
+
+ typedef typename detail::IF<
+
+ ndnboost::is_convertible<
+ typename ndnboost::remove_reference<A>::type*,
+ std::istream*
+ >::value,
+ std::istream&,
+ typename detail::remove_reference_and_cv<A>::type
+ >::RET type;
+};
+
+#else
+
+template <class T> struct get_ostream_type {
+ typedef std::basic_ostream<typename T::char_type,
+ typename T::traits_type>& type;
+};
+
+template <class T> struct get_istream_type {
+ typedef std::basic_istream<typename T::char_type,
+ typename T::traits_type>& type;
+};
+
+template<class A, class B>
+struct leftshift_type {
+private:
+ typedef typename ndnboost::remove_reference<A>::type plainA;
+public:
+ typedef typename detail::IF_type<
+ is_instance_of_2<plainA, std::basic_ostream>::value,
+ get_ostream_type<plainA>, //reference to the stream
+ detail::remove_reference_and_cv<A>
+ >::type type;
+};
+
+template<class A, class B>
+struct rightshift_type {
+private:
+ typedef typename ndnboost::remove_reference<A>::type plainA;
+public:
+ typedef typename detail::IF_type<
+ is_instance_of_2<plainA, std::basic_istream>::value,
+ get_istream_type<plainA>, //reference to the stream
+ detail::remove_reference_and_cv<A>
+ >::type type;
+};
+
+
+#endif
+
+} // end detail
+
+// ostream
+template<class A, class B>
+struct return_type_2<bitwise_action<leftshift_action>, A, B>
+{
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<bitwise_action<leftshift_action>, plain_A, plain_B>::type type1;
+
+ // if user defined return type, do not enter type deductions
+ typedef typename
+ detail::IF_type<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ detail::leftshift_type<A, B>,
+ plain_return_type_2<bitwise_action<leftshift_action>, plain_A, plain_B>
+ >::type type;
+};
+
+// istream
+template<class A, class B>
+struct return_type_2<bitwise_action<rightshift_action>, A, B>
+{
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<bitwise_action<rightshift_action>, plain_A, plain_B>::type type1;
+
+ // if user defined return type, do not enter type deductions
+ typedef typename
+ detail::IF_type<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ detail::rightshift_type<A, B>,
+ plain_return_type_2<bitwise_action<rightshift_action>, plain_A, plain_B>
+ >::type type;
+};
+
+// -- logical actions ----------------------------------------
+// always bool
+// NOTE: this may not be true for some weird user-defined types,
+template<class A, class B, class Act>
+struct plain_return_type_2<logical_action<Act>, A, B> {
+ typedef bool type;
+};
+
+template<class A, class B, class Act>
+struct return_type_2<logical_action<Act>, A, B> {
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<logical_action<Act>, plain_A, plain_B>::type type;
+
+};
+
+
+// -- relational actions ----------------------------------------
+// always bool
+// NOTE: this may not be true for some weird user-defined types,
+template<class A, class B, class Act>
+struct plain_return_type_2<relational_action<Act>, A, B> {
+ typedef bool type;
+};
+
+template<class A, class B, class Act>
+struct return_type_2<relational_action<Act>, A, B> {
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<relational_action<Act>, plain_A, plain_B>::type type;
+};
+
+// Assingment actions -----------------------------------------------
+// return type is the type of the first argument as reference
+
+// note that cv-qualifiers are preserved.
+// Yes, assignment operator can be const!
+
+// NOTE: this may not be true for some weird user-defined types,
+
+template<class A, class B, class Act>
+struct return_type_2<arithmetic_assignment_action<Act>, A, B> {
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<
+ arithmetic_assignment_action<Act>, plain_A, plain_B
+ >::type type1;
+
+ typedef typename
+ detail::IF<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ typename ndnboost::add_reference<A>::type,
+ type1
+ >::RET type;
+};
+
+template<class A, class B, class Act>
+struct return_type_2<bitwise_assignment_action<Act>, A, B> {
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<
+ bitwise_assignment_action<Act>, plain_A, plain_B
+ >::type type1;
+
+ typedef typename
+ detail::IF<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ typename ndnboost::add_reference<A>::type,
+ type1
+ >::RET type;
+};
+
+template<class A, class B>
+struct return_type_2<other_action<assignment_action>, A, B> {
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<
+ other_action<assignment_action>, plain_A, plain_B
+ >::type type1;
+
+ typedef typename
+ detail::IF<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ typename ndnboost::add_reference<A>::type,
+ type1
+ >::RET type;
+};
+
+// -- other actions ----------------------------------------
+
+// comma action ----------------------------------
+// Note: this may not be true for some weird user-defined types,
+
+// NOTE! This only tries the plain_return_type_2 layer and gives
+// detail::unspecified as default. If no such specialization is found, the
+// type rule in the spcecialization of the return_type_2_prot is used
+// to give the type of the right argument (which can be a reference too)
+// (The built in operator, can return a l- or rvalue).
+template<class A, class B>
+struct return_type_2<other_action<comma_action>, A, B> {
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename
+ plain_return_type_2<
+ other_action<comma_action>, plain_A, plain_B
+ >::type type;
+ };
+
+// subscript action -----------------------------------------------
+
+
+namespace detail {
+ // A and B are nonreference types
+template <class A, class B> struct subscript_type {
+ typedef detail::unspecified type;
+};
+
+template <class A, class B> struct subscript_type<A*, B> {
+ typedef A& type;
+};
+template <class A, class B> struct subscript_type<A* const, B> {
+ typedef A& type;
+};
+template <class A, class B> struct subscript_type<A* volatile, B> {
+ typedef A& type;
+};
+template <class A, class B> struct subscript_type<A* const volatile, B> {
+ typedef A& type;
+};
+
+
+template<class A, class B, int N> struct subscript_type<A[N], B> {
+ typedef A& type;
+};
+
+ // these 3 specializations are needed to make gcc <3 happy
+template<class A, class B, int N> struct subscript_type<const A[N], B> {
+ typedef const A& type;
+};
+template<class A, class B, int N> struct subscript_type<volatile A[N], B> {
+ typedef volatile A& type;
+};
+template<class A, class B, int N> struct subscript_type<const volatile A[N], B> {
+ typedef const volatile A& type;
+};
+
+} // end detail
+
+template<class A, class B>
+struct return_type_2<other_action<subscript_action>, A, B> {
+
+ typedef typename detail::remove_reference_and_cv<A>::type plain_A;
+ typedef typename detail::remove_reference_and_cv<B>::type plain_B;
+
+ typedef typename ndnboost::remove_reference<A>::type nonref_A;
+ typedef typename ndnboost::remove_reference<B>::type nonref_B;
+
+ typedef typename
+ plain_return_type_2<
+ other_action<subscript_action>, plain_A, plain_B
+ >::type type1;
+
+ typedef typename
+ detail::IF_type<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ detail::subscript_type<nonref_A, nonref_B>,
+ plain_return_type_2<other_action<subscript_action>, plain_A, plain_B>
+ >::type type;
+
+};
+
+template<class Key, class T, class Cmp, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, std::map<Key, T, Cmp, Allocator>, B> {
+ typedef T& type;
+ // T == std::map<Key, T, Cmp, Allocator>::mapped_type;
+};
+
+template<class Key, class T, class Cmp, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, std::multimap<Key, T, Cmp, Allocator>, B> {
+ typedef T& type;
+ // T == std::map<Key, T, Cmp, Allocator>::mapped_type;
+};
+
+ // deque
+template<class T, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, std::deque<T, Allocator>, B> {
+ typedef typename std::deque<T, Allocator>::reference type;
+};
+template<class T, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, const std::deque<T, Allocator>, B> {
+ typedef typename std::deque<T, Allocator>::const_reference type;
+};
+
+ // vector
+template<class T, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, std::vector<T, Allocator>, B> {
+ typedef typename std::vector<T, Allocator>::reference type;
+};
+template<class T, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, const std::vector<T, Allocator>, B> {
+ typedef typename std::vector<T, Allocator>::const_reference type;
+};
+
+ // basic_string
+template<class Char, class Traits, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, std::basic_string<Char, Traits, Allocator>, B> {
+ typedef typename std::basic_string<Char, Traits, Allocator>::reference type;
+};
+template<class Char, class Traits, class Allocator, class B>
+struct plain_return_type_2<other_action<subscript_action>, const std::basic_string<Char, Traits, Allocator>, B> {
+ typedef typename std::basic_string<Char, Traits, Allocator>::const_reference type;
+};
+
+template<class Char, class Traits, class Allocator>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ std::basic_string<Char, Traits, Allocator>,
+ std::basic_string<Char, Traits, Allocator> > {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ const Char*,
+ std::basic_string<Char, Traits, Allocator> > {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ std::basic_string<Char, Traits, Allocator>,
+ const Char*> {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator, std::size_t N>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ Char[N],
+ std::basic_string<Char, Traits, Allocator> > {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+template<class Char, class Traits, class Allocator, std::size_t N>
+struct plain_return_type_2<arithmetic_action<plus_action>,
+ std::basic_string<Char, Traits, Allocator>,
+ Char[N]> {
+ typedef std::basic_string<Char, Traits, Allocator> type;
+};
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
+
+
diff --git a/ndnboost/lambda/detail/operators.hpp b/ndnboost/lambda/detail/operators.hpp
new file mode 100644
index 0000000..7c3bc8b
--- /dev/null
+++ b/ndnboost/lambda/detail/operators.hpp
@@ -0,0 +1,370 @@
+// Boost Lambda Library - operators.hpp --------------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+// ---------------------------------------------------------------
+
+#ifndef BOOST_LAMBDA_OPERATORS_HPP
+#define BOOST_LAMBDA_OPERATORS_HPP
+
+#include "ndnboost/lambda/detail/is_instance_of.hpp"
+
+namespace ndnboost {
+namespace lambda {
+
+#if defined BOOST_LAMBDA_BE1
+#error "Multiple defines of BOOST_LAMBDA_BE1"
+#endif
+
+ // For all BOOSTA_LAMBDA_BE* macros:
+
+ // CONSTA must be either 'A' or 'const A'
+ // CONSTB must be either 'B' or 'const B'
+
+ // It is stupid to have the names A and B as macro arguments, but it avoids
+ // the need to pass in emtpy macro arguments, which gives warnings on some
+ // compilers
+
+#define BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \
+template<class Arg, class B> \
+inline const \
+lambda_functor< \
+ lambda_functor_base< \
+ ACTION, \
+ tuple<lambda_functor<Arg>, typename const_copy_argument <CONSTB>::type> \
+ > \
+> \
+OPER_NAME (const lambda_functor<Arg>& a, CONSTB& b) { \
+ return \
+ lambda_functor_base< \
+ ACTION, \
+ tuple<lambda_functor<Arg>, typename const_copy_argument <CONSTB>::type>\
+ > \
+ (tuple<lambda_functor<Arg>, typename const_copy_argument <CONSTB>::type>(a, b)); \
+}
+
+
+#if defined BOOST_LAMBDA_BE2
+#error "Multiple defines of BOOST_LAMBDA_BE2"
+#endif
+
+#define BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \
+template<class A, class Arg> \
+inline const \
+lambda_functor< \
+ lambda_functor_base< \
+ ACTION, \
+ tuple<typename CONVERSION <CONSTA>::type, lambda_functor<Arg> > \
+ > \
+> \
+OPER_NAME (CONSTA& a, const lambda_functor<Arg>& b) { \
+ return \
+ lambda_functor_base< \
+ ACTION, \
+ tuple<typename CONVERSION <CONSTA>::type, lambda_functor<Arg> > \
+ > \
+ (tuple<typename CONVERSION <CONSTA>::type, lambda_functor<Arg> >(a, b)); \
+}
+
+
+#if defined BOOST_LAMBDA_BE3
+#error "Multiple defines of BOOST_LAMBDA_BE3"
+#endif
+
+#define BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONVERSION) \
+template<class ArgA, class ArgB> \
+inline const \
+lambda_functor< \
+ lambda_functor_base< \
+ ACTION, \
+ tuple<lambda_functor<ArgA>, lambda_functor<ArgB> > \
+ > \
+> \
+OPER_NAME (const lambda_functor<ArgA>& a, const lambda_functor<ArgB>& b) { \
+ return \
+ lambda_functor_base< \
+ ACTION, \
+ tuple<lambda_functor<ArgA>, lambda_functor<ArgB> > \
+ > \
+ (tuple<lambda_functor<ArgA>, lambda_functor<ArgB> >(a, b)); \
+}
+
+#if defined BOOST_LAMBDA_BE
+#error "Multiple defines of BOOST_LAMBDA_BE"
+#endif
+
+#define BOOST_LAMBDA_BE(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \
+BOOST_LAMBDA_BE1(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \
+BOOST_LAMBDA_BE2(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION) \
+BOOST_LAMBDA_BE3(OPER_NAME, ACTION, CONSTA, CONSTB, CONST_CONVERSION)
+
+#define BOOST_LAMBDA_EMPTY()
+
+BOOST_LAMBDA_BE(operator+, arithmetic_action<plus_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator-, arithmetic_action<minus_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator*, arithmetic_action<multiply_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator/, arithmetic_action<divide_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator%, arithmetic_action<remainder_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator<<, bitwise_action<leftshift_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator>>, bitwise_action<rightshift_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator&, bitwise_action<and_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator|, bitwise_action<or_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator^, bitwise_action<xor_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator&&, logical_action<and_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator||, logical_action<or_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator<, relational_action<less_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator>, relational_action<greater_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator<=, relational_action<lessorequal_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator>=, relational_action<greaterorequal_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator==, relational_action<equal_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE(operator!=, relational_action<notequal_action>, const A, const B, const_copy_argument)
+
+BOOST_LAMBDA_BE(operator+=, arithmetic_assignment_action<plus_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator-=, arithmetic_assignment_action<minus_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator*=, arithmetic_assignment_action<multiply_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator/=, arithmetic_assignment_action<divide_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator%=, arithmetic_assignment_action<remainder_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator<<=, bitwise_assignment_action<leftshift_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator>>=, bitwise_assignment_action<rightshift_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator&=, bitwise_assignment_action<and_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator|=, bitwise_assignment_action<or_action>, A, const B, reference_argument)
+BOOST_LAMBDA_BE(operator^=, bitwise_assignment_action<xor_action>, A, const B, reference_argument)
+
+
+// A special trick for comma operator for correct preprocessing
+#if defined BOOST_LAMBDA_COMMA_OPERATOR_NAME
+#error "Multiple defines of BOOST_LAMBDA_COMMA_OPERATOR_NAME"
+#endif
+
+#define BOOST_LAMBDA_COMMA_OPERATOR_NAME operator,
+
+BOOST_LAMBDA_BE1(BOOST_LAMBDA_COMMA_OPERATOR_NAME, other_action<comma_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE2(BOOST_LAMBDA_COMMA_OPERATOR_NAME, other_action<comma_action>, const A, const B, const_copy_argument)
+BOOST_LAMBDA_BE3(BOOST_LAMBDA_COMMA_OPERATOR_NAME, other_action<comma_action>, const A, const B, const_copy_argument)
+
+
+
+namespace detail {
+
+// special cases for ostream& << Any and istream& >> Any ---------------
+// the actual stream classes may vary and thus a specialisation for,
+// say ostream& does not match (the general case above is chosen).
+// Therefore we specialise for non-const reference:
+// if the left argument is a stream, we store the stream as reference
+// if it is something else, we store a const plain by default
+
+// Note that the overloading is const vs. non-const first argument
+
+#ifdef BOOST_NO_TEMPLATED_STREAMS
+template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
+ typedef typename detail::IF<
+ ndnboost::is_convertible<T*, std::ostream*>::value,
+ T&,
+ typename const_copy_argument <T>::type
+ >::RET type;
+};
+
+template<class T> struct convert_istream_to_ref_others_to_c_plain_by_default {
+ typedef typename detail::IF<
+ ndnboost::is_convertible<T*, std::istream*>::value,
+ T&,
+ typename const_copy_argument <T>::type
+ >::RET type;
+};
+#else
+
+template<class T> struct convert_ostream_to_ref_others_to_c_plain_by_default {
+ typedef typename detail::IF<
+ is_instance_of_2<
+ T, std::basic_ostream
+ >::value,
+ T&,
+ typename const_copy_argument <T>::type
+ >::RET type;
+};
+
+template<class T> struct convert_istream_to_ref_others_to_c_plain_by_default {
+ typedef typename detail::IF<
+ is_instance_of_2<
+ T, std::basic_istream
+ >::value,
+ T&,
+ typename const_copy_argument <T>::type
+ >::RET type;
+};
+#endif
+
+} // detail
+
+BOOST_LAMBDA_BE2(operator<<, bitwise_action< leftshift_action>, A, const B, detail::convert_ostream_to_ref_others_to_c_plain_by_default)
+BOOST_LAMBDA_BE2(operator>>, bitwise_action< rightshift_action>, A, const B, detail::convert_istream_to_ref_others_to_c_plain_by_default)
+
+
+// special case for io_manipulators.
+// function references cannot be given as arguments to lambda operator
+// expressions in general. With << and >> the use of manipulators is
+// so common, that specializations are provided to make them work.
+
+template<class Arg, class Ret, class ManipArg>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ bitwise_action<leftshift_action>,
+ tuple<lambda_functor<Arg>, Ret(&)(ManipArg)>
+ >
+>
+operator<<(const lambda_functor<Arg>& a, Ret(&b)(ManipArg))
+{
+ return
+ lambda_functor_base<
+ bitwise_action<leftshift_action>,
+ tuple<lambda_functor<Arg>, Ret(&)(ManipArg)>
+ >
+ ( tuple<lambda_functor<Arg>, Ret(&)(ManipArg)>(a, b) );
+}
+
+template<class Arg, class Ret, class ManipArg>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ bitwise_action<rightshift_action>,
+ tuple<lambda_functor<Arg>, Ret(&)(ManipArg)>
+ >
+>
+operator>>(const lambda_functor<Arg>& a, Ret(&b)(ManipArg))
+{
+ return
+ lambda_functor_base<
+ bitwise_action<rightshift_action>,
+ tuple<lambda_functor<Arg>, Ret(&)(ManipArg)>
+ >
+ ( tuple<lambda_functor<Arg>, Ret(&)(ManipArg)>(a, b) );
+}
+
+
+// (+ and -) take their arguments as const references.
+// This has consquences with pointer artihmetic
+// E.g int a[]; ... *a = 1 works but not *(a+1) = 1.
+// the result of a+1 would be const
+// To make the latter work too,
+// non-const arrays are taken as non-const and stored as non-const as well.
+#if defined BOOST_LAMBDA_PTR_ARITHMETIC_E1
+#error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E1"
+#endif
+
+#define BOOST_LAMBDA_PTR_ARITHMETIC_E1(OPER_NAME, ACTION, CONSTB) \
+template<class Arg, int N, class B> \
+inline const \
+lambda_functor< \
+ lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
+> \
+OPER_NAME (const lambda_functor<Arg>& a, CONSTB(&b)[N]) \
+{ \
+ return \
+ lambda_functor_base<ACTION, tuple<lambda_functor<Arg>, CONSTB(&)[N]> > \
+ (tuple<lambda_functor<Arg>, CONSTB(&)[N]>(a, b)); \
+}
+
+
+#if defined BOOST_LAMBDA_PTR_ARITHMETIC_E2
+#error "Multiple defines of BOOST_LAMBDA_PTR_ARITHMETIC_E2"
+#endif
+
+#define BOOST_LAMBDA_PTR_ARITHMETIC_E2(OPER_NAME, ACTION, CONSTA) \
+template<int N, class A, class Arg> \
+inline const \
+lambda_functor< \
+ lambda_functor_base<ACTION, tuple<CONSTA(&)[N], lambda_functor<Arg> > > \
+> \
+OPER_NAME (CONSTA(&a)[N], const lambda_functor<Arg>& b) \
+{ \
+ return \
+ lambda_functor_base<ACTION, tuple<CONSTA(&)[N], lambda_functor<Arg> > > \
+ (tuple<CONSTA(&)[N], lambda_functor<Arg> >(a, b)); \
+}
+
+
+BOOST_LAMBDA_PTR_ARITHMETIC_E1(operator+, arithmetic_action<plus_action>, B)
+BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator+, arithmetic_action<plus_action>, A)
+BOOST_LAMBDA_PTR_ARITHMETIC_E1(operator+, arithmetic_action<plus_action>,const B)
+BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator+, arithmetic_action<plus_action>,const A)
+
+
+//BOOST_LAMBDA_PTR_ARITHMETIC_E1(operator-, arithmetic_action<minus_action>)
+// This is not needed, since the result of ptr-ptr is an rvalue anyway
+
+BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator-, arithmetic_action<minus_action>, A)
+BOOST_LAMBDA_PTR_ARITHMETIC_E2(operator-, arithmetic_action<minus_action>, const A)
+
+
+#undef BOOST_LAMBDA_BE1
+#undef BOOST_LAMBDA_BE2
+#undef BOOST_LAMBDA_BE3
+#undef BOOST_LAMBDA_BE
+#undef BOOST_LAMBDA_COMMA_OPERATOR_NAME
+
+#undef BOOST_LAMBDA_PTR_ARITHMETIC_E1
+#undef BOOST_LAMBDA_PTR_ARITHMETIC_E2
+
+
+// ---------------------------------------------------------------------
+// unary operators -----------------------------------------------------
+// ---------------------------------------------------------------------
+
+#if defined BOOST_LAMBDA_UE
+#error "Multiple defines of BOOST_LAMBDA_UE"
+#endif
+
+#define BOOST_LAMBDA_UE(OPER_NAME, ACTION) \
+template<class Arg> \
+inline const \
+lambda_functor<lambda_functor_base<ACTION, tuple<lambda_functor<Arg> > > > \
+OPER_NAME (const lambda_functor<Arg>& a) \
+{ \
+ return \
+ lambda_functor_base<ACTION, tuple<lambda_functor<Arg> > > \
+ ( tuple<lambda_functor<Arg> >(a) ); \
+}
+
+
+BOOST_LAMBDA_UE(operator+, unary_arithmetic_action<plus_action>)
+BOOST_LAMBDA_UE(operator-, unary_arithmetic_action<minus_action>)
+BOOST_LAMBDA_UE(operator~, bitwise_action<not_action>)
+BOOST_LAMBDA_UE(operator!, logical_action<not_action>)
+BOOST_LAMBDA_UE(operator++, pre_increment_decrement_action<increment_action>)
+BOOST_LAMBDA_UE(operator--, pre_increment_decrement_action<decrement_action>)
+BOOST_LAMBDA_UE(operator*, other_action<contentsof_action>)
+BOOST_LAMBDA_UE(operator&, other_action<addressof_action>)
+
+#if defined BOOST_LAMBDA_POSTFIX_UE
+#error "Multiple defines of BOOST_LAMBDA_POSTFIX_UE"
+#endif
+
+#define BOOST_LAMBDA_POSTFIX_UE(OPER_NAME, ACTION) \
+template<class Arg> \
+inline const \
+lambda_functor<lambda_functor_base<ACTION, tuple<lambda_functor<Arg> > > > \
+OPER_NAME (const lambda_functor<Arg>& a, int) \
+{ \
+ return \
+ lambda_functor_base<ACTION, tuple<lambda_functor<Arg> > > \
+ ( tuple<lambda_functor<Arg> >(a) ); \
+}
+
+
+BOOST_LAMBDA_POSTFIX_UE(operator++, post_increment_decrement_action<increment_action>)
+BOOST_LAMBDA_POSTFIX_UE(operator--, post_increment_decrement_action<decrement_action>)
+
+#undef BOOST_LAMBDA_UE
+#undef BOOST_LAMBDA_POSTFIX_UE
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/detail/ret.hpp b/ndnboost/lambda/detail/ret.hpp
new file mode 100644
index 0000000..8261bbd
--- /dev/null
+++ b/ndnboost/lambda/detail/ret.hpp
@@ -0,0 +1,325 @@
+// Boost Lambda Library ret.hpp -----------------------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+
+#ifndef BOOST_LAMBDA_RET_HPP
+#define BOOST_LAMBDA_RET_HPP
+
+namespace ndnboost {
+namespace lambda {
+
+ // TODO:
+
+// Add specializations for function references for ret, protect and unlambda
+// e.g void foo(); unlambda(foo); fails, as it would add a const qualifier
+ // for a function type.
+ // on the other hand unlambda(*foo) does work
+
+
+// -- ret -------------------------
+// the explicit return type template
+
+ // TODO: It'd be nice to make ret a nop for other than lambda functors
+ // but causes an ambiguiyty with gcc (not with KCC), check what is the
+ // right interpretation.
+
+ // // ret for others than lambda functors has no effect
+ // template <class U, class T>
+ // inline const T& ret(const T& t) { return t; }
+
+
+template<class RET, class Arg>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ explicit_return_type_action<RET>,
+ tuple<lambda_functor<Arg> >
+ >
+>
+ret(const lambda_functor<Arg>& a1)
+{
+ return
+ lambda_functor_base<
+ explicit_return_type_action<RET>,
+ tuple<lambda_functor<Arg> >
+ >
+ (tuple<lambda_functor<Arg> >(a1));
+}
+
+// protect ------------------
+
+ // protecting others than lambda functors has no effect
+template <class T>
+inline const T& protect(const T& t) { return t; }
+
+template<class Arg>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ protect_action,
+ tuple<lambda_functor<Arg> >
+ >
+>
+protect(const lambda_functor<Arg>& a1)
+{
+ return
+ lambda_functor_base<
+ protect_action,
+ tuple<lambda_functor<Arg> >
+ >
+ (tuple<lambda_functor<Arg> >(a1));
+}
+
+// -------------------------------------------------------------------
+
+// Hides the lambda functorness of a lambda functor.
+// After this, the functor is immune to argument substitution, etc.
+// This can be used, e.g. to make it safe to pass lambda functors as
+// arguments to functions, which might use them as target functions
+
+// note, unlambda and protect are different things. Protect hides the lambda
+// functor for one application, unlambda for good.
+
+template <class LambdaFunctor>
+class non_lambda_functor
+{
+ LambdaFunctor lf;
+public:
+
+ // This functor defines the result_type typedef.
+ // The result type must be deducible without knowing the arguments
+
+ template <class SigArgs> struct sig {
+ typedef typename
+ LambdaFunctor::inherited::
+ template sig<typename SigArgs::tail_type>::type type;
+ };
+
+ explicit non_lambda_functor(const LambdaFunctor& a) : lf(a) {}
+
+ typename LambdaFunctor::nullary_return_type
+ operator()() const {
+ return lf.template
+ call<typename LambdaFunctor::nullary_return_type>
+ (cnull_type(), cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A>
+ typename sig<tuple<const non_lambda_functor, A&> >::type
+ operator()(A& a) const {
+ return lf.template call<typename sig<tuple<const non_lambda_functor, A&> >::type >(a, cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ typename sig<tuple<const non_lambda_functor, A&, B&> >::type
+ operator()(A& a, B& b) const {
+ return lf.template call<typename sig<tuple<const non_lambda_functor, A&, B&> >::type >(a, b, cnull_type(), cnull_type());
+ }
+
+ template<class A, class B, class C>
+ typename sig<tuple<const non_lambda_functor, A&, B&, C&> >::type
+ operator()(A& a, B& b, C& c) const {
+ return lf.template call<typename sig<tuple<const non_lambda_functor, A&, B&, C&> >::type>(a, b, c, cnull_type());
+ }
+};
+
+template <class Arg>
+inline const Arg& unlambda(const Arg& a) { return a; }
+
+template <class Arg>
+inline const non_lambda_functor<lambda_functor<Arg> >
+unlambda(const lambda_functor<Arg>& a)
+{
+ return non_lambda_functor<lambda_functor<Arg> >(a);
+}
+
+ // Due to a language restriction, lambda functors cannot be made to
+ // accept non-const rvalue arguments. Usually iterators do not return
+ // temporaries, but sometimes they do. That's why a workaround is provided.
+ // Note, that this potentially breaks const correctness, so be careful!
+
+// any lambda functor can be turned into a const_incorrect_lambda_functor
+// The operator() takes arguments as consts and then casts constness
+// away. So this breaks const correctness!!! but is a necessary workaround
+// in some cases due to language limitations.
+// Note, that this is not a lambda_functor anymore, so it can not be used
+// as a sub lambda expression.
+
+template <class LambdaFunctor>
+struct const_incorrect_lambda_functor {
+ LambdaFunctor lf;
+public:
+
+ explicit const_incorrect_lambda_functor(const LambdaFunctor& a) : lf(a) {}
+
+ template <class SigArgs> struct sig {
+ typedef typename
+ LambdaFunctor::inherited::template
+ sig<typename SigArgs::tail_type>::type type;
+ };
+
+ // The nullary case is not needed (no arguments, no parameter type problems)
+
+ template<class A>
+ typename sig<tuple<const const_incorrect_lambda_functor, A&> >::type
+ operator()(const A& a) const {
+ return lf.template call<typename sig<tuple<const const_incorrect_lambda_functor, A&> >::type >(const_cast<A&>(a), cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ typename sig<tuple<const const_incorrect_lambda_functor, A&, B&> >::type
+ operator()(const A& a, const B& b) const {
+ return lf.template call<typename sig<tuple<const const_incorrect_lambda_functor, A&, B&> >::type >(const_cast<A&>(a), const_cast<B&>(b), cnull_type(), cnull_type());
+ }
+
+ template<class A, class B, class C>
+ typename sig<tuple<const const_incorrect_lambda_functor, A&, B&, C&> >::type
+ operator()(const A& a, const B& b, const C& c) const {
+ return lf.template call<typename sig<tuple<const const_incorrect_lambda_functor, A&, B&, C&> >::type>(const_cast<A&>(a), const_cast<B&>(b), const_cast<C&>(c), cnull_type());
+ }
+};
+
+// ------------------------------------------------------------------------
+// any lambda functor can be turned into a const_parameter_lambda_functor
+// The operator() takes arguments as const.
+// This is useful if lambda functors are called with non-const rvalues.
+// Note, that this is not a lambda_functor anymore, so it can not be used
+// as a sub lambda expression.
+
+template <class LambdaFunctor>
+struct const_parameter_lambda_functor {
+ LambdaFunctor lf;
+public:
+
+ explicit const_parameter_lambda_functor(const LambdaFunctor& a) : lf(a) {}
+
+ template <class SigArgs> struct sig {
+ typedef typename
+ LambdaFunctor::inherited::template
+ sig<typename SigArgs::tail_type>::type type;
+ };
+
+ // The nullary case is not needed: no arguments, no constness problems.
+
+ template<class A>
+ typename sig<tuple<const const_parameter_lambda_functor, const A&> >::type
+ operator()(const A& a) const {
+ return lf.template call<typename sig<tuple<const const_parameter_lambda_functor, const A&> >::type >(a, cnull_type(), cnull_type(), cnull_type());
+ }
+
+ template<class A, class B>
+ typename sig<tuple<const const_parameter_lambda_functor, const A&, const B&> >::type
+ operator()(const A& a, const B& b) const {
+ return lf.template call<typename sig<tuple<const const_parameter_lambda_functor, const A&, const B&> >::type >(a, b, cnull_type(), cnull_type());
+ }
+
+ template<class A, class B, class C>
+ typename sig<tuple<const const_parameter_lambda_functor, const A&, const B&, const C&>
+>::type
+ operator()(const A& a, const B& b, const C& c) const {
+ return lf.template call<typename sig<tuple<const const_parameter_lambda_functor, const A&, const B&, const C&> >::type>(a, b, c, cnull_type());
+ }
+};
+
+template <class Arg>
+inline const const_incorrect_lambda_functor<lambda_functor<Arg> >
+break_const(const lambda_functor<Arg>& lf)
+{
+ return const_incorrect_lambda_functor<lambda_functor<Arg> >(lf);
+}
+
+
+template <class Arg>
+inline const const_parameter_lambda_functor<lambda_functor<Arg> >
+const_parameters(const lambda_functor<Arg>& lf)
+{
+ return const_parameter_lambda_functor<lambda_functor<Arg> >(lf);
+}
+
+// make void ------------------------------------------------
+// make_void( x ) turns a lambda functor x with some return type y into
+// another lambda functor, which has a void return type
+// when called, the original return type is discarded
+
+// we use this action. The action class will be called, which means that
+// the wrapped lambda functor is evaluated, but we just don't do anything
+// with the result.
+struct voidifier_action {
+ template<class Ret, class A> static void apply(A&) {}
+};
+
+template<class Args> struct return_type_N<voidifier_action, Args> {
+ typedef void type;
+};
+
+template<class Arg1>
+inline const
+lambda_functor<
+ lambda_functor_base<
+ action<1, voidifier_action>,
+ tuple<lambda_functor<Arg1> >
+ >
+>
+make_void(const lambda_functor<Arg1>& a1) {
+return
+ lambda_functor_base<
+ action<1, voidifier_action>,
+ tuple<lambda_functor<Arg1> >
+ >
+ (tuple<lambda_functor<Arg1> > (a1));
+}
+
+// for non-lambda functors, make_void does nothing
+// (the argument gets evaluated immediately)
+
+template<class Arg1>
+inline const
+lambda_functor<
+ lambda_functor_base<do_nothing_action, null_type>
+>
+make_void(const Arg1&) {
+return
+ lambda_functor_base<do_nothing_action, null_type>();
+}
+
+// std_functor -----------------------------------------------------
+
+// The STL uses the result_type typedef as the convention to let binders know
+// the return type of a function object.
+// LL uses the sig template.
+// To let LL know that the function object has the result_type typedef
+// defined, it can be wrapped with the std_functor function.
+
+
+// Just inherit form the template parameter (the standard functor),
+// and provide a sig template. So we have a class which is still the
+// same functor + the sig template.
+
+template<class T>
+struct result_type_to_sig : public T {
+ template<class Args> struct sig { typedef typename T::result_type type; };
+ result_type_to_sig(const T& t) : T(t) {}
+};
+
+template<class F>
+inline result_type_to_sig<F> std_functor(const F& f) { return f; }
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
+
+
+
+
+
+
+
diff --git a/ndnboost/lambda/detail/return_type_traits.hpp b/ndnboost/lambda/detail/return_type_traits.hpp
new file mode 100644
index 0000000..58771b7
--- /dev/null
+++ b/ndnboost/lambda/detail/return_type_traits.hpp
@@ -0,0 +1,282 @@
+// return_type_traits.hpp -- Boost Lambda Library ---------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see www.boost.org
+
+
+#ifndef BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP
+#define BOOST_LAMBDA_RETURN_TYPE_TRAITS_HPP
+
+#include "ndnboost/mpl/has_xxx.hpp"
+
+#include <cstddef> // needed for the ptrdiff_t
+
+namespace ndnboost {
+namespace lambda {
+
+using ::ndnboost::type_traits::ice_and;
+using ::ndnboost::type_traits::ice_or;
+using ::ndnboost::type_traits::ice_not;
+
+// Much of the type deduction code for standard arithmetic types
+// from Gary Powell
+
+ // different arities:
+template <class Act, class A1> struct return_type_1; // 1-ary actions
+template <class Act, class A1, class A2> struct return_type_2; // 2-ary
+template <class Act, class Args> struct return_type_N; // >3- ary
+
+template <class Act, class A1> struct return_type_1_prot;
+template <class Act, class A1, class A2> struct return_type_2_prot; // 2-ary
+template <class Act, class A1> struct return_type_N_prot; // >3-ary
+
+
+namespace detail {
+
+template<class> class return_type_deduction_failure {};
+
+ // In some cases return type deduction should fail (an invalid lambda
+ // expression). Sometimes the lambda expression can be ok, the return type
+ // just is not deducible (user defined operators). Then return type deduction
+ // should never be entered at all, and the use of ret<> does this.
+ // However, for nullary lambda functors, return type deduction is always
+ // entered, and there seems to be no way around this.
+
+ // (the return type is part of the prototype of the non-template
+ // operator()(). The prototype is instantiated, even though the body
+ // is not.)
+
+ // So, in the case the return type deduction should fail, it should not
+ // fail directly, but rather result in a valid but wrong return type,
+ // causing a compile time error only if the function is really called.
+
+
+
+} // end detail
+
+
+
+// return_type_X_prot classes --------------------------------------------
+// These classes are the first layer that gets instantiated from the
+// lambda_functor_base sig templates. It will check whether
+// the action is protectable and one of arguments is "protected" or its
+// evaluation will otherwise result in another lambda functor.
+// If this is a case, the result type will be another lambda functor.
+
+// The arguments are always non-reference types, except for comma action
+// where the right argument can be a reference too. This is because it
+// matters (in the builtin case) whether the argument is an lvalue or
+// rvalue: int i; i, 1 -> rvalue; 1, i -> lvalue
+
+template <class Act, class A> struct return_type_1_prot {
+public:
+ typedef typename
+ detail::IF<
+ // is_protectable<Act>::value && is_lambda_functor<A>::value,
+ ice_and<is_protectable<Act>::value, is_lambda_functor<A>::value>::value,
+ lambda_functor<
+ lambda_functor_base<
+ Act,
+ tuple<typename detail::remove_reference_and_cv<A>::type>
+ >
+ >,
+ typename return_type_1<Act, A>::type
+ >::RET type;
+};
+
+ // take care of the unavoidable instantiation for nullary case
+template<class Act> struct return_type_1_prot<Act, null_type> {
+ typedef null_type type;
+};
+
+// Unary actions (result from unary operators)
+// do not have a default return type.
+template<class Act, class A> struct return_type_1 {
+ typedef typename
+ detail::return_type_deduction_failure<return_type_1> type;
+};
+
+
+namespace detail {
+
+ template <class T>
+ class protect_conversion {
+ typedef typename ndnboost::remove_reference<T>::type non_ref_T;
+ public:
+
+ // add const to rvalues, so that all rvalues are stored as const in
+ // the args tuple
+ typedef typename detail::IF_type<
+// ndnboost::is_reference<T>::value && !ndnboost::is_const<non_ref_T>::value,
+ ice_and<ndnboost::is_reference<T>::value,
+ ice_not<ndnboost::is_const<non_ref_T>::value>::value>::value,
+ detail::identity_mapping<T>,
+ const_copy_argument<non_ref_T> // handles funtion and array
+ >::type type; // types correctly
+ };
+
+} // end detail
+
+template <class Act, class A, class B> struct return_type_2_prot {
+
+// experimental feature
+ // We may have a lambda functor as a result type of a subexpression
+ // (if protect) has been used.
+ // Thus, if one of the parameter types is a lambda functor, the result
+ // is a lambda functor as well.
+ // We need to make a conservative choise here.
+ // The resulting lambda functor stores all const reference arguments as
+ // const copies. References to non-const are stored as such.
+ // So if the source of the argument is a const open argument, a bound
+ // argument stored as a const reference, or a function returning a
+ // const reference, that information is lost. There is no way of
+ // telling apart 'real const references' from just 'LL internal
+ // const references' (or it would be really hard)
+
+ // The return type is a subclass of lambda_functor, which has a converting
+ // copy constructor. It can copy any lambda functor, that has the same
+ // action type and code, and a copy compatible argument tuple.
+
+
+ typedef typename ndnboost::remove_reference<A>::type non_ref_A;
+ typedef typename ndnboost::remove_reference<B>::type non_ref_B;
+
+typedef typename
+ detail::IF<
+// is_protectable<Act>::value &&
+// (is_lambda_functor<A>::value || is_lambda_functor<B>::value),
+ ice_and<is_protectable<Act>::value,
+ ice_or<is_lambda_functor<A>::value,
+ is_lambda_functor<B>::value>::value>::value,
+ lambda_functor<
+ lambda_functor_base<
+ Act,
+ tuple<typename detail::protect_conversion<A>::type,
+ typename detail::protect_conversion<B>::type>
+ >
+ >,
+ typename return_type_2<Act, non_ref_A, non_ref_B>::type
+ >::RET type;
+};
+
+ // take care of the unavoidable instantiation for nullary case
+template<class Act> struct return_type_2_prot<Act, null_type, null_type> {
+ typedef null_type type;
+};
+ // take care of the unavoidable instantiation for nullary case
+template<class Act, class Other> struct return_type_2_prot<Act, Other, null_type> {
+ typedef null_type type;
+};
+ // take care of the unavoidable instantiation for nullary case
+template<class Act, class Other> struct return_type_2_prot<Act, null_type, Other> {
+ typedef null_type type;
+};
+
+ // comma is a special case, as the user defined operator can return
+ // an lvalue (reference) too, hence it must be handled at this level.
+template<class A, class B>
+struct return_type_2_comma
+{
+ typedef typename ndnboost::remove_reference<A>::type non_ref_A;
+ typedef typename ndnboost::remove_reference<B>::type non_ref_B;
+
+typedef typename
+ detail::IF<
+// is_protectable<other_action<comma_action> >::value && // it is protectable
+// (is_lambda_functor<A>::value || is_lambda_functor<B>::value),
+ ice_and<is_protectable<other_action<comma_action> >::value, // it is protectable
+ ice_or<is_lambda_functor<A>::value,
+ is_lambda_functor<B>::value>::value>::value,
+ lambda_functor<
+ lambda_functor_base<
+ other_action<comma_action>,
+ tuple<typename detail::protect_conversion<A>::type,
+ typename detail::protect_conversion<B>::type>
+ >
+ >,
+ typename
+ return_type_2<other_action<comma_action>, non_ref_A, non_ref_B>::type
+ >::RET type1;
+
+ // if no user defined return_type_2 (or plain_return_type_2) specialization
+ // matches, then return the righthand argument
+ typedef typename
+ detail::IF<
+ ndnboost::is_same<type1, detail::unspecified>::value,
+ B,
+ type1
+ >::RET type;
+
+};
+
+
+ // currently there are no protectable actions with > 2 args
+
+template<class Act, class Args> struct return_type_N_prot {
+ typedef typename return_type_N<Act, Args>::type type;
+};
+
+ // take care of the unavoidable instantiation for nullary case
+template<class Act> struct return_type_N_prot<Act, null_type> {
+ typedef null_type type;
+};
+
+// handle different kind of actions ------------------------
+
+ // use the return type given in the bind invocation as bind<Ret>(...)
+template<int I, class Args, class Ret>
+struct return_type_N<function_action<I, Ret>, Args> {
+ typedef Ret type;
+};
+
+// ::result_type support
+
+namespace detail
+{
+
+BOOST_MPL_HAS_XXX_TRAIT_DEF(result_type)
+
+template<class F> struct get_result_type
+{
+ typedef typename F::result_type type;
+};
+
+template<class F, class A> struct get_sig
+{
+ typedef typename function_adaptor<F>::template sig<A>::type type;
+};
+
+} // namespace detail
+
+ // Ret is detail::unspecified, so try to deduce return type
+template<int I, class Args>
+struct return_type_N<function_action<I, detail::unspecified>, Args > {
+
+ // in the case of function action, the first element in Args is
+ // some type of function
+ typedef typename Args::head_type Func;
+ typedef typename detail::remove_reference_and_cv<Func>::type plain_Func;
+
+public:
+ // pass the function to function_adaptor, and get the return type from
+ // that
+ typedef typename detail::IF<
+ detail::has_result_type<plain_Func>::value,
+ detail::get_result_type<plain_Func>,
+ detail::get_sig<plain_Func, Args>
+ >::RET::type type;
+};
+
+
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
+
+
+
diff --git a/ndnboost/lambda/detail/select_functions.hpp b/ndnboost/lambda/detail/select_functions.hpp
new file mode 100644
index 0000000..7b3ef8a
--- /dev/null
+++ b/ndnboost/lambda/detail/select_functions.hpp
@@ -0,0 +1,74 @@
+// -- select_functions.hpp -- Boost Lambda Library --------------------------
+
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see http://www.boost.org
+
+
+#ifndef BOOST_LAMBDA_SELECT_FUNCTIONS_HPP
+#define BOOST_LAMBDA_SELECT_FUNCTIONS_HPP
+
+namespace ndnboost {
+namespace lambda {
+namespace detail {
+
+
+// select functions -------------------------------
+template<class Any, CALL_TEMPLATE_ARGS>
+inline Any& select(Any& any, CALL_FORMAL_ARGS) { CALL_USE_ARGS; return any; }
+
+
+template<class Arg, CALL_TEMPLATE_ARGS>
+inline typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
+select ( const lambda_functor<Arg>& op, CALL_FORMAL_ARGS ) {
+ return op.template call<
+ typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
+ >(CALL_ACTUAL_ARGS);
+}
+template<class Arg, CALL_TEMPLATE_ARGS>
+inline typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
+select ( lambda_functor<Arg>& op, CALL_FORMAL_ARGS) {
+ return op.template call<
+ typename Arg::template sig<tuple<CALL_REFERENCE_TYPES> >::type
+ >(CALL_ACTUAL_ARGS);
+}
+
+// ------------------------------------------------------------------------
+// select functions where the return type is explicitly given
+// Note: on many functions, this return type is just discarded.
+// The select functions are inside a class template, and the return type
+// is a class template argument.
+// The first implementation used function templates with an explicitly
+// specified template parameter.
+// However, this resulted in ambiguous calls (at least with gcc 2.95.2
+// and edg 2.44). Not sure whether the compilers were right or wrong.
+
+template<class RET> struct r_select {
+
+// Any == RET
+ template<class Any, CALL_TEMPLATE_ARGS>
+ static
+ inline RET go (Any& any, CALL_FORMAL_ARGS) { CALL_USE_ARGS; return any; }
+
+
+ template<class Arg, CALL_TEMPLATE_ARGS>
+ static
+ inline RET go (const lambda_functor<Arg>& op, CALL_FORMAL_ARGS ) {
+ return op.template call<RET>(CALL_ACTUAL_ARGS);
+ }
+ template<class Arg, CALL_TEMPLATE_ARGS>
+ static
+ inline RET go (lambda_functor<Arg>& op, CALL_FORMAL_ARGS ) {
+ return op.template call<RET>(CALL_ACTUAL_ARGS);
+ }
+};
+
+} // namespace detail
+} // namespace lambda
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/lambda/lambda.hpp b/ndnboost/lambda/lambda.hpp
new file mode 100644
index 0000000..593ef70
--- /dev/null
+++ b/ndnboost/lambda/lambda.hpp
@@ -0,0 +1,34 @@
+// -- lambda.hpp -- Boost Lambda Library -----------------------------------
+// Copyright (C) 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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)
+//
+// For more information, see http://lambda.cs.utu.fi
+
+#ifndef BOOST_LAMBDA_LAMBDA_HPP
+#define BOOST_LAMBDA_LAMBDA_HPP
+
+
+#include "ndnboost/lambda/core.hpp"
+
+#ifdef BOOST_NO_FDECL_TEMPLATES_AS_TEMPLATE_TEMPLATE_PARAMS
+#include <istream>
+#include <ostream>
+#endif
+
+#include "ndnboost/lambda/detail/operator_actions.hpp"
+#include "ndnboost/lambda/detail/operator_lambda_func_base.hpp"
+#include "ndnboost/lambda/detail/operator_return_type_traits.hpp"
+
+
+#include "ndnboost/lambda/detail/operators.hpp"
+
+#ifndef BOOST_LAMBDA_FAILS_IN_TEMPLATE_KEYWORD_AFTER_SCOPE_OPER
+// sorry, member ptr does not work with gcc2.95
+#include "ndnboost/lambda/detail/member_ptr.hpp"
+#endif
+
+
+#endif
diff --git a/ndnboost/lexical_cast.hpp b/ndnboost/lexical_cast.hpp
new file mode 100644
index 0000000..40d1903
--- /dev/null
+++ b/ndnboost/lexical_cast.hpp
@@ -0,0 +1,2725 @@
+#ifndef BOOST_LEXICAL_CAST_INCLUDED
+#define BOOST_LEXICAL_CAST_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+// Boost lexical_cast.hpp header -------------------------------------------//
+//
+// See http://www.boost.org/libs/conversion for documentation.
+// See end of this header for rights and permissions.
+//
+// what: lexical_cast custom keyword cast
+// who: contributed by Kevlin Henney,
+// enhanced with contributions from Terje Slettebo,
+// with additional fixes and suggestions from Gennaro Prota,
+// Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov,
+// Alexander Nasonov, Antony Polukhin, Justin Viiret, Michael Hofmann,
+// Cheng Yang, Matthew Bradbury, David W. Birdsall, Pavel Korzh and other Boosters
+// when: November 2000, March 2003, June 2005, June 2006, March 2011 - 2013
+
+#include <ndnboost/config.hpp>
+#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_WSTRING)
+#define BOOST_LCAST_NO_WCHAR_T
+#endif
+
+#include <climits>
+#include <cstddef>
+#include <string>
+#include <cstring>
+#include <cstdio>
+#include <typeinfo>
+#include <exception>
+#include <ndnboost/limits.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/type_traits/ice.hpp>
+#include <ndnboost/type_traits/is_pointer.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/detail/lcast_precision.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+
+#ifndef BOOST_NO_STD_LOCALE
+# include <locale>
+#else
+# ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ // Getting error at this point means, that your STL library is old/lame/misconfigured.
+ // If nothing can be done with STL library, define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE,
+ // but beware: lexical_cast will understand only 'C' locale delimeters and thousands
+ // separators.
+# error "Unable to use <locale> header. Define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE to force "
+# error "ndnboost::lexical_cast to use only 'C' locale during conversions."
+# endif
+#endif
+
+#ifdef BOOST_NO_STRINGSTREAM
+#include <strstream>
+#else
+#include <sstream>
+#endif
+
+#ifdef BOOST_NO_TYPEID
+#define BOOST_LCAST_THROW_BAD_CAST(S, T) throw_exception(bad_lexical_cast())
+#else
+#define BOOST_LCAST_THROW_BAD_CAST(Source, Target) \
+ throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)))
+#endif
+
+#if (defined(BOOST_LCAST_HAS_INT128) && !defined(__GNUC__)) || GCC_VERSION > 40700
+#define BOOST_LCAST_HAS_INT128
+#endif
+
+
+namespace ndnboost
+{
+ // exception used to indicate runtime lexical_cast failure
+ class BOOST_SYMBOL_VISIBLE bad_lexical_cast :
+ // workaround MSVC bug with std::bad_cast when _HAS_EXCEPTIONS == 0
+#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS
+ public std::exception
+#else
+ public std::bad_cast
+#endif
+
+#if defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x560 )
+ // under bcc32 5.5.1 bad_cast doesn't derive from exception
+ , public std::exception
+#endif
+
+ {
+ public:
+ bad_lexical_cast() BOOST_NOEXCEPT :
+#ifndef BOOST_NO_TYPEID
+ source(&typeid(void)), target(&typeid(void))
+#else
+ source(0), target(0) // this breaks getters
+#endif
+ {
+ }
+
+ bad_lexical_cast(
+ const std::type_info &source_type_arg,
+ const std::type_info &target_type_arg) BOOST_NOEXCEPT :
+ source(&source_type_arg), target(&target_type_arg)
+ {
+ }
+
+ const std::type_info &source_type() const
+ {
+ return *source;
+ }
+ const std::type_info &target_type() const
+ {
+ return *target;
+ }
+
+#ifndef BOOST_NO_CXX11_NOEXCEPT
+ virtual const char *what() const noexcept
+#else
+ virtual const char *what() const throw()
+#endif
+ {
+ return "bad lexical cast: "
+ "source type value could not be interpreted as target";
+ }
+
+#ifndef BOOST_NO_CXX11_NOEXCEPT
+ virtual ~bad_lexical_cast() BOOST_NOEXCEPT
+#else
+ virtual ~bad_lexical_cast() throw()
+#endif
+ {}
+ private:
+ const std::type_info *source;
+ const std::type_info *target;
+ };
+
+ namespace detail // widest_char
+ {
+ template <typename TargetChar, typename SourceChar>
+ struct widest_char
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ (sizeof(TargetChar) > sizeof(SourceChar))
+ , TargetChar
+ , SourceChar >::type type;
+ };
+ }
+} // namespace ndnboost
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(__SUNPRO_CC) && !defined(__PGIC__)
+
+#include <cmath>
+#include <istream>
+
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+#include <array>
+#endif
+
+#include <ndnboost/array.hpp>
+#include <ndnboost/numeric/conversion/cast.hpp>
+#include <ndnboost/type_traits/make_unsigned.hpp>
+#include <ndnboost/type_traits/is_signed.hpp>
+#include <ndnboost/type_traits/is_integral.hpp>
+#include <ndnboost/type_traits/is_arithmetic.hpp>
+#include <ndnboost/type_traits/remove_pointer.hpp>
+#include <ndnboost/type_traits/has_left_shift.hpp>
+#include <ndnboost/type_traits/has_right_shift.hpp>
+#include <ndnboost/math/special_functions/sign.hpp>
+#include <ndnboost/math/special_functions/fpclassify.hpp>
+#include <ndnboost/range/iterator_range_core.hpp>
+#include <ndnboost/container/container_fwd.hpp>
+#include <ndnboost/integer.hpp>
+#ifndef BOOST_NO_CWCHAR
+# include <cwchar>
+#endif
+
+namespace ndnboost {
+
+ namespace detail // is_char_or_wchar<...>
+ {
+ // returns true, if T is one of the character types
+ template < typename T >
+ struct is_char_or_wchar
+ {
+ typedef ndnboost::type_traits::ice_or<
+ ndnboost::is_same< T, char >::value,
+ #ifndef BOOST_LCAST_NO_WCHAR_T
+ ndnboost::is_same< T, wchar_t >::value,
+ #endif
+ #ifndef BOOST_NO_CXX11_CHAR16_T
+ ndnboost::is_same< T, char16_t >::value,
+ #endif
+ #ifndef BOOST_NO_CXX11_CHAR32_T
+ ndnboost::is_same< T, char32_t >::value,
+ #endif
+ ndnboost::is_same< T, unsigned char >::value,
+ ndnboost::is_same< T, signed char >::value
+ > result_type;
+
+ BOOST_STATIC_CONSTANT(bool, value = (result_type::value) );
+ };
+ }
+
+ namespace detail // normalize_single_byte_char<Char>
+ {
+ // Converts signed/unsigned char to char
+ template < class Char >
+ struct normalize_single_byte_char
+ {
+ typedef Char type;
+ };
+
+ template <>
+ struct normalize_single_byte_char< signed char >
+ {
+ typedef char type;
+ };
+
+ template <>
+ struct normalize_single_byte_char< unsigned char >
+ {
+ typedef char type;
+ };
+ }
+
+ namespace detail // deduce_character_type_later<T>
+ {
+ // Helper type, meaning that stram character for T must be deduced
+ // at Stage 2 (See deduce_source_char<T> and deduce_target_char<T>)
+ template < class T > struct deduce_character_type_later {};
+ }
+
+ namespace detail // stream_char_common<T>
+ {
+ // Selectors to choose stream character type (common for Source and Target)
+ // Returns one of char, wchar_t, char16_t, char32_t or deduce_character_type_later<T> types
+ // Executed on Stage 1 (See deduce_source_char<T> and deduce_target_char<T>)
+ template < typename Type >
+ struct stream_char_common: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Type >::value,
+ Type,
+ ndnboost::detail::deduce_character_type_later< Type >
+ > {};
+
+ template < typename Char >
+ struct stream_char_common< Char* >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< Char* >
+ > {};
+
+ template < typename Char >
+ struct stream_char_common< const Char* >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< const Char* >
+ > {};
+
+ template < typename Char >
+ struct stream_char_common< ndnboost::iterator_range< Char* > >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< ndnboost::iterator_range< Char* > >
+ > {};
+
+ template < typename Char >
+ struct stream_char_common< ndnboost::iterator_range< const Char* > >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< ndnboost::iterator_range< const Char* > >
+ > {};
+
+ template < class Char, class Traits, class Alloc >
+ struct stream_char_common< std::basic_string< Char, Traits, Alloc > >
+ {
+ typedef Char type;
+ };
+
+ template < class Char, class Traits, class Alloc >
+ struct stream_char_common< ndnboost::container::basic_string< Char, Traits, Alloc > >
+ {
+ typedef Char type;
+ };
+
+ template < typename Char, std::size_t N >
+ struct stream_char_common< ndnboost::array< Char, N > >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< ndnboost::array< Char, N > >
+ > {};
+
+ template < typename Char, std::size_t N >
+ struct stream_char_common< ndnboost::array< const Char, N > >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< ndnboost::array< const Char, N > >
+ > {};
+
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+ template < typename Char, std::size_t N >
+ struct stream_char_common< std::array<Char, N > >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< std::array< Char, N > >
+ > {};
+
+ template < typename Char, std::size_t N >
+ struct stream_char_common< std::array< const Char, N > >: public ndnboost::mpl::if_c<
+ ndnboost::detail::is_char_or_wchar< Char >::value,
+ Char,
+ ndnboost::detail::deduce_character_type_later< std::array< const Char, N > >
+ > {};
+#endif
+
+#ifdef BOOST_LCAST_HAS_INT128
+ template <> struct stream_char_common< ndnboost::int128_type >: public ndnboost::mpl::identity< char > {};
+ template <> struct stream_char_common< ndnboost::uint128_type >: public ndnboost::mpl::identity< char > {};
+#endif
+
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ template <>
+ struct stream_char_common< wchar_t >
+ {
+ typedef char type;
+ };
+#endif
+ }
+
+ namespace detail // deduce_source_char_impl<T>
+ {
+ // If type T is `deduce_character_type_later` type, then tries to deduce
+ // character type using ndnboost::has_left_shift<T> metafunction.
+ // Otherwise supplied type T is a character type, that must be normalized
+ // using normalize_single_byte_char<Char>.
+ // Executed at Stage 2 (See deduce_source_char<T> and deduce_target_char<T>)
+ template < class Char >
+ struct deduce_source_char_impl
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::normalize_single_byte_char< Char >::type type;
+ };
+
+ template < class T >
+ struct deduce_source_char_impl< deduce_character_type_later< T > >
+ {
+ typedef ndnboost::has_left_shift< std::basic_ostream< char >, T > result_t;
+
+#if defined(BOOST_LCAST_NO_WCHAR_T)
+ BOOST_STATIC_ASSERT_MSG((result_t::value),
+ "Source type is not std::ostream`able and std::wostream`s are not supported by your STL implementation");
+ typedef char type;
+#else
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ result_t::value, char, wchar_t
+ >::type type;
+
+ BOOST_STATIC_ASSERT_MSG((result_t::value || ndnboost::has_left_shift< std::basic_ostream< type >, T >::value),
+ "Source type is neither std::ostream`able nor std::wostream`able");
+#endif
+ };
+ }
+
+ namespace detail // deduce_target_char_impl<T>
+ {
+ // If type T is `deduce_character_type_later` type, then tries to deduce
+ // character type using ndnboost::has_right_shift<T> metafunction.
+ // Otherwise supplied type T is a character type, that must be normalized
+ // using normalize_single_byte_char<Char>.
+ // Executed at Stage 2 (See deduce_source_char<T> and deduce_target_char<T>)
+ template < class Char >
+ struct deduce_target_char_impl
+ {
+ typedef BOOST_DEDUCED_TYPENAME normalize_single_byte_char< Char >::type type;
+ };
+
+ template < class T >
+ struct deduce_target_char_impl< deduce_character_type_later<T> >
+ {
+ typedef ndnboost::has_right_shift<std::basic_istream<char>, T > result_t;
+
+#if defined(BOOST_LCAST_NO_WCHAR_T)
+ BOOST_STATIC_ASSERT_MSG((result_t::value),
+ "Target type is not std::istream`able and std::wistream`s are not supported by your STL implementation");
+ typedef char type;
+#else
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ result_t::value, char, wchar_t
+ >::type type;
+
+ BOOST_STATIC_ASSERT_MSG((result_t::value || ndnboost::has_right_shift<std::basic_istream<wchar_t>, T >::value),
+ "Target type is neither std::istream`able nor std::wistream`able");
+#endif
+ };
+ }
+
+ namespace detail // deduce_target_char<T> and deduce_source_char<T>
+ {
+ // We deduce stream character types in two stages.
+ //
+ // Stage 1 is common for Target and Source. At Stage 1 we get
+ // non normalized character type (may contain unsigned/signed char)
+ // or deduce_character_type_later<T> where T is the original type.
+ // Stage 1 is executed by stream_char_common<T>
+ //
+ // At Stage 2 we normalize character types or try to deduce character
+ // type using metafunctions.
+ // Stage 2 is executed by deduce_target_char_impl<T> and
+ // deduce_source_char_impl<T>
+ //
+ // deduce_target_char<T> and deduce_source_char<T> functions combine
+ // both stages
+
+ template < class T >
+ struct deduce_target_char
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char_common< T >::type stage1_type;
+ typedef BOOST_DEDUCED_TYPENAME deduce_target_char_impl< stage1_type >::type stage2_type;
+
+ typedef stage2_type type;
+ };
+
+ template < class T >
+ struct deduce_source_char
+ {
+ typedef BOOST_DEDUCED_TYPENAME stream_char_common< T >::type stage1_type;
+ typedef BOOST_DEDUCED_TYPENAME deduce_source_char_impl< stage1_type >::type stage2_type;
+
+ typedef stage2_type type;
+ };
+ }
+
+ namespace detail // deduce_char_traits template
+ {
+ // We are attempting to get char_traits<> from Source or Tagret
+ // template parameter. Otherwise we'll be using std::char_traits<Char>
+ template < class Char, class Target, class Source >
+ struct deduce_char_traits
+ {
+ typedef std::char_traits< Char > type;
+ };
+
+ template < class Char, class Traits, class Alloc, class Source >
+ struct deduce_char_traits< Char
+ , std::basic_string< Char, Traits, Alloc >
+ , Source
+ >
+ {
+ typedef Traits type;
+ };
+
+ template < class Char, class Target, class Traits, class Alloc >
+ struct deduce_char_traits< Char
+ , Target
+ , std::basic_string< Char, Traits, Alloc >
+ >
+ {
+ typedef Traits type;
+ };
+
+ template < class Char, class Traits, class Alloc, class Source >
+ struct deduce_char_traits< Char
+ , ndnboost::container::basic_string< Char, Traits, Alloc >
+ , Source
+ >
+ {
+ typedef Traits type;
+ };
+
+ template < class Char, class Target, class Traits, class Alloc >
+ struct deduce_char_traits< Char
+ , Target
+ , ndnboost::container::basic_string< Char, Traits, Alloc >
+ >
+ {
+ typedef Traits type;
+ };
+
+ template < class Char, class Traits, class Alloc1, class Alloc2 >
+ struct deduce_char_traits< Char
+ , std::basic_string< Char, Traits, Alloc1 >
+ , std::basic_string< Char, Traits, Alloc2 >
+ >
+ {
+ typedef Traits type;
+ };
+
+ template<class Char, class Traits, class Alloc1, class Alloc2>
+ struct deduce_char_traits< Char
+ , ndnboost::container::basic_string< Char, Traits, Alloc1 >
+ , ndnboost::container::basic_string< Char, Traits, Alloc2 >
+ >
+ {
+ typedef Traits type;
+ };
+
+ template < class Char, class Traits, class Alloc1, class Alloc2 >
+ struct deduce_char_traits< Char
+ , ndnboost::container::basic_string< Char, Traits, Alloc1 >
+ , std::basic_string< Char, Traits, Alloc2 >
+ >
+ {
+ typedef Traits type;
+ };
+
+ template < class Char, class Traits, class Alloc1, class Alloc2 >
+ struct deduce_char_traits< Char
+ , std::basic_string< Char, Traits, Alloc1 >
+ , ndnboost::container::basic_string< Char, Traits, Alloc2 >
+ >
+ {
+ typedef Traits type;
+ };
+ }
+
+ namespace detail // array_to_pointer_decay<T>
+ {
+ template<class T>
+ struct array_to_pointer_decay
+ {
+ typedef T type;
+ };
+
+ template<class T, std::size_t N>
+ struct array_to_pointer_decay<T[N]>
+ {
+ typedef const T * type;
+ };
+ }
+
+ namespace detail // is_this_float_conversion_optimized<Float, Char>
+ {
+ // this metafunction evaluates to true, if we have optimized comnversion
+ // from Float type to Char array.
+ // Must be in sync with lexical_stream_limited_src<Char, ...>::shl_real_type(...)
+ template <typename Float, typename Char>
+ struct is_this_float_conversion_optimized
+ {
+ typedef ndnboost::type_traits::ice_and<
+ ndnboost::is_float<Float>::value,
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_SWPRINTF) && !defined(__MINGW32__)
+ ndnboost::type_traits::ice_or<
+ ndnboost::type_traits::ice_eq<sizeof(Char), sizeof(char) >::value,
+ ndnboost::is_same<Char, wchar_t>::value
+ >::value
+#else
+ ndnboost::type_traits::ice_eq<sizeof(Char), sizeof(char) >::value
+#endif
+ > result_type;
+
+ BOOST_STATIC_CONSTANT(bool, value = (result_type::value) );
+ };
+ }
+
+ namespace detail // lcast_src_length
+ {
+ // Return max. length of string representation of Source;
+ template< class Source // Source type of lexical_cast.
+ >
+ struct lcast_src_length
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ // To check coverage, build the test with
+ // bjam --v2 profile optimization=off
+ static void check_coverage() {}
+ };
+
+ // Helper for integral types.
+ // Notes on length calculation:
+ // Max length for 32bit int with grouping "\1" and thousands_sep ',':
+ // "-2,1,4,7,4,8,3,6,4,7"
+ // ^ - is_signed
+ // ^ - 1 digit not counted by digits10
+ // ^^^^^^^^^^^^^^^^^^ - digits10 * 2
+ //
+ // Constant is_specialized is used instead of constant 1
+ // to prevent buffer overflow in a rare case when
+ // <ndnboost/limits.hpp> doesn't add missing specialization for
+ // numeric_limits<T> for some integral type T.
+ // When is_specialized is false, the whole expression is 0.
+ template<class Source>
+ struct lcast_src_length_integral
+ {
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_CONSTANT(std::size_t, value =
+ std::numeric_limits<Source>::is_signed +
+ std::numeric_limits<Source>::is_specialized + /* == 1 */
+ std::numeric_limits<Source>::digits10 * 2
+ );
+#else
+ BOOST_STATIC_CONSTANT(std::size_t, value = 156);
+ BOOST_STATIC_ASSERT(sizeof(Source) * CHAR_BIT <= 256);
+#endif
+ };
+
+#define BOOST_LCAST_DEF(T) \
+ template<> struct lcast_src_length<T> \
+ : lcast_src_length_integral<T> \
+ { static void check_coverage() {} };
+
+ BOOST_LCAST_DEF(short)
+ BOOST_LCAST_DEF(unsigned short)
+ BOOST_LCAST_DEF(int)
+ BOOST_LCAST_DEF(unsigned int)
+ BOOST_LCAST_DEF(long)
+ BOOST_LCAST_DEF(unsigned long)
+#if defined(BOOST_HAS_LONG_LONG)
+ BOOST_LCAST_DEF(ndnboost::ulong_long_type)
+ BOOST_LCAST_DEF(ndnboost::long_long_type )
+#elif defined(BOOST_HAS_MS_INT64)
+ BOOST_LCAST_DEF(unsigned __int64)
+ BOOST_LCAST_DEF( __int64)
+#endif
+#ifdef BOOST_LCAST_HAS_INT128
+ BOOST_LCAST_DEF(ndnboost::int128_type)
+ BOOST_LCAST_DEF(ndnboost::uint128_type)
+#endif
+
+#undef BOOST_LCAST_DEF
+
+#ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+ // Helper for floating point types.
+ // -1.23456789e-123456
+ // ^ sign
+ // ^ leading digit
+ // ^ decimal point
+ // ^^^^^^^^ lcast_precision<Source>::value
+ // ^ "e"
+ // ^ exponent sign
+ // ^^^^^^ exponent (assumed 6 or less digits)
+ // sign + leading digit + decimal point + "e" + exponent sign == 5
+ template<class Source>
+ struct lcast_src_length_floating
+ {
+ BOOST_STATIC_ASSERT(
+ std::numeric_limits<Source>::max_exponent10 <= 999999L &&
+ std::numeric_limits<Source>::min_exponent10 >= -999999L
+ );
+ BOOST_STATIC_CONSTANT(std::size_t, value =
+ 5 + lcast_precision<Source>::value + 6
+ );
+ };
+
+ template<>
+ struct lcast_src_length<float>
+ : lcast_src_length_floating<float>
+ {
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<double>
+ : lcast_src_length_floating<double>
+ {
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<long double>
+ : lcast_src_length_floating<long double>
+ {
+ static void check_coverage() {}
+ };
+
+#endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+ }
+
+ namespace detail // lexical_cast_stream_traits<Source, Target>
+ {
+ template <class Source, class Target>
+ struct lexical_cast_stream_traits {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::array_to_pointer_decay<Source>::type src;
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::remove_cv<src>::type no_cv_src;
+
+ typedef ndnboost::detail::deduce_source_char<no_cv_src> deduce_src_char_metafunc;
+ typedef BOOST_DEDUCED_TYPENAME deduce_src_char_metafunc::type src_char_t;
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::deduce_target_char<Target>::type target_char_t;
+
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::widest_char<
+ target_char_t, src_char_t
+ >::type char_type;
+
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ BOOST_STATIC_ASSERT_MSG(( !ndnboost::is_same<char16_t, src_char_t>::value
+ && !ndnboost::is_same<char16_t, target_char_t>::value),
+ "Your compiler does not have full support for char16_t" );
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ BOOST_STATIC_ASSERT_MSG(( !ndnboost::is_same<char32_t, src_char_t>::value
+ && !ndnboost::is_same<char32_t, target_char_t>::value),
+ "Your compiler does not have full support for char32_t" );
+#endif
+
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::deduce_char_traits<
+ char_type, Target, no_cv_src
+ >::type traits;
+
+ typedef ndnboost::type_traits::ice_and<
+ ndnboost::is_same<char, src_char_t>::value, // source is not a wide character based type
+ ndnboost::type_traits::ice_ne<sizeof(char), sizeof(target_char_t) >::value, // target type is based on wide character
+ ndnboost::type_traits::ice_not<
+ ndnboost::detail::is_char_or_wchar<no_cv_src>::value // single character widening is optimized
+ >::value // and does not requires stringbuffer
+ > is_string_widening_required_t;
+
+ typedef ndnboost::type_traits::ice_not< ndnboost::type_traits::ice_or<
+ ndnboost::is_integral<no_cv_src>::value,
+ ndnboost::detail::is_this_float_conversion_optimized<no_cv_src, char_type >::value,
+ ndnboost::detail::is_char_or_wchar<
+ BOOST_DEDUCED_TYPENAME deduce_src_char_metafunc::stage1_type // if we did not get character type at stage1
+ >::value // then we have no optimization for that type
+ >::value > is_source_input_not_optimized_t;
+
+ // If we have an optimized conversion for
+ // Source, we do not need to construct stringbuf.
+ BOOST_STATIC_CONSTANT(bool, requires_stringbuf =
+ (ndnboost::type_traits::ice_or<
+ is_string_widening_required_t::value, is_source_input_not_optimized_t::value
+ >::value)
+ );
+
+ typedef ndnboost::detail::lcast_src_length<no_cv_src> len_t;
+ };
+ }
+
+ namespace detail // '0', '+' and '-' constants
+ {
+ template < typename Char > struct lcast_char_constants;
+
+ template<>
+ struct lcast_char_constants<char>
+ {
+ BOOST_STATIC_CONSTANT(char, zero = '0');
+ BOOST_STATIC_CONSTANT(char, minus = '-');
+ BOOST_STATIC_CONSTANT(char, plus = '+');
+ BOOST_STATIC_CONSTANT(char, lowercase_e = 'e');
+ BOOST_STATIC_CONSTANT(char, capital_e = 'E');
+ BOOST_STATIC_CONSTANT(char, c_decimal_separator = '.');
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<>
+ struct lcast_char_constants<wchar_t>
+ {
+ BOOST_STATIC_CONSTANT(wchar_t, zero = L'0');
+ BOOST_STATIC_CONSTANT(wchar_t, minus = L'-');
+ BOOST_STATIC_CONSTANT(wchar_t, plus = L'+');
+ BOOST_STATIC_CONSTANT(wchar_t, lowercase_e = L'e');
+ BOOST_STATIC_CONSTANT(wchar_t, capital_e = L'E');
+ BOOST_STATIC_CONSTANT(wchar_t, c_decimal_separator = L'.');
+ };
+#endif
+
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ template<>
+ struct lcast_char_constants<char16_t>
+ {
+ BOOST_STATIC_CONSTANT(char16_t, zero = u'0');
+ BOOST_STATIC_CONSTANT(char16_t, minus = u'-');
+ BOOST_STATIC_CONSTANT(char16_t, plus = u'+');
+ BOOST_STATIC_CONSTANT(char16_t, lowercase_e = u'e');
+ BOOST_STATIC_CONSTANT(char16_t, capital_e = u'E');
+ BOOST_STATIC_CONSTANT(char16_t, c_decimal_separator = u'.');
+ };
+#endif
+
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ template<>
+ struct lcast_char_constants<char32_t>
+ {
+ BOOST_STATIC_CONSTANT(char32_t, zero = U'0');
+ BOOST_STATIC_CONSTANT(char32_t, minus = U'-');
+ BOOST_STATIC_CONSTANT(char32_t, plus = U'+');
+ BOOST_STATIC_CONSTANT(char32_t, lowercase_e = U'e');
+ BOOST_STATIC_CONSTANT(char32_t, capital_e = U'E');
+ BOOST_STATIC_CONSTANT(char32_t, c_decimal_separator = U'.');
+ };
+#endif
+ }
+
+ namespace detail // lcast_to_unsigned
+ {
+ template<class T>
+ inline
+ BOOST_DEDUCED_TYPENAME make_unsigned<T>::type lcast_to_unsigned(T value) BOOST_NOEXCEPT
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::make_unsigned<T>::type result_type;
+ return static_cast<result_type>(
+ value < 0 ? 0u - static_cast<result_type>(value) : value
+ );
+ }
+ }
+
+ namespace detail // lcast_put_unsigned
+ {
+ template<class Traits, class T, class CharT>
+ CharT* lcast_put_unsigned(const T n_param, CharT* finish)
+ {
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+#endif
+
+ typedef typename Traits::int_type int_type;
+ CharT const czero = lcast_char_constants<CharT>::zero;
+ int_type const zero = Traits::to_int_type(czero);
+ BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ (sizeof(int_type) > sizeof(T))
+ , int_type
+ , T
+ >::type n = n_param;
+
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ std::locale loc;
+ if (loc != std::locale::classic()) {
+ typedef std::numpunct<CharT> numpunct;
+ numpunct const& np = BOOST_USE_FACET(numpunct, loc);
+ std::string const grouping = np.grouping();
+ std::string::size_type const grouping_size = grouping.size();
+
+ if ( grouping_size && grouping[0] > 0 )
+ {
+
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ // Check that ulimited group is unreachable:
+ BOOST_STATIC_ASSERT(std::numeric_limits<T>::digits10 < CHAR_MAX);
+#endif
+ CharT thousands_sep = np.thousands_sep();
+ std::string::size_type group = 0; // current group number
+ char last_grp_size = grouping[0];
+ char left = last_grp_size;
+
+ do
+ {
+ if(left == 0)
+ {
+ ++group;
+ if(group < grouping_size)
+ {
+ char const grp_size = grouping[group];
+ last_grp_size = grp_size <= 0 ? static_cast<char>(CHAR_MAX) : grp_size;
+ }
+
+ left = last_grp_size;
+ --finish;
+ Traits::assign(*finish, thousands_sep);
+ }
+
+ --left;
+
+ --finish;
+ int_type const digit = static_cast<int_type>(n % 10U);
+ Traits::assign(*finish, Traits::to_char_type(zero + digit));
+ n /= 10;
+ } while(n);
+ return finish;
+ }
+ }
+#endif
+ {
+ do
+ {
+ --finish;
+ int_type const digit = static_cast<int_type>(n % 10U);
+ Traits::assign(*finish, Traits::to_char_type(zero + digit));
+ n /= 10;
+ } while(n);
+ }
+
+ return finish;
+ }
+ }
+
+ namespace detail // lcast_ret_unsigned
+ {
+ template<class Traits, class T, class CharT>
+ inline bool lcast_ret_unsigned(T& value, const CharT* const begin, const CharT* end)
+ {
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+#endif
+ CharT const czero = lcast_char_constants<CharT>::zero;
+ --end;
+ value = 0;
+
+ if (begin > end || *end < czero || *end >= czero + 10)
+ return false;
+ value = static_cast<T>(*end - czero);
+ --end;
+ T multiplier = 1;
+ bool multiplier_overflowed = false;
+
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ std::locale loc;
+ if (loc != std::locale::classic()) {
+ typedef std::numpunct<CharT> numpunct;
+ numpunct const& np = BOOST_USE_FACET(numpunct, loc);
+ std::string const& grouping = np.grouping();
+ std::string::size_type const grouping_size = grouping.size();
+
+ /* According to Programming languages - C++
+ * we MUST check for correct grouping
+ */
+ if (grouping_size && grouping[0] > 0)
+ {
+ unsigned char current_grouping = 0;
+ CharT const thousands_sep = np.thousands_sep();
+ char remained = static_cast<char>(grouping[current_grouping] - 1);
+ bool shall_we_return = true;
+
+ for(;end>=begin; --end)
+ {
+ if (remained) {
+ T const multiplier_10 = static_cast<T>(multiplier * 10);
+ if (multiplier_10 / 10 != multiplier) multiplier_overflowed = true;
+
+ T const dig_value = static_cast<T>(*end - czero);
+ T const new_sub_value = static_cast<T>(multiplier_10 * dig_value);
+
+ if (*end < czero || *end >= czero + 10
+ /* detecting overflow */
+ || (dig_value && new_sub_value / dig_value != multiplier_10)
+ || static_cast<T>((std::numeric_limits<T>::max)()-new_sub_value) < value
+ || (multiplier_overflowed && dig_value)
+ )
+ return false;
+
+ value = static_cast<T>(value + new_sub_value);
+ multiplier = static_cast<T>(multiplier * 10);
+ --remained;
+ } else {
+ if ( !Traits::eq(*end, thousands_sep) ) //|| begin == end ) return false;
+ {
+ /*
+ * According to Programming languages - C++
+ * Digit grouping is checked. That is, the positions of discarded
+ * separators is examined for consistency with
+ * use_facet<numpunct<charT> >(loc ).grouping()
+ *
+ * BUT what if there is no separators at all and grouping()
+ * is not empty? Well, we have no extraced separators, so we
+ * won`t check them for consistency. This will allow us to
+ * work with "C" locale from other locales
+ */
+ shall_we_return = false;
+ break;
+ } else {
+ if ( begin == end ) return false;
+ if (current_grouping < grouping_size-1 ) ++current_grouping;
+ remained = grouping[current_grouping];
+ }
+ }
+ }
+
+ if (shall_we_return) return true;
+ }
+ }
+#endif
+ {
+ while ( begin <= end )
+ {
+ T const multiplier_10 = static_cast<T>(multiplier * 10);
+ if (multiplier_10 / 10 != multiplier) multiplier_overflowed = true;
+
+ T const dig_value = static_cast<T>(*end - czero);
+ T const new_sub_value = static_cast<T>(multiplier_10 * dig_value);
+
+ if (*end < czero || *end >= czero + 10
+ /* detecting overflow */
+ || (dig_value && new_sub_value / dig_value != multiplier_10)
+ || static_cast<T>((std::numeric_limits<T>::max)()-new_sub_value) < value
+ || (multiplier_overflowed && dig_value)
+ )
+ return false;
+
+ value = static_cast<T>(value + new_sub_value);
+ multiplier = static_cast<T>(multiplier * 10);
+ --end;
+ }
+ }
+ return true;
+ }
+ }
+
+ namespace detail
+ {
+ template <class CharT>
+ bool lc_iequal(const CharT* val, const CharT* lcase, const CharT* ucase, unsigned int len) BOOST_NOEXCEPT {
+ for( unsigned int i=0; i < len; ++i ) {
+ if ( val[i] != lcase[i] && val[i] != ucase[i] ) return false;
+ }
+
+ return true;
+ }
+
+ /* Returns true and sets the correct value if found NaN or Inf. */
+ template <class CharT, class T>
+ inline bool parse_inf_nan_impl(const CharT* begin, const CharT* end, T& value
+ , const CharT* lc_NAN, const CharT* lc_nan
+ , const CharT* lc_INFINITY, const CharT* lc_infinity
+ , const CharT opening_brace, const CharT closing_brace) BOOST_NOEXCEPT
+ {
+ using namespace std;
+ if (begin == end) return false;
+ const CharT minus = lcast_char_constants<CharT>::minus;
+ const CharT plus = lcast_char_constants<CharT>::plus;
+ const int inifinity_size = 8;
+
+ bool has_minus = false;
+ /* Parsing +/- */
+ if( *begin == minus)
+ {
+ ++ begin;
+ has_minus = true;
+ }
+ else if( *begin == plus ) ++begin;
+
+ if( end-begin < 3 ) return false;
+ if( lc_iequal(begin, lc_nan, lc_NAN, 3) )
+ {
+ begin += 3;
+ if (end != begin) /* It is 'nan(...)' or some bad input*/
+ {
+ if(end-begin<2) return false; // bad input
+ -- end;
+ if( *begin != opening_brace || *end != closing_brace) return false; // bad input
+ }
+
+ if( !has_minus ) value = std::numeric_limits<T>::quiet_NaN();
+ else value = (ndnboost::math::changesign) (std::numeric_limits<T>::quiet_NaN());
+ return true;
+ } else
+ if (( /* 'INF' or 'inf' */
+ end-begin==3
+ &&
+ lc_iequal(begin, lc_infinity, lc_INFINITY, 3)
+ )
+ ||
+ ( /* 'INFINITY' or 'infinity' */
+ end-begin==inifinity_size
+ &&
+ lc_iequal(begin, lc_infinity, lc_INFINITY, inifinity_size)
+ )
+ )
+ {
+ if( !has_minus ) value = std::numeric_limits<T>::infinity();
+ else value = (ndnboost::math::changesign) (std::numeric_limits<T>::infinity());
+ return true;
+ }
+
+ return false;
+ }
+
+ template <class CharT, class T>
+ bool put_inf_nan_impl(CharT* begin, CharT*& end, const T& value
+ , const CharT* lc_nan
+ , const CharT* lc_infinity) BOOST_NOEXCEPT
+ {
+ using namespace std;
+ const CharT minus = lcast_char_constants<CharT>::minus;
+ if ( (ndnboost::math::isnan)(value) )
+ {
+ if ( (ndnboost::math::signbit)(value) )
+ {
+ *begin = minus;
+ ++ begin;
+ }
+
+ memcpy(begin, lc_nan, 3 * sizeof(CharT));
+ end = begin + 3;
+ return true;
+ } else if ( (ndnboost::math::isinf)(value) )
+ {
+ if ( (ndnboost::math::signbit)(value) )
+ {
+ *begin = minus;
+ ++ begin;
+ }
+
+ memcpy(begin, lc_infinity, 3 * sizeof(CharT));
+ end = begin + 3;
+ return true;
+ }
+
+ return false;
+ }
+
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template <class T>
+ bool parse_inf_nan(const wchar_t* begin, const wchar_t* end, T& value) BOOST_NOEXCEPT
+ {
+ return parse_inf_nan_impl(begin, end, value
+ , L"NAN", L"nan"
+ , L"INFINITY", L"infinity"
+ , L'(', L')');
+ }
+
+ template <class T>
+ bool put_inf_nan(wchar_t* begin, wchar_t*& end, const T& value) BOOST_NOEXCEPT
+ {
+ return put_inf_nan_impl(begin, end, value, L"nan", L"infinity");
+ }
+
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ template <class T>
+ bool parse_inf_nan(const char16_t* begin, const char16_t* end, T& value) BOOST_NOEXCEPT
+ {
+ return parse_inf_nan_impl(begin, end, value
+ , u"NAN", u"nan"
+ , u"INFINITY", u"infinity"
+ , u'(', u')');
+ }
+
+ template <class T>
+ bool put_inf_nan(char16_t* begin, char16_t*& end, const T& value) BOOST_NOEXCEPT
+ {
+ return put_inf_nan_impl(begin, end, value, u"nan", u"infinity");
+ }
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ template <class T>
+ bool parse_inf_nan(const char32_t* begin, const char32_t* end, T& value) BOOST_NOEXCEPT
+ {
+ return parse_inf_nan_impl(begin, end, value
+ , U"NAN", U"nan"
+ , U"INFINITY", U"infinity"
+ , U'(', U')');
+ }
+
+ template <class T>
+ bool put_inf_nan(char32_t* begin, char32_t*& end, const T& value) BOOST_NOEXCEPT
+ {
+ return put_inf_nan_impl(begin, end, value, U"nan", U"infinity");
+ }
+#endif
+
+ template <class CharT, class T>
+ bool parse_inf_nan(const CharT* begin, const CharT* end, T& value) BOOST_NOEXCEPT
+ {
+ return parse_inf_nan_impl(begin, end, value
+ , "NAN", "nan"
+ , "INFINITY", "infinity"
+ , '(', ')');
+ }
+
+ template <class CharT, class T>
+ bool put_inf_nan(CharT* begin, CharT*& end, const T& value) BOOST_NOEXCEPT
+ {
+ return put_inf_nan_impl(begin, end, value, "nan", "infinity");
+ }
+ }
+
+
+ namespace detail // lcast_ret_float
+ {
+
+// Silence buggy MS warnings like C4244: '+=' : conversion from 'int' to 'unsigned short', possible loss of data
+#if defined(_MSC_VER) && (_MSC_VER == 1400)
+# pragma warning(push)
+# pragma warning(disable:4244)
+#endif
+ template <class T>
+ struct mantissa_holder_type
+ {
+ /* Can not be used with this type */
+ };
+
+ template <>
+ struct mantissa_holder_type<float>
+ {
+ typedef unsigned int type;
+ typedef double wide_result_t;
+ };
+
+ template <>
+ struct mantissa_holder_type<double>
+ {
+#ifndef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ typedef long double wide_result_t;
+#if defined(BOOST_HAS_LONG_LONG)
+ typedef ndnboost::ulong_long_type type;
+#elif defined(BOOST_HAS_MS_INT64)
+ typedef unsigned __int64 type;
+#endif
+#endif
+ };
+
+ template<class Traits, class T, class CharT>
+ inline bool lcast_ret_float(T& value, const CharT* begin, const CharT* end)
+ {
+
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ std::locale loc;
+ typedef std::numpunct<CharT> numpunct;
+ numpunct const& np = BOOST_USE_FACET(numpunct, loc);
+ std::string const grouping(
+ (loc == std::locale::classic())
+ ? std::string()
+ : np.grouping()
+ );
+ std::string::size_type const grouping_size = grouping.size();
+ CharT const thousands_sep = static_cast<CharT>(grouping_size ? np.thousands_sep() : 0);
+ CharT const decimal_point = np.decimal_point();
+ bool found_grouping = false;
+ std::string::size_type last_grouping_pos = grouping_size - 1;
+#else
+ CharT const decimal_point = lcast_char_constants<CharT>::c_decimal_separator;
+#endif
+
+ CharT const czero = lcast_char_constants<CharT>::zero;
+ CharT const minus = lcast_char_constants<CharT>::minus;
+ CharT const plus = lcast_char_constants<CharT>::plus;
+ CharT const capital_e = lcast_char_constants<CharT>::capital_e;
+ CharT const lowercase_e = lcast_char_constants<CharT>::lowercase_e;
+
+ value = static_cast<T>(0);
+
+ if (parse_inf_nan(begin, end, value)) return true;
+
+ typedef typename Traits::int_type int_type;
+ typedef BOOST_DEDUCED_TYPENAME mantissa_holder_type<T>::type mantissa_type;
+ typedef BOOST_DEDUCED_TYPENAME mantissa_holder_type<T>::wide_result_t wide_result_t;
+ int_type const zero = Traits::to_int_type(czero);
+ if (begin == end) return false;
+
+ /* Getting the plus/minus sign */
+ bool has_minus = false;
+ if (Traits::eq(*begin, minus) ) {
+ ++ begin;
+ has_minus = true;
+ if (begin == end) return false;
+ } else if (Traits::eq(*begin, plus) ) {
+ ++begin;
+ if (begin == end) return false;
+ }
+
+ bool found_decimal = false;
+ bool found_number_before_exp = false;
+ int pow_of_10 = 0;
+ mantissa_type mantissa=0;
+ bool is_mantissa_full = false;
+
+ char length_since_last_delim = 0;
+
+ while ( begin != end )
+ {
+ if (found_decimal) {
+ /* We allow no thousand_separators after decimal point */
+
+ mantissa_type tmp_mantissa = mantissa * 10u;
+ if (Traits::eq(*begin, lowercase_e) || Traits::eq(*begin, capital_e)) break;
+ if ( *begin < czero || *begin >= czero + 10 ) return false;
+ if ( is_mantissa_full
+ || tmp_mantissa / 10u != mantissa
+ || (std::numeric_limits<mantissa_type>::max)()-(*begin - zero) < tmp_mantissa
+ ) {
+ is_mantissa_full = true;
+ ++ begin;
+ continue;
+ }
+
+ -- pow_of_10;
+ mantissa = tmp_mantissa;
+ mantissa += *begin - zero;
+
+ found_number_before_exp = true;
+ } else {
+
+ if (*begin >= czero && *begin < czero + 10) {
+
+ /* Checking for mantissa overflow. If overflow will
+ * occur, them we only increase multiplyer
+ */
+ mantissa_type tmp_mantissa = mantissa * 10u;
+ if( !is_mantissa_full
+ && tmp_mantissa / 10u == mantissa
+ && (std::numeric_limits<mantissa_type>::max)()-(*begin - zero) >= tmp_mantissa
+ )
+ {
+ mantissa = tmp_mantissa;
+ mantissa += *begin - zero;
+ } else
+ {
+ is_mantissa_full = true;
+ ++ pow_of_10;
+ }
+
+ found_number_before_exp = true;
+ ++ length_since_last_delim;
+ } else if (Traits::eq(*begin, decimal_point) || Traits::eq(*begin, lowercase_e) || Traits::eq(*begin, capital_e)) {
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ /* If ( we need to check grouping
+ * and ( grouping missmatches
+ * or grouping position is incorrect
+ * or we are using the grouping position 0 twice
+ * )
+ * ) then return error
+ */
+ if( grouping_size && found_grouping
+ && (
+ length_since_last_delim != grouping[0]
+ || last_grouping_pos>1
+ || (last_grouping_pos==0 && grouping_size>1)
+ )
+ ) return false;
+#endif
+
+ if(Traits::eq(*begin, decimal_point)) {
+ ++ begin;
+ found_decimal = true;
+ if (!found_number_before_exp && begin==end) return false;
+ continue;
+ }else {
+ if (!found_number_before_exp) return false;
+ break;
+ }
+ }
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ else if (grouping_size && Traits::eq(*begin, thousands_sep)){
+ if(found_grouping)
+ {
+ /* It is not he first time, when we find thousands separator,
+ * so we need to chek, is the distance between two groupings
+ * equal to grouping[last_grouping_pos] */
+
+ if (length_since_last_delim != grouping[last_grouping_pos] )
+ {
+ if (!last_grouping_pos) return false;
+ else
+ {
+ -- last_grouping_pos;
+ if (length_since_last_delim != grouping[last_grouping_pos]) return false;
+ }
+ } else
+ /* We are calling the grouping[0] twice, when grouping size is more than 1 */
+ if (grouping_size>1u && last_grouping_pos+1<grouping_size) return false;
+
+ } else {
+ /* Delimiter at the begining ',000' */
+ if (!length_since_last_delim) return false;
+
+ found_grouping = true;
+ if (length_since_last_delim > grouping[last_grouping_pos] ) return false;
+ }
+
+ length_since_last_delim = 0;
+ ++ begin;
+
+ /* Delimiter at the end '100,' */
+ if (begin == end) return false;
+ continue;
+ }
+#endif
+ else return false;
+ }
+
+ ++begin;
+ }
+
+ // Exponent found
+ if ( begin != end && (Traits::eq(*begin, lowercase_e) || Traits::eq(*begin, capital_e)) ) {
+ ++ begin;
+ if ( begin == end ) return false;
+
+ bool exp_has_minus = false;
+ if(Traits::eq(*begin, minus)) {
+ exp_has_minus = true;
+ ++ begin;
+ if ( begin == end ) return false;
+ } else if (Traits::eq(*begin, plus)) {
+ ++ begin;
+ if ( begin == end ) return false;
+ }
+
+ int exp_pow_of_10 = 0;
+ while ( begin != end )
+ {
+ if ( *begin < czero
+ || *begin >= czero + 10
+ || exp_pow_of_10 * 10 < exp_pow_of_10) /* Overflows are checked lower more precisely*/
+ return false;
+
+ exp_pow_of_10 *= 10;
+ exp_pow_of_10 += *begin - zero;
+ ++ begin;
+ };
+
+ if ( exp_pow_of_10 ) {
+ /* Overflows are checked lower */
+ if ( exp_has_minus ) {
+ pow_of_10 -= exp_pow_of_10;
+ } else {
+ pow_of_10 += exp_pow_of_10;
+ }
+ }
+ }
+
+ /* We need a more accurate algorithm... We can not use current algorithm
+ * with long doubles (and with doubles if sizeof(double)==sizeof(long double)).
+ */
+ const wide_result_t result = std::pow(static_cast<wide_result_t>(10.0), pow_of_10) * mantissa;
+ value = static_cast<T>( has_minus ? (ndnboost::math::changesign)(result) : result);
+
+ if ( (ndnboost::math::isinf)(value) || (ndnboost::math::isnan)(value) ) return false;
+
+ return true;
+ }
+// Unsilence buggy MS warnings like C4244: '+=' : conversion from 'int' to 'unsigned short', possible loss of data
+#if defined(_MSC_VER) && (_MSC_VER == 1400)
+# pragma warning(pop)
+#endif
+ }
+
+ namespace detail // parser_buf
+ {
+ //
+ // class parser_buf:
+ // acts as a stream buffer which wraps around a pair of pointers
+ //
+ // This class is copied (and slightly changed) from
+ // boost/regex/v4/cpp_regex_traits.hpp
+ // Thanks John Maddock for it! (previous version had some
+ // problems with libc++ and some other STL implementations)
+ template <class BufferType, class charT>
+ class parser_buf : public BufferType {
+ typedef BufferType base_type;
+ typedef typename base_type::int_type int_type;
+ typedef typename base_type::char_type char_type;
+ typedef typename base_type::pos_type pos_type;
+ typedef ::std::streamsize streamsize;
+ typedef typename base_type::off_type off_type;
+
+ public:
+ parser_buf() : base_type() { setbuf(0, 0); }
+ const charT* getnext() { return this->gptr(); }
+#ifndef BOOST_NO_USING_TEMPLATE
+ using base_type::pptr;
+ using base_type::pbase;
+#else
+ charT* pptr() const { return base_type::pptr(); }
+ charT* pbase() const { return base_type::pbase(); }
+#endif
+ base_type* setbuf(char_type* s, streamsize n) {
+ this->setg(s, s, s + n);
+ return this;
+ }
+
+ pos_type seekpos(pos_type sp, ::std::ios_base::openmode which) {
+ if(which & ::std::ios_base::out)
+ return pos_type(off_type(-1));
+ off_type size = static_cast<off_type>(this->egptr() - this->eback());
+ charT* g = this->eback();
+ if(off_type(sp) <= size)
+ {
+ this->setg(g, g + off_type(sp), g + size);
+ }
+ return pos_type(off_type(-1));
+ }
+
+ pos_type seekoff(off_type off, ::std::ios_base::seekdir way, ::std::ios_base::openmode which) {
+ typedef typename ndnboost::int_t<sizeof(way) * CHAR_BIT>::least cast_type;
+
+ if(which & ::std::ios_base::out)
+ return pos_type(off_type(-1));
+ std::ptrdiff_t size = this->egptr() - this->eback();
+ std::ptrdiff_t pos = this->gptr() - this->eback();
+ charT* g = this->eback();
+ switch(static_cast<cast_type>(way))
+ {
+ case ::std::ios_base::beg:
+ if((off < 0) || (off > size))
+ return pos_type(off_type(-1));
+ else
+ this->setg(g, g + off, g + size);
+ break;
+ case ::std::ios_base::end:
+ if((off < 0) || (off > size))
+ return pos_type(off_type(-1));
+ else
+ this->setg(g, g + size - off, g + size);
+ break;
+ case ::std::ios_base::cur:
+ {
+ std::ptrdiff_t newpos = static_cast<std::ptrdiff_t>(pos + off);
+ if((newpos < 0) || (newpos > size))
+ return pos_type(off_type(-1));
+ else
+ this->setg(g, g + newpos, g + size);
+ break;
+ }
+ default: ;
+ }
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4244)
+#endif
+ return static_cast<pos_type>(this->gptr() - this->eback());
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+ }
+ private:
+ parser_buf& operator=(const parser_buf&);
+ parser_buf(const parser_buf&);
+ };
+ }
+
+ namespace detail
+ {
+ struct do_not_construct_out_stream_t{};
+ }
+
+ namespace detail // optimized stream wrapper
+ {
+ // String representation of Source has an upper limit.
+ template< class CharT // a result of widest_char transformation
+ , class Traits // usually char_traits<CharT>
+ , bool RequiresStringbuffer
+ >
+ class lexical_stream_limited_src
+ {
+
+#if defined(BOOST_NO_STRINGSTREAM)
+ typedef std::ostrstream out_stream_t;
+#elif defined(BOOST_NO_STD_LOCALE)
+ typedef std::ostringstream out_stream_t;
+ typedef parser_buf<std::streambuf, char> buffer_t;
+#else
+ typedef std::basic_ostringstream<CharT, Traits> out_stream_t;
+ typedef parser_buf<std::basic_streambuf<CharT, Traits>, CharT> buffer_t;
+#endif
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ RequiresStringbuffer,
+ out_stream_t,
+ do_not_construct_out_stream_t
+ >::type deduced_out_stream_t;
+
+ // A string representation of Source is written to [start, finish).
+ CharT* start;
+ CharT* finish;
+ deduced_out_stream_t out_stream;
+
+ public:
+ lexical_stream_limited_src(CharT* sta, CharT* fin) BOOST_NOEXCEPT
+ : start(sta)
+ , finish(fin)
+ {}
+
+ private:
+ // Undefined:
+ lexical_stream_limited_src(lexical_stream_limited_src const&);
+ void operator=(lexical_stream_limited_src const&);
+
+/************************************ HELPER FUNCTIONS FOR OPERATORS << ( ... ) ********************************/
+ bool shl_char(CharT ch) BOOST_NOEXCEPT
+ {
+ Traits::assign(*start, ch);
+ finish = start + 1;
+ return true;
+ }
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template <class T>
+ bool shl_char(T ch)
+ {
+ BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)) ,
+ "ndnboost::lexical_cast does not support narrowing of char types."
+ "Use ndnboost::locale instead" );
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ std::locale loc;
+ CharT const w = BOOST_USE_FACET(std::ctype<CharT>, loc).widen(ch);
+#else
+ CharT const w = static_cast<CharT>(ch);
+#endif
+ Traits::assign(*start, w);
+ finish = start + 1;
+ return true;
+ }
+#endif
+
+ bool shl_char_array(CharT const* str) BOOST_NOEXCEPT
+ {
+ start = const_cast<CharT*>(str);
+ finish = start + Traits::length(str);
+ return true;
+ }
+
+ template <class T>
+ bool shl_char_array(T const* str)
+ {
+ BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)),
+ "ndnboost::lexical_cast does not support narrowing of char types."
+ "Use ndnboost::locale instead" );
+ return shl_input_streamable(str);
+ }
+
+ bool shl_char_array_limited(CharT const* str, std::size_t max_size) BOOST_NOEXCEPT
+ {
+ start = const_cast<CharT*>(str);
+ finish = std::find(start, start + max_size, Traits::to_char_type(0));
+ return true;
+ }
+
+ template<typename InputStreamable>
+ bool shl_input_streamable(InputStreamable& input)
+ {
+#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE)
+ // If you have compilation error at this point, than your STL library
+ // does not support such conversions. Try updating it.
+ BOOST_STATIC_ASSERT((ndnboost::is_same<char, CharT>::value));
+#endif
+ bool const result = !(out_stream << input).fail();
+ const buffer_t* const p = static_cast<buffer_t*>(
+ static_cast<std::basic_streambuf<CharT, Traits>*>(out_stream.rdbuf())
+ );
+ start = p->pbase();
+ finish = p->pptr();
+ return result;
+ }
+
+ template <class T>
+ inline bool shl_signed(T n)
+ {
+ start = lcast_put_unsigned<Traits>(lcast_to_unsigned(n), finish);
+ if(n < 0)
+ {
+ --start;
+ CharT const minus = lcast_char_constants<CharT>::minus;
+ Traits::assign(*start, minus);
+ }
+ return true;
+ }
+
+ template <class T, class SomeCharT>
+ bool shl_real_type(const T& val, SomeCharT* begin, SomeCharT*& end)
+ {
+ if (put_inf_nan(begin, end, val)) return true;
+ lcast_set_precision(out_stream, &val);
+ return shl_input_streamable(val);
+ }
+
+ static bool shl_real_type(float val, char* begin, char*& end)
+ { using namespace std;
+ if (put_inf_nan(begin, end, val)) return true;
+ const double val_as_double = val;
+ end = begin +
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+ sprintf_s(begin, end-begin,
+#else
+ sprintf(begin,
+#endif
+ "%.*g", static_cast<int>(ndnboost::detail::lcast_get_precision<float>()), val_as_double);
+ return end > begin;
+ }
+
+ static bool shl_real_type(double val, char* begin, char*& end)
+ { using namespace std;
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin +
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+ sprintf_s(begin, end-begin,
+#else
+ sprintf(begin,
+#endif
+ "%.*g", static_cast<int>(ndnboost::detail::lcast_get_precision<double>()), val);
+ return end > begin;
+ }
+
+#ifndef __MINGW32__
+ static bool shl_real_type(long double val, char* begin, char*& end)
+ { using namespace std;
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin +
+#if defined(_MSC_VER) && (_MSC_VER >= 1400) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)
+ sprintf_s(begin, end-begin,
+#else
+ sprintf(begin,
+#endif
+ "%.*Lg", static_cast<int>(ndnboost::detail::lcast_get_precision<long double>()), val );
+ return end > begin;
+ }
+#endif
+
+
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_SWPRINTF) && !defined(__MINGW32__)
+ static bool shl_real_type(float val, wchar_t* begin, wchar_t*& end)
+ { using namespace std;
+ if (put_inf_nan(begin, end, val)) return true;
+ const double val_as_double = val;
+ end = begin + swprintf(begin, end-begin,
+ L"%.*g",
+ static_cast<int>(ndnboost::detail::lcast_get_precision<float >()),
+ val_as_double );
+ return end > begin;
+ }
+
+ static bool shl_real_type(double val, wchar_t* begin, wchar_t*& end)
+ { using namespace std;
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin + swprintf(begin, end-begin,
+ L"%.*g", static_cast<int>(ndnboost::detail::lcast_get_precision<double >()), val );
+ return end > begin;
+ }
+
+ static bool shl_real_type(long double val, wchar_t* begin, wchar_t*& end)
+ { using namespace std;
+ if (put_inf_nan(begin, end, val)) return true;
+ end = begin + swprintf(begin, end-begin,
+ L"%.*Lg", static_cast<int>(ndnboost::detail::lcast_get_precision<long double >()), val );
+ return end > begin;
+ }
+#endif
+
+/************************************ OPERATORS << ( ... ) ********************************/
+ public:
+ template<class Alloc>
+ bool operator<<(std::basic_string<CharT,Traits,Alloc> const& str) BOOST_NOEXCEPT
+ {
+ start = const_cast<CharT*>(str.data());
+ finish = start + str.length();
+ return true;
+ }
+
+ template<class Alloc>
+ bool operator<<(ndnboost::container::basic_string<CharT,Traits,Alloc> const& str) BOOST_NOEXCEPT
+ {
+ start = const_cast<CharT*>(str.data());
+ finish = start + str.length();
+ return true;
+ }
+
+ bool operator<<(bool value) BOOST_NOEXCEPT
+ {
+ CharT const czero = lcast_char_constants<CharT>::zero;
+ Traits::assign(*start, Traits::to_char_type(czero + value));
+ finish = start + 1;
+ return true;
+ }
+
+ bool operator<<(const iterator_range<CharT*>& rng) BOOST_NOEXCEPT
+ {
+ start = rng.begin();
+ finish = rng.end();
+ return true;
+ }
+
+ bool operator<<(const iterator_range<const CharT*>& rng) BOOST_NOEXCEPT
+ {
+ start = const_cast<CharT*>(rng.begin());
+ finish = const_cast<CharT*>(rng.end());
+ return true;
+ }
+
+ bool operator<<(const iterator_range<const signed char*>& rng) BOOST_NOEXCEPT
+ {
+ return (*this) << iterator_range<char*>(
+ const_cast<char*>(reinterpret_cast<const char*>(rng.begin())),
+ const_cast<char*>(reinterpret_cast<const char*>(rng.end()))
+ );
+ }
+
+ bool operator<<(const iterator_range<const unsigned char*>& rng) BOOST_NOEXCEPT
+ {
+ return (*this) << iterator_range<char*>(
+ const_cast<char*>(reinterpret_cast<const char*>(rng.begin())),
+ const_cast<char*>(reinterpret_cast<const char*>(rng.end()))
+ );
+ }
+
+ bool operator<<(const iterator_range<signed char*>& rng) BOOST_NOEXCEPT
+ {
+ return (*this) << iterator_range<char*>(
+ reinterpret_cast<char*>(rng.begin()),
+ reinterpret_cast<char*>(rng.end())
+ );
+ }
+
+ bool operator<<(const iterator_range<unsigned char*>& rng) BOOST_NOEXCEPT
+ {
+ return (*this) << iterator_range<char*>(
+ reinterpret_cast<char*>(rng.begin()),
+ reinterpret_cast<char*>(rng.end())
+ );
+ }
+
+ bool operator<<(char ch) { return shl_char(ch); }
+ bool operator<<(unsigned char ch) { return ((*this) << static_cast<char>(ch)); }
+ bool operator<<(signed char ch) { return ((*this) << static_cast<char>(ch)); }
+#if !defined(BOOST_LCAST_NO_WCHAR_T)
+ bool operator<<(wchar_t const* str) { return shl_char_array(str); }
+ bool operator<<(wchar_t * str) { return shl_char_array(str); }
+#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+ bool operator<<(wchar_t ch) { return shl_char(ch); }
+#endif
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ bool operator<<(char16_t ch) { return shl_char(ch); }
+ bool operator<<(char16_t * str) { return shl_char_array(str); }
+ bool operator<<(char16_t const * str) { return shl_char_array(str); }
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ bool operator<<(char32_t ch) { return shl_char(ch); }
+ bool operator<<(char32_t * str) { return shl_char_array(str); }
+ bool operator<<(char32_t const * str) { return shl_char_array(str); }
+#endif
+ bool operator<<(unsigned char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }
+ bool operator<<(unsigned char * ch) { return ((*this) << reinterpret_cast<char *>(ch)); }
+ bool operator<<(signed char const* ch) { return ((*this) << reinterpret_cast<char const*>(ch)); }
+ bool operator<<(signed char * ch) { return ((*this) << reinterpret_cast<char *>(ch)); }
+ bool operator<<(char const* str) { return shl_char_array(str); }
+ bool operator<<(char* str) { return shl_char_array(str); }
+ bool operator<<(short n) { return shl_signed(n); }
+ bool operator<<(int n) { return shl_signed(n); }
+ bool operator<<(long n) { return shl_signed(n); }
+ bool operator<<(unsigned short n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
+ bool operator<<(unsigned int n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
+ bool operator<<(unsigned long n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
+
+#if defined(BOOST_HAS_LONG_LONG)
+ bool operator<<(ndnboost::ulong_long_type n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
+ bool operator<<(ndnboost::long_long_type n) { return shl_signed(n); }
+#elif defined(BOOST_HAS_MS_INT64)
+ bool operator<<(unsigned __int64 n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
+ bool operator<<( __int64 n) { return shl_signed(n); }
+#endif
+
+#ifdef BOOST_LCAST_HAS_INT128
+ bool operator<<(const ndnboost::uint128_type& n) { start = lcast_put_unsigned<Traits>(n, finish); return true; }
+ bool operator<<(const ndnboost::int128_type& n) { return shl_signed(n); }
+#endif
+
+ bool operator<<(float val) { return shl_real_type(val, start, finish); }
+ bool operator<<(double val) { return shl_real_type(val, start, finish); }
+ bool operator<<(long double val) {
+#ifndef __MINGW32__
+ return shl_real_type(val, start, finish);
+#else
+ return shl_real_type(static_cast<double>(val), start, finish);
+#endif
+ }
+
+ template <std::size_t N>
+ bool operator<<(ndnboost::array<CharT, N> const& input) BOOST_NOEXCEPT
+ { return shl_char_array_limited(input.begin(), N); }
+
+ template <std::size_t N>
+ bool operator<<(ndnboost::array<unsigned char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(ndnboost::array<signed char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(ndnboost::array<const CharT, N> const& input) BOOST_NOEXCEPT
+ { return shl_char_array_limited(input.begin(), N); }
+
+ template <std::size_t N>
+ bool operator<<(ndnboost::array<const unsigned char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<const char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(ndnboost::array<const signed char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<const char, N> const& >(input)); }
+
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+ template <std::size_t N>
+ bool operator<<(std::array<CharT, N> const& input) BOOST_NOEXCEPT
+ {
+ if (input.size()) return shl_char_array_limited(&input[0], N);
+ else return true;
+ }
+
+ template <std::size_t N>
+ bool operator<<(std::array<unsigned char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<signed char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<const CharT, N> const& input) BOOST_NOEXCEPT
+ {
+ if (input.size()) return shl_char_array_limited(&input[0], N);
+ else return true;
+ }
+
+ template <std::size_t N>
+ bool operator<<(std::array<const unsigned char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<const char, N> const& >(input)); }
+
+ template <std::size_t N>
+ bool operator<<(std::array<const signed char, N> const& input) BOOST_NOEXCEPT
+ { return ((*this) << reinterpret_cast<ndnboost::array<const char, N> const& >(input)); }
+#endif
+
+ template <class InStreamable>
+ bool operator<<(const InStreamable& input) { return shl_input_streamable(input); }
+
+/************************************ HELPER FUNCTIONS FOR OPERATORS >> ( ... ) ********************************/
+ private:
+
+ template <typename Type>
+ bool shr_unsigned(Type& output)
+ {
+ if (start == finish) return false;
+ CharT const minus = lcast_char_constants<CharT>::minus;
+ CharT const plus = lcast_char_constants<CharT>::plus;
+ bool has_minus = false;
+
+ /* We won`t use `start' any more, so no need in decrementing it after */
+ if ( Traits::eq(minus,*start) )
+ {
+ ++start;
+ has_minus = true;
+ } else if ( Traits::eq( plus, *start ) )
+ {
+ ++start;
+ }
+
+ bool const succeed = lcast_ret_unsigned<Traits>(output, start, finish);
+
+ if (has_minus) {
+ output = static_cast<Type>(0u - output);
+ }
+
+ return succeed;
+ }
+
+ template <typename Type>
+ bool shr_signed(Type& output)
+ {
+ if (start == finish) return false;
+ CharT const minus = lcast_char_constants<CharT>::minus;
+ CharT const plus = lcast_char_constants<CharT>::plus;
+ typedef BOOST_DEDUCED_TYPENAME make_unsigned<Type>::type utype;
+ utype out_tmp =0;
+ bool has_minus = false;
+
+ /* We won`t use `start' any more, so no need in decrementing it after */
+ if ( Traits::eq(minus,*start) )
+ {
+ ++start;
+ has_minus = true;
+ } else if ( Traits::eq(plus, *start) )
+ {
+ ++start;
+ }
+
+ bool succeed = lcast_ret_unsigned<Traits>(out_tmp, start, finish);
+ if (has_minus) {
+ utype const comp_val = (static_cast<utype>(1) << std::numeric_limits<Type>::digits);
+ succeed = succeed && out_tmp<=comp_val;
+ output = static_cast<Type>(0u - out_tmp);
+ } else {
+ utype const comp_val = static_cast<utype>((std::numeric_limits<Type>::max)());
+ succeed = succeed && out_tmp<=comp_val;
+ output = out_tmp;
+ }
+ return succeed;
+ }
+
+ template<typename InputStreamable>
+ bool shr_using_base_class(InputStreamable& output)
+ {
+ BOOST_STATIC_ASSERT_MSG(
+ (!ndnboost::is_pointer<InputStreamable>::value),
+ "ndnboost::lexical_cast can not convert to pointers"
+ );
+
+#if defined(BOOST_NO_STRINGSTREAM) || defined(BOOST_NO_STD_LOCALE)
+ BOOST_STATIC_ASSERT_MSG((ndnboost::is_same<char, CharT>::value),
+ "ndnboost::lexical_cast can not convert, because your STL library does not "
+ "support such conversions. Try updating it."
+ );
+#endif
+
+#if defined(BOOST_NO_STRINGSTREAM)
+ std::istrstream stream(start, finish - start);
+#else
+
+ buffer_t buf;
+ buf.setbuf(start, finish - start);
+#if defined(BOOST_NO_STD_LOCALE)
+ std::istream stream(&buf);
+#else
+ std::basic_istream<CharT, Traits> stream(&buf);
+#endif // BOOST_NO_STD_LOCALE
+#endif // BOOST_NO_STRINGSTREAM
+
+ stream.unsetf(std::ios::skipws);
+ lcast_set_precision(stream, static_cast<InputStreamable*>(0));
+
+ return stream >> output &&
+ stream.get() ==
+#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING)
+ // GCC 2.9x lacks std::char_traits<>::eof().
+ // We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3
+ // configurations, which do provide std::char_traits<>::eof().
+
+ EOF;
+#else
+ Traits::eof();
+#endif
+ }
+
+ template<class T>
+ inline bool shr_xchar(T& output)
+ {
+ BOOST_STATIC_ASSERT_MSG(( sizeof(CharT) == sizeof(T) ),
+ "ndnboost::lexical_cast does not support narrowing of character types."
+ "Use ndnboost::locale instead" );
+ bool const ok = (finish - start == 1);
+ if (ok) {
+ CharT out;
+ Traits::assign(out, *start);
+ output = static_cast<T>(out);
+ }
+ return ok;
+ }
+
+/************************************ OPERATORS >> ( ... ) ********************************/
+ public:
+ bool operator>>(unsigned short& output) { return shr_unsigned(output); }
+ bool operator>>(unsigned int& output) { return shr_unsigned(output); }
+ bool operator>>(unsigned long int& output) { return shr_unsigned(output); }
+ bool operator>>(short& output) { return shr_signed(output); }
+ bool operator>>(int& output) { return shr_signed(output); }
+ bool operator>>(long int& output) { return shr_signed(output); }
+#if defined(BOOST_HAS_LONG_LONG)
+ bool operator>>(ndnboost::ulong_long_type& output) { return shr_unsigned(output); }
+ bool operator>>(ndnboost::long_long_type& output) { return shr_signed(output); }
+#elif defined(BOOST_HAS_MS_INT64)
+ bool operator>>(unsigned __int64& output) { return shr_unsigned(output); }
+ bool operator>>(__int64& output) { return shr_signed(output); }
+#endif
+
+#ifdef BOOST_LCAST_HAS_INT128
+ bool operator>>(ndnboost::uint128_type& output) { return shr_unsigned(output); }
+ bool operator>>(ndnboost::int128_type& output) { return shr_signed(output); }
+#endif
+
+ bool operator>>(char& output) { return shr_xchar(output); }
+ bool operator>>(unsigned char& output) { return shr_xchar(output); }
+ bool operator>>(signed char& output) { return shr_xchar(output); }
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ bool operator>>(wchar_t& output) { return shr_xchar(output); }
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR16_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ bool operator>>(char16_t& output) { return shr_xchar(output); }
+#endif
+#if !defined(BOOST_NO_CXX11_CHAR32_T) && !defined(BOOST_NO_CXX11_UNICODE_LITERALS)
+ bool operator>>(char32_t& output) { return shr_xchar(output); }
+#endif
+ template<class Alloc>
+ bool operator>>(std::basic_string<CharT,Traits,Alloc>& str) { str.assign(start, finish); return true; }
+
+ template<class Alloc>
+ bool operator>>(ndnboost::container::basic_string<CharT,Traits,Alloc>& str) { str.assign(start, finish); return true; }
+
+
+ private:
+ template <std::size_t N, class ArrayT>
+ bool shr_std_array(ArrayT& output) BOOST_NOEXCEPT
+ {
+ using namespace std;
+ const std::size_t size = finish - start;
+ if (size > N - 1) { // `-1` because we need to store \0 at the end
+ return false;
+ }
+
+ memcpy(&output[0], start, size * sizeof(CharT));
+ output[size] = Traits::to_char_type(0);
+ return true;
+ }
+
+ public:
+
+ template <std::size_t N>
+ bool operator>>(ndnboost::array<CharT, N>& output) BOOST_NOEXCEPT
+ {
+ return shr_std_array<N>(output);
+ }
+
+ template <std::size_t N>
+ bool operator>>(ndnboost::array<unsigned char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<ndnboost::array<char, N>& >(output));
+ }
+
+ template <std::size_t N>
+ bool operator>>(ndnboost::array<signed char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<ndnboost::array<char, N>& >(output));
+ }
+
+#ifndef BOOST_NO_CXX11_HDR_ARRAY
+ template <std::size_t N>
+ bool operator>>(std::array<CharT, N>& output) BOOST_NOEXCEPT
+ {
+ return shr_std_array<N>(output);
+ }
+
+ template <std::size_t N>
+ bool operator>>(std::array<unsigned char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<std::array<char, N>& >(output));
+ }
+
+ template <std::size_t N>
+ bool operator>>(std::array<signed char, N>& output)
+ {
+ return ((*this) >> reinterpret_cast<std::array<char, N>& >(output));
+ }
+#endif
+
+
+ /*
+ * case "-0" || "0" || "+0" : output = false; return true;
+ * case "1" || "+1": output = true; return true;
+ * default: return false;
+ */
+ bool operator>>(bool& output) BOOST_NOEXCEPT
+ {
+ CharT const zero = lcast_char_constants<CharT>::zero;
+ CharT const plus = lcast_char_constants<CharT>::plus;
+ CharT const minus = lcast_char_constants<CharT>::minus;
+
+ switch(finish-start)
+ {
+ case 1:
+ output = Traits::eq(start[0], zero+1);
+ return output || Traits::eq(start[0], zero );
+ case 2:
+ if ( Traits::eq( plus, *start) )
+ {
+ ++start;
+ output = Traits::eq(start[0], zero +1);
+ return output || Traits::eq(start[0], zero );
+ } else
+ {
+ output = false;
+ return Traits::eq( minus, *start)
+ && Traits::eq( zero, start[1]);
+ }
+ default:
+ output = false; // Suppress warning about uninitalized variable
+ return false;
+ }
+ }
+
+ bool operator>>(float& output) { return lcast_ret_float<Traits>(output,start,finish); }
+
+ private:
+ // Not optimised converter
+ template <class T>
+ bool float_types_converter_internal(T& output, int /*tag*/) {
+ if (parse_inf_nan(start, finish, output)) return true;
+ bool return_value = shr_using_base_class(output);
+
+ /* Some compilers and libraries successfully
+ * parse 'inf', 'INFINITY', '1.0E', '1.0E-'...
+ * We are trying to provide a unified behaviour,
+ * so we just forbid such conversions (as some
+ * of the most popular compilers/libraries do)
+ * */
+ CharT const minus = lcast_char_constants<CharT>::minus;
+ CharT const plus = lcast_char_constants<CharT>::plus;
+ CharT const capital_e = lcast_char_constants<CharT>::capital_e;
+ CharT const lowercase_e = lcast_char_constants<CharT>::lowercase_e;
+ if ( return_value &&
+ (
+ Traits::eq(*(finish-1), lowercase_e) // 1.0e
+ || Traits::eq(*(finish-1), capital_e) // 1.0E
+ || Traits::eq(*(finish-1), minus) // 1.0e- or 1.0E-
+ || Traits::eq(*(finish-1), plus) // 1.0e+ or 1.0E+
+ )
+ ) return false;
+
+ return return_value;
+ }
+
+ // Optimised converter
+ bool float_types_converter_internal(double& output,char /*tag*/) {
+ return lcast_ret_float<Traits>(output,start,finish);
+ }
+ public:
+
+ bool operator>>(double& output)
+ {
+ /*
+ * Some compilers implement long double as double. In that case these types have
+ * same size, same precision, same max and min values... And it means,
+ * that current implementation of lcast_ret_float cannot be used for type
+ * double, because it will give a big precision loss.
+ * */
+ ndnboost::mpl::if_c<
+#if (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+ ndnboost::type_traits::ice_eq< sizeof(double), sizeof(long double) >::value,
+#else
+ 1,
+#endif
+ int,
+ char
+ >::type tag = 0;
+
+ return float_types_converter_internal(output, tag);
+ }
+
+ bool operator>>(long double& output)
+ {
+ int tag = 0;
+ return float_types_converter_internal(output, tag);
+ }
+
+ // Generic istream-based algorithm.
+ // lcast_streambuf_for_target<InputStreamable>::value is true.
+ template<typename InputStreamable>
+ bool operator>>(InputStreamable& output) { return shr_using_base_class(output); }
+ };
+ }
+
+ namespace detail
+ {
+ template<typename T>
+ struct is_stdstring
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false );
+ };
+
+ template<typename CharT, typename Traits, typename Alloc>
+ struct is_stdstring< std::basic_string<CharT, Traits, Alloc> >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true );
+ };
+
+ template<typename CharT, typename Traits, typename Alloc>
+ struct is_stdstring< ndnboost::container::basic_string<CharT, Traits, Alloc> >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true );
+ };
+
+ template<typename Target, typename Source>
+ struct is_arithmetic_and_not_xchars
+ {
+ BOOST_STATIC_CONSTANT(bool, value =
+ (
+ ndnboost::type_traits::ice_and<
+ ndnboost::is_arithmetic<Source>::value,
+ ndnboost::is_arithmetic<Target>::value,
+ ndnboost::type_traits::ice_not<
+ detail::is_char_or_wchar<Target>::value
+ >::value,
+ ndnboost::type_traits::ice_not<
+ detail::is_char_or_wchar<Source>::value
+ >::value
+ >::value
+ )
+ );
+ };
+
+ /*
+ * is_xchar_to_xchar<Target, Source>::value is true, when
+ * Target and Souce are the same char types, or when
+ * Target and Souce are char types of the same size.
+ */
+ template<typename Target, typename Source>
+ struct is_xchar_to_xchar
+ {
+ BOOST_STATIC_CONSTANT(bool, value =
+ (
+ ndnboost::type_traits::ice_or<
+ ndnboost::type_traits::ice_and<
+ is_same<Source,Target>::value,
+ is_char_or_wchar<Target>::value
+ >::value,
+ ndnboost::type_traits::ice_and<
+ ndnboost::type_traits::ice_eq< sizeof(char),sizeof(Target)>::value,
+ ndnboost::type_traits::ice_eq< sizeof(char),sizeof(Source)>::value,
+ is_char_or_wchar<Target>::value,
+ is_char_or_wchar<Source>::value
+ >::value
+ >::value
+ )
+ );
+ };
+
+ template<typename Target, typename Source>
+ struct is_char_array_to_stdstring
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false );
+ };
+
+ template<typename CharT, typename Traits, typename Alloc>
+ struct is_char_array_to_stdstring< std::basic_string<CharT, Traits, Alloc>, CharT* >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true );
+ };
+
+ template<typename CharT, typename Traits, typename Alloc>
+ struct is_char_array_to_stdstring< std::basic_string<CharT, Traits, Alloc>, const CharT* >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true );
+ };
+
+ template<typename CharT, typename Traits, typename Alloc>
+ struct is_char_array_to_stdstring< ndnboost::container::basic_string<CharT, Traits, Alloc>, CharT* >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true );
+ };
+
+ template<typename CharT, typename Traits, typename Alloc>
+ struct is_char_array_to_stdstring< ndnboost::container::basic_string<CharT, Traits, Alloc>, const CharT* >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true );
+ };
+
+#if (defined _MSC_VER)
+# pragma warning( push )
+# pragma warning( disable : 4701 ) // possible use of ... before initialization
+# pragma warning( disable : 4702 ) // unreachable code
+# pragma warning( disable : 4267 ) // conversion from 'size_t' to 'unsigned int'
+#endif
+ template<typename Target, typename Source>
+ struct lexical_cast_do_cast
+ {
+ static inline Target lexical_cast_impl(const Source& arg)
+ {
+ typedef lexical_cast_stream_traits<Source, Target> stream_trait;
+
+ typedef detail::lexical_stream_limited_src<
+ BOOST_DEDUCED_TYPENAME stream_trait::char_type,
+ BOOST_DEDUCED_TYPENAME stream_trait::traits,
+ stream_trait::requires_stringbuf
+ > interpreter_type;
+
+ // Target type must be default constructible
+ Target result;
+
+ BOOST_DEDUCED_TYPENAME stream_trait::char_type buf[stream_trait::len_t::value + 1];
+ stream_trait::len_t::check_coverage();
+
+ interpreter_type interpreter(buf, buf + stream_trait::len_t::value + 1);
+
+ // Disabling ADL, by directly specifying operators.
+ if(!(interpreter.operator <<(arg) && interpreter.operator >>(result)))
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+
+ return result;
+ }
+ };
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#endif
+
+ template <typename Source>
+ struct lexical_cast_copy
+ {
+ static inline const Source& lexical_cast_impl(const Source &arg) BOOST_NOEXCEPT
+ {
+ return arg;
+ }
+ };
+
+ template <class Source, class Target >
+ struct detect_precision_loss
+ {
+ typedef ndnboost::numeric::Trunc<Source> Rounder;
+ typedef Source source_type ;
+
+ typedef BOOST_DEDUCED_TYPENAME mpl::if_<
+ ndnboost::is_arithmetic<Source>, Source, Source const&
+ >::type argument_type ;
+
+ static source_type nearbyint ( argument_type s )
+ {
+ const source_type near_int = Rounder::nearbyint(s);
+ if (near_int) {
+ const source_type orig_div_round = s / near_int;
+ const source_type eps = std::numeric_limits<source_type>::epsilon();
+
+ if ((orig_div_round > 1 ? orig_div_round - 1 : 1 - orig_div_round) > eps)
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+ }
+
+ return s ;
+ }
+
+ typedef typename Rounder::round_style round_style;
+ } ;
+
+ template <class Source, class Target >
+ struct nothrow_overflow_handler
+ {
+ void operator() ( ndnboost::numeric::range_check_result r )
+ {
+ if (r != ndnboost::numeric::cInRange)
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+ }
+ } ;
+
+ template <typename Target, typename Source>
+ struct lexical_cast_dynamic_num_not_ignoring_minus
+ {
+ static inline Target lexical_cast_impl(const Source &arg)
+ {
+ return ndnboost::numeric::converter<
+ Target,
+ Source,
+ ndnboost::numeric::conversion_traits<Target,Source>,
+ nothrow_overflow_handler<Source, Target>,
+ detect_precision_loss<Source, Target>
+ >::convert(arg);
+ }
+ };
+
+ template <typename Target, typename Source>
+ struct lexical_cast_dynamic_num_ignoring_minus
+ {
+ static inline Target lexical_cast_impl(const Source &arg)
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::eval_if_c<
+ ndnboost::is_float<Source>::value,
+ ndnboost::mpl::identity<Source>,
+ ndnboost::make_unsigned<Source>
+ >::type usource_t;
+
+ typedef ndnboost::numeric::converter<
+ Target,
+ usource_t,
+ ndnboost::numeric::conversion_traits<Target,usource_t>,
+ nothrow_overflow_handler<usource_t, Target>,
+ detect_precision_loss<usource_t, Target>
+ > converter_t;
+
+ return (
+ arg < 0 ? static_cast<Target>(0u - converter_t::convert(0u - arg)) : converter_t::convert(arg)
+ );
+ }
+ };
+
+ /*
+ * lexical_cast_dynamic_num follows the rules:
+ * 1) If Source can be converted to Target without precision loss and
+ * without overflows, then assign Source to Target and return
+ *
+ * 2) If Source is less than 0 and Target is an unsigned integer,
+ * then negate Source, check the requirements of rule 1) and if
+ * successful, assign static_casted Source to Target and return
+ *
+ * 3) Otherwise throw a bad_lexical_cast exception
+ *
+ *
+ * Rule 2) required because ndnboost::lexical_cast has the behavior of
+ * stringstream, which uses the rules of scanf for conversions. And
+ * in the C99 standard for unsigned input value minus sign is
+ * optional, so if a negative number is read, no errors will arise
+ * and the result will be the two's complement.
+ */
+ template <typename Target, typename Source>
+ struct lexical_cast_dynamic_num
+ {
+ static inline Target lexical_cast_impl(const Source &arg)
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ ndnboost::type_traits::ice_and<
+ ndnboost::type_traits::ice_or<
+ ndnboost::is_signed<Source>::value,
+ ndnboost::is_float<Source>::value
+ >::value,
+ ndnboost::type_traits::ice_not<
+ ndnboost::is_same<Source, bool>::value
+ >::value,
+ ndnboost::type_traits::ice_not<
+ ndnboost::is_same<Target, bool>::value
+ >::value,
+ ndnboost::is_unsigned<Target>::value
+ >::value,
+ lexical_cast_dynamic_num_ignoring_minus<Target, Source>,
+ lexical_cast_dynamic_num_not_ignoring_minus<Target, Source>
+ >::type caster_type;
+
+ return caster_type::lexical_cast_impl(arg);
+ }
+ };
+ }
+
+ template <typename Target, typename Source>
+ inline Target lexical_cast(const Source &arg)
+ {
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::detail::array_to_pointer_decay<Source>::type src;
+
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::type_traits::ice_or<
+ ndnboost::detail::is_xchar_to_xchar<Target, src >::value,
+ ndnboost::detail::is_char_array_to_stdstring<Target, src >::value,
+ ndnboost::type_traits::ice_and<
+ ndnboost::is_same<Target, src >::value,
+ ndnboost::detail::is_stdstring<Target >::value
+ >::value
+ > shall_we_copy_t;
+
+ typedef BOOST_DEDUCED_TYPENAME
+ ndnboost::detail::is_arithmetic_and_not_xchars<Target, src > shall_we_copy_with_dynamic_check_t;
+
+ typedef BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ shall_we_copy_t::value,
+ ndnboost::detail::lexical_cast_copy<src >,
+ BOOST_DEDUCED_TYPENAME ndnboost::mpl::if_c<
+ shall_we_copy_with_dynamic_check_t::value,
+ ndnboost::detail::lexical_cast_dynamic_num<Target, src >,
+ ndnboost::detail::lexical_cast_do_cast<Target, src >
+ >::type
+ >::type caster_type;
+
+ return caster_type::lexical_cast_impl(arg);
+ }
+
+ template <typename Target>
+ inline Target lexical_cast(const char* chars, std::size_t count)
+ {
+ return ::ndnboost::lexical_cast<Target>(
+ ::ndnboost::iterator_range<const char*>(chars, chars + count)
+ );
+ }
+
+
+ template <typename Target>
+ inline Target lexical_cast(const unsigned char* chars, std::size_t count)
+ {
+ return ::ndnboost::lexical_cast<Target>(
+ ::ndnboost::iterator_range<const unsigned char*>(chars, chars + count)
+ );
+ }
+
+ template <typename Target>
+ inline Target lexical_cast(const signed char* chars, std::size_t count)
+ {
+ return ::ndnboost::lexical_cast<Target>(
+ ::ndnboost::iterator_range<const signed char*>(chars, chars + count)
+ );
+ }
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template <typename Target>
+ inline Target lexical_cast(const wchar_t* chars, std::size_t count)
+ {
+ return ::ndnboost::lexical_cast<Target>(
+ ::ndnboost::iterator_range<const wchar_t*>(chars, chars + count)
+ );
+ }
+#endif
+#ifndef BOOST_NO_CHAR16_T
+ template <typename Target>
+ inline Target lexical_cast(const char16_t* chars, std::size_t count)
+ {
+ return ::ndnboost::lexical_cast<Target>(
+ ::ndnboost::iterator_range<const char16_t*>(chars, chars + count)
+ );
+ }
+#endif
+#ifndef BOOST_NO_CHAR32_T
+ template <typename Target>
+ inline Target lexical_cast(const char32_t* chars, std::size_t count)
+ {
+ return ::ndnboost::lexical_cast<Target>(
+ ::ndnboost::iterator_range<const char32_t*>(chars, chars + count)
+ );
+ }
+#endif
+
+} // namespace ndnboost
+
+#else // #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+namespace ndnboost {
+ namespace detail
+ {
+
+ // selectors for choosing stream character type
+ template<typename Type>
+ struct stream_char
+ {
+ typedef char type;
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+ template<>
+ struct stream_char<wchar_t>
+ {
+ typedef wchar_t type;
+ };
+#endif
+
+ template<>
+ struct stream_char<wchar_t *>
+ {
+ typedef wchar_t type;
+ };
+
+ template<>
+ struct stream_char<const wchar_t *>
+ {
+ typedef wchar_t type;
+ };
+
+ template<>
+ struct stream_char<std::wstring>
+ {
+ typedef wchar_t type;
+ };
+#endif
+
+ // stream wrapper for handling lexical conversions
+ template<typename Target, typename Source, typename Traits>
+ class lexical_stream
+ {
+ private:
+ typedef typename widest_char<
+ typename stream_char<Target>::type,
+ typename stream_char<Source>::type>::type char_type;
+
+ typedef Traits traits_type;
+
+ public:
+ lexical_stream(char_type* = 0, char_type* = 0)
+ {
+ stream.unsetf(std::ios::skipws);
+ lcast_set_precision(stream, static_cast<Source*>(0), static_cast<Target*>(0) );
+ }
+ ~lexical_stream()
+ {
+ #if defined(BOOST_NO_STRINGSTREAM)
+ stream.freeze(false);
+ #endif
+ }
+ bool operator<<(const Source &input)
+ {
+ return !(stream << input).fail();
+ }
+ template<typename InputStreamable>
+ bool operator>>(InputStreamable &output)
+ {
+ return !is_pointer<InputStreamable>::value &&
+ stream >> output &&
+ stream.get() ==
+#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING)
+// GCC 2.9x lacks std::char_traits<>::eof().
+// We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3
+// configurations, which do provide std::char_traits<>::eof().
+
+ EOF;
+#else
+ traits_type::eof();
+#endif
+ }
+
+ bool operator>>(std::string &output)
+ {
+ #if defined(BOOST_NO_STRINGSTREAM)
+ stream << '\0';
+ #endif
+ stream.str().swap(output);
+ return true;
+ }
+ #ifndef BOOST_LCAST_NO_WCHAR_T
+ bool operator>>(std::wstring &output)
+ {
+ stream.str().swap(output);
+ return true;
+ }
+ #endif
+
+ private:
+ #if defined(BOOST_NO_STRINGSTREAM)
+ std::strstream stream;
+ #elif defined(BOOST_NO_STD_LOCALE)
+ std::stringstream stream;
+ #else
+ std::basic_stringstream<char_type,traits_type> stream;
+ #endif
+ };
+ }
+
+ // call-by-value fallback version (deprecated)
+
+ template<typename Target, typename Source>
+ Target lexical_cast(Source arg)
+ {
+ typedef typename detail::widest_char<
+ BOOST_DEDUCED_TYPENAME detail::stream_char<Target>::type
+ , BOOST_DEDUCED_TYPENAME detail::stream_char<Source>::type
+ >::type char_type;
+
+ typedef std::char_traits<char_type> traits;
+ detail::lexical_stream<Target, Source, traits> interpreter;
+ Target result;
+
+ if(!(interpreter << arg && interpreter >> result))
+ BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+ return result;
+ }
+
+} // namespace ndnboost
+
+#endif
+
+// Copyright Kevlin Henney, 2000-2005.
+// Copyright Alexander Nasonov, 2006-2010.
+// Copyright Antony Polukhin, 2011-2013.
+//
+// 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)
+
+#undef BOOST_LCAST_THROW_BAD_CAST
+#undef BOOST_LCAST_NO_WCHAR_T
+#undef BOOST_LCAST_HAS_INT128
+
+#endif // BOOST_LEXICAL_CAST_INCLUDED
+
diff --git a/ndnboost/math/policies/policy.hpp b/ndnboost/math/policies/policy.hpp
new file mode 100644
index 0000000..1a4bb16
--- /dev/null
+++ b/ndnboost/math/policies/policy.hpp
@@ -0,0 +1,992 @@
+// Copyright John Maddock 2007.
+// 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_MATH_POLICY_HPP
+#define BOOST_MATH_POLICY_HPP
+
+#include <ndnboost/mpl/list.hpp>
+#include <ndnboost/mpl/contains.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/find_if.hpp>
+#include <ndnboost/mpl/remove_if.hpp>
+#include <ndnboost/mpl/vector.hpp>
+#include <ndnboost/mpl/push_back.hpp>
+#include <ndnboost/mpl/at.hpp>
+#include <ndnboost/mpl/size.hpp>
+#include <ndnboost/mpl/comparison.hpp>
+#include <ndnboost/type_traits/is_same.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/assert.hpp>
+#include <ndnboost/math/tools/config.hpp>
+#include <limits>
+// Sadly we do need the .h versions of these to be sure of getting
+// FLT_MANT_DIG etc.
+#include <limits.h>
+#include <stdlib.h>
+#include <stddef.h>
+#include <math.h>
+
+namespace ndnboost{ namespace math{
+
+namespace tools{
+
+template <class T>
+int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T));
+template <class T>
+T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T));
+
+}
+
+namespace policies{
+
+//
+// Define macros for our default policies, if they're not defined already:
+//
+#ifndef BOOST_MATH_DOMAIN_ERROR_POLICY
+#define BOOST_MATH_DOMAIN_ERROR_POLICY throw_on_error
+#endif
+#ifndef BOOST_MATH_POLE_ERROR_POLICY
+#define BOOST_MATH_POLE_ERROR_POLICY throw_on_error
+#endif
+#ifndef BOOST_MATH_OVERFLOW_ERROR_POLICY
+#define BOOST_MATH_OVERFLOW_ERROR_POLICY throw_on_error
+#endif
+#ifndef BOOST_MATH_EVALUATION_ERROR_POLICY
+#define BOOST_MATH_EVALUATION_ERROR_POLICY throw_on_error
+#endif
+#ifndef BOOST_MATH_ROUNDING_ERROR_POLICY
+#define BOOST_MATH_ROUNDING_ERROR_POLICY throw_on_error
+#endif
+#ifndef BOOST_MATH_UNDERFLOW_ERROR_POLICY
+#define BOOST_MATH_UNDERFLOW_ERROR_POLICY ignore_error
+#endif
+#ifndef BOOST_MATH_DENORM_ERROR_POLICY
+#define BOOST_MATH_DENORM_ERROR_POLICY ignore_error
+#endif
+#ifndef BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY
+#define BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY ignore_error
+#endif
+#ifndef BOOST_MATH_DIGITS10_POLICY
+#define BOOST_MATH_DIGITS10_POLICY 0
+#endif
+#ifndef BOOST_MATH_PROMOTE_FLOAT_POLICY
+#define BOOST_MATH_PROMOTE_FLOAT_POLICY true
+#endif
+#ifndef BOOST_MATH_PROMOTE_DOUBLE_POLICY
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#define BOOST_MATH_PROMOTE_DOUBLE_POLICY false
+#else
+#define BOOST_MATH_PROMOTE_DOUBLE_POLICY true
+#endif
+#endif
+#ifndef BOOST_MATH_DISCRETE_QUANTILE_POLICY
+#define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_outwards
+#endif
+#ifndef BOOST_MATH_ASSERT_UNDEFINED_POLICY
+#define BOOST_MATH_ASSERT_UNDEFINED_POLICY true
+#endif
+#ifndef BOOST_MATH_MAX_SERIES_ITERATION_POLICY
+#define BOOST_MATH_MAX_SERIES_ITERATION_POLICY 1000000
+#endif
+#ifndef BOOST_MATH_MAX_ROOT_ITERATION_POLICY
+#define BOOST_MATH_MAX_ROOT_ITERATION_POLICY 200
+#endif
+
+#if !defined(__BORLANDC__) \
+ && !(defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ <= 2))
+#define BOOST_MATH_META_INT(type, name, Default)\
+ template <type N = Default> struct name : public ndnboost::mpl::int_<N>{};\
+ namespace detail{\
+ template <type N>\
+ char test_is_valid_arg(const name<N>*);\
+ char test_is_default_arg(const name<Default>*);\
+ template <class T> struct is_##name##_imp\
+ {\
+ template <type N> static char test(const name<N>*);\
+ static double test(...);\
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(test(static_cast<T*>(0))) == 1);\
+ };\
+ }\
+ template <class T> struct is_##name : public ndnboost::mpl::bool_< ::ndnboost::math::policies::detail::is_##name##_imp<T>::value>{};
+
+#define BOOST_MATH_META_BOOL(name, Default)\
+ template <bool N = Default> struct name : public ndnboost::mpl::bool_<N>{};\
+ namespace detail{\
+ template <bool N>\
+ char test_is_valid_arg(const name<N>*);\
+ char test_is_default_arg(const name<Default>*);\
+ template <class T> struct is_##name##_imp\
+ {\
+ template <bool N> static char test(const name<N>*);\
+ static double test(...);\
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(test(static_cast<T*>(0))) == 1);\
+ };\
+ }\
+ template <class T> struct is_##name : public ndnboost::mpl::bool_< ::ndnboost::math::policies::detail::is_##name##_imp<T>::value>{};
+#else
+#define BOOST_MATH_META_INT(Type, name, Default)\
+ template <Type N = Default> struct name : public ndnboost::mpl::int_<N>{};\
+ namespace detail{\
+ template <Type N>\
+ char test_is_valid_arg(const name<N>*);\
+ char test_is_default_arg(const name<Default>*);\
+ template <class T> struct is_##name##_tester\
+ {\
+ template <Type N> static char test(const name<N>&);\
+ static double test(...);\
+ };\
+ template <class T> struct is_##name##_imp\
+ {\
+ static T inst;\
+ BOOST_STATIC_CONSTANT(bool, value = sizeof( ::ndnboost::math::policies::detail::is_##name##_tester<T>::test(inst)) == 1);\
+ };\
+ }\
+ template <class T> struct is_##name : public ndnboost::mpl::bool_< ::ndnboost::math::policies::detail::is_##name##_imp<T>::value>\
+ {\
+ template <class U> struct apply{ typedef is_##name<U> type; };\
+ };
+
+#define BOOST_MATH_META_BOOL(name, Default)\
+ template <bool N = Default> struct name : public ndnboost::mpl::bool_<N>{};\
+ namespace detail{\
+ template <bool N>\
+ char test_is_valid_arg(const name<N>*);\
+ char test_is_default_arg(const name<Default>*);\
+ template <class T> struct is_##name##_tester\
+ {\
+ template <bool N> static char test(const name<N>&);\
+ static double test(...);\
+ };\
+ template <class T> struct is_##name##_imp\
+ {\
+ static T inst;\
+ BOOST_STATIC_CONSTANT(bool, value = sizeof( ::ndnboost::math::policies::detail::is_##name##_tester<T>::test(inst)) == 1);\
+ };\
+ }\
+ template <class T> struct is_##name : public ndnboost::mpl::bool_< ::ndnboost::math::policies::detail::is_##name##_imp<T>::value>\
+ {\
+ template <class U> struct apply{ typedef is_##name<U> type; };\
+ };
+#endif
+//
+// Begin by defining policy types for error handling:
+//
+enum error_policy_type
+{
+ throw_on_error = 0,
+ errno_on_error = 1,
+ ignore_error = 2,
+ user_error = 3
+};
+
+BOOST_MATH_META_INT(error_policy_type, domain_error, BOOST_MATH_DOMAIN_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, pole_error, BOOST_MATH_POLE_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, overflow_error, BOOST_MATH_OVERFLOW_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, underflow_error, BOOST_MATH_UNDERFLOW_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, denorm_error, BOOST_MATH_DENORM_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, evaluation_error, BOOST_MATH_EVALUATION_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, rounding_error, BOOST_MATH_ROUNDING_ERROR_POLICY)
+BOOST_MATH_META_INT(error_policy_type, indeterminate_result_error, BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY)
+
+//
+// Policy types for internal promotion:
+//
+BOOST_MATH_META_BOOL(promote_float, BOOST_MATH_PROMOTE_FLOAT_POLICY)
+BOOST_MATH_META_BOOL(promote_double, BOOST_MATH_PROMOTE_DOUBLE_POLICY)
+BOOST_MATH_META_BOOL(assert_undefined, BOOST_MATH_ASSERT_UNDEFINED_POLICY)
+//
+// Policy types for discrete quantiles:
+//
+enum discrete_quantile_policy_type
+{
+ real,
+ integer_round_outwards,
+ integer_round_inwards,
+ integer_round_down,
+ integer_round_up,
+ integer_round_nearest
+};
+
+BOOST_MATH_META_INT(discrete_quantile_policy_type, discrete_quantile, BOOST_MATH_DISCRETE_QUANTILE_POLICY)
+//
+// Precision:
+//
+BOOST_MATH_META_INT(int, digits10, BOOST_MATH_DIGITS10_POLICY)
+BOOST_MATH_META_INT(int, digits2, 0)
+//
+// Iterations:
+//
+BOOST_MATH_META_INT(unsigned long, max_series_iterations, BOOST_MATH_MAX_SERIES_ITERATION_POLICY)
+BOOST_MATH_META_INT(unsigned long, max_root_iterations, BOOST_MATH_MAX_ROOT_ITERATION_POLICY)
+//
+// Define the names for each possible policy:
+//
+#define BOOST_MATH_PARAMETER(name)\
+ BOOST_PARAMETER_TEMPLATE_KEYWORD(name##_name)\
+ BOOST_PARAMETER_NAME(name##_name)
+
+struct default_policy{};
+
+namespace detail{
+//
+// Trait to work out bits precision from digits10 and digits2:
+//
+template <class Digits10, class Digits2>
+struct precision
+{
+ //
+ // Now work out the precision:
+ //
+ typedef typename mpl::if_c<
+ (Digits10::value == 0),
+ digits2<0>,
+ digits2<((Digits10::value + 1) * 1000L) / 301L>
+ >::type digits2_type;
+public:
+#ifdef __BORLANDC__
+ typedef typename mpl::if_c<
+ (Digits2::value > ::ndnboost::math::policies::detail::precision<Digits10,Digits2>::digits2_type::value),
+ Digits2, digits2_type>::type type;
+#else
+ typedef typename mpl::if_c<
+ (Digits2::value > digits2_type::value),
+ Digits2, digits2_type>::type type;
+#endif
+};
+
+template <class A, class B, bool b>
+struct select_result
+{
+ typedef A type;
+};
+template <class A, class B>
+struct select_result<A, B, false>
+{
+ typedef typename mpl::deref<B>::type type;
+};
+
+template <class Seq, class Pred, class DefaultType>
+struct find_arg
+{
+private:
+ typedef typename mpl::find_if<Seq, Pred>::type iter;
+ typedef typename mpl::end<Seq>::type end_type;
+public:
+ typedef typename select_result<
+ DefaultType, iter,
+ ::ndnboost::is_same<iter, end_type>::value>::type type;
+};
+
+double test_is_valid_arg(...);
+double test_is_default_arg(...);
+char test_is_valid_arg(const default_policy*);
+char test_is_default_arg(const default_policy*);
+
+template <class T>
+struct is_valid_policy_imp
+{
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(::ndnboost::math::policies::detail::test_is_valid_arg(static_cast<T*>(0))) == 1);
+};
+
+template <class T>
+struct is_default_policy_imp
+{
+ BOOST_STATIC_CONSTANT(bool, value = sizeof(::ndnboost::math::policies::detail::test_is_default_arg(static_cast<T*>(0))) == 1);
+};
+
+template <class T> struct is_valid_policy
+: public mpl::bool_<
+ ::ndnboost::math::policies::detail::is_valid_policy_imp<T>::value>
+{};
+
+template <class T> struct is_default_policy
+: public mpl::bool_<
+ ::ndnboost::math::policies::detail::is_default_policy_imp<T>::value>
+{
+ template <class U>
+ struct apply
+ {
+ typedef is_default_policy<U> type;
+ };
+};
+
+template <class Seq, class T, int N>
+struct append_N
+{
+ typedef typename mpl::push_back<Seq, T>::type new_seq;
+ typedef typename append_N<new_seq, T, N-1>::type type;
+};
+
+template <class Seq, class T>
+struct append_N<Seq, T, 0>
+{
+ typedef Seq type;
+};
+
+//
+// Traits class to work out what template parameters our default
+// policy<> class will have when modified for forwarding:
+//
+template <bool f, bool d>
+struct default_args
+{
+ typedef promote_float<false> arg1;
+ typedef promote_double<false> arg2;
+};
+
+template <>
+struct default_args<false, false>
+{
+ typedef default_policy arg1;
+ typedef default_policy arg2;
+};
+
+template <>
+struct default_args<true, false>
+{
+ typedef promote_float<false> arg1;
+ typedef default_policy arg2;
+};
+
+template <>
+struct default_args<false, true>
+{
+ typedef promote_double<false> arg1;
+ typedef default_policy arg2;
+};
+
+typedef default_args<BOOST_MATH_PROMOTE_FLOAT_POLICY, BOOST_MATH_PROMOTE_DOUBLE_POLICY>::arg1 forwarding_arg1;
+typedef default_args<BOOST_MATH_PROMOTE_FLOAT_POLICY, BOOST_MATH_PROMOTE_DOUBLE_POLICY>::arg2 forwarding_arg2;
+
+} // detail
+//
+// Now define the policy type with enough arguments to handle all
+// the policies:
+//
+template <class A1 = default_policy,
+ class A2 = default_policy,
+ class A3 = default_policy,
+ class A4 = default_policy,
+ class A5 = default_policy,
+ class A6 = default_policy,
+ class A7 = default_policy,
+ class A8 = default_policy,
+ class A9 = default_policy,
+ class A10 = default_policy,
+ class A11 = default_policy,
+ class A12 = default_policy,
+ class A13 = default_policy>
+struct policy
+{
+private:
+ //
+ // Validate all our arguments:
+ //
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A1>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A2>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A3>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A4>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A5>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A6>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A7>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A8>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A9>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A10>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A11>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A12>::value);
+ BOOST_STATIC_ASSERT(::ndnboost::math::policies::detail::is_valid_policy<A13>::value);
+ //
+ // Typelist of the arguments:
+ //
+ typedef mpl::list<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13> arg_list;
+
+public:
+ typedef typename detail::find_arg<arg_list, is_domain_error<mpl::_1>, domain_error<> >::type domain_error_type;
+ typedef typename detail::find_arg<arg_list, is_pole_error<mpl::_1>, pole_error<> >::type pole_error_type;
+ typedef typename detail::find_arg<arg_list, is_overflow_error<mpl::_1>, overflow_error<> >::type overflow_error_type;
+ typedef typename detail::find_arg<arg_list, is_underflow_error<mpl::_1>, underflow_error<> >::type underflow_error_type;
+ typedef typename detail::find_arg<arg_list, is_denorm_error<mpl::_1>, denorm_error<> >::type denorm_error_type;
+ typedef typename detail::find_arg<arg_list, is_evaluation_error<mpl::_1>, evaluation_error<> >::type evaluation_error_type;
+ typedef typename detail::find_arg<arg_list, is_rounding_error<mpl::_1>, rounding_error<> >::type rounding_error_type;
+ typedef typename detail::find_arg<arg_list, is_indeterminate_result_error<mpl::_1>, indeterminate_result_error<> >::type indeterminate_result_error_type;
+private:
+ //
+ // Now work out the precision:
+ //
+ typedef typename detail::find_arg<arg_list, is_digits10<mpl::_1>, digits10<> >::type digits10_type;
+ typedef typename detail::find_arg<arg_list, is_digits2<mpl::_1>, digits2<> >::type bits_precision_type;
+public:
+ typedef typename detail::precision<digits10_type, bits_precision_type>::type precision_type;
+ //
+ // Internal promotion:
+ //
+ typedef typename detail::find_arg<arg_list, is_promote_float<mpl::_1>, promote_float<> >::type promote_float_type;
+ typedef typename detail::find_arg<arg_list, is_promote_double<mpl::_1>, promote_double<> >::type promote_double_type;
+ //
+ // Discrete quantiles:
+ //
+ typedef typename detail::find_arg<arg_list, is_discrete_quantile<mpl::_1>, discrete_quantile<> >::type discrete_quantile_type;
+ //
+ // Mathematically undefined properties:
+ //
+ typedef typename detail::find_arg<arg_list, is_assert_undefined<mpl::_1>, assert_undefined<> >::type assert_undefined_type;
+ //
+ // Max iterations:
+ //
+ typedef typename detail::find_arg<arg_list, is_max_series_iterations<mpl::_1>, max_series_iterations<> >::type max_series_iterations_type;
+ typedef typename detail::find_arg<arg_list, is_max_root_iterations<mpl::_1>, max_root_iterations<> >::type max_root_iterations_type;
+};
+//
+// These full specializations are defined to reduce the amount of
+// template instantiations that have to take place when using the default
+// policies, they have quite a large impact on compile times:
+//
+template <>
+struct policy<default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy>
+{
+public:
+ typedef domain_error<> domain_error_type;
+ typedef pole_error<> pole_error_type;
+ typedef overflow_error<> overflow_error_type;
+ typedef underflow_error<> underflow_error_type;
+ typedef denorm_error<> denorm_error_type;
+ typedef evaluation_error<> evaluation_error_type;
+ typedef rounding_error<> rounding_error_type;
+ typedef indeterminate_result_error<> indeterminate_result_error_type;
+#if BOOST_MATH_DIGITS10_POLICY == 0
+ typedef digits2<> precision_type;
+#else
+ typedef detail::precision<digits10<>, digits2<> >::type precision_type;
+#endif
+ typedef promote_float<> promote_float_type;
+ typedef promote_double<> promote_double_type;
+ typedef discrete_quantile<> discrete_quantile_type;
+ typedef assert_undefined<> assert_undefined_type;
+ typedef max_series_iterations<> max_series_iterations_type;
+ typedef max_root_iterations<> max_root_iterations_type;
+};
+
+template <>
+struct policy<detail::forwarding_arg1, detail::forwarding_arg2, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy, default_policy>
+{
+public:
+ typedef domain_error<> domain_error_type;
+ typedef pole_error<> pole_error_type;
+ typedef overflow_error<> overflow_error_type;
+ typedef underflow_error<> underflow_error_type;
+ typedef denorm_error<> denorm_error_type;
+ typedef evaluation_error<> evaluation_error_type;
+ typedef rounding_error<> rounding_error_type;
+ typedef indeterminate_result_error<> indeterminate_result_error_type;
+#if BOOST_MATH_DIGITS10_POLICY == 0
+ typedef digits2<> precision_type;
+#else
+ typedef detail::precision<digits10<>, digits2<> >::type precision_type;
+#endif
+ typedef promote_float<false> promote_float_type;
+ typedef promote_double<false> promote_double_type;
+ typedef discrete_quantile<> discrete_quantile_type;
+ typedef assert_undefined<> assert_undefined_type;
+ typedef max_series_iterations<> max_series_iterations_type;
+ typedef max_root_iterations<> max_root_iterations_type;
+};
+
+template <class Policy,
+ class A1 = default_policy,
+ class A2 = default_policy,
+ class A3 = default_policy,
+ class A4 = default_policy,
+ class A5 = default_policy,
+ class A6 = default_policy,
+ class A7 = default_policy,
+ class A8 = default_policy,
+ class A9 = default_policy,
+ class A10 = default_policy,
+ class A11 = default_policy,
+ class A12 = default_policy,
+ class A13 = default_policy>
+struct normalise
+{
+private:
+ typedef mpl::list<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11,A12,A13> arg_list;
+ typedef typename detail::find_arg<arg_list, is_domain_error<mpl::_1>, typename Policy::domain_error_type >::type domain_error_type;
+ typedef typename detail::find_arg<arg_list, is_pole_error<mpl::_1>, typename Policy::pole_error_type >::type pole_error_type;
+ typedef typename detail::find_arg<arg_list, is_overflow_error<mpl::_1>, typename Policy::overflow_error_type >::type overflow_error_type;
+ typedef typename detail::find_arg<arg_list, is_underflow_error<mpl::_1>, typename Policy::underflow_error_type >::type underflow_error_type;
+ typedef typename detail::find_arg<arg_list, is_denorm_error<mpl::_1>, typename Policy::denorm_error_type >::type denorm_error_type;
+ typedef typename detail::find_arg<arg_list, is_evaluation_error<mpl::_1>, typename Policy::evaluation_error_type >::type evaluation_error_type;
+ typedef typename detail::find_arg<arg_list, is_rounding_error<mpl::_1>, typename Policy::rounding_error_type >::type rounding_error_type;
+ typedef typename detail::find_arg<arg_list, is_indeterminate_result_error<mpl::_1>, typename Policy::indeterminate_result_error_type >::type indeterminate_result_error_type;
+ //
+ // Now work out the precision:
+ //
+ typedef typename detail::find_arg<arg_list, is_digits10<mpl::_1>, digits10<> >::type digits10_type;
+ typedef typename detail::find_arg<arg_list, is_digits2<mpl::_1>, typename Policy::precision_type >::type bits_precision_type;
+ typedef typename detail::precision<digits10_type, bits_precision_type>::type precision_type;
+ //
+ // Internal promotion:
+ //
+ typedef typename detail::find_arg<arg_list, is_promote_float<mpl::_1>, typename Policy::promote_float_type >::type promote_float_type;
+ typedef typename detail::find_arg<arg_list, is_promote_double<mpl::_1>, typename Policy::promote_double_type >::type promote_double_type;
+ //
+ // Discrete quantiles:
+ //
+ typedef typename detail::find_arg<arg_list, is_discrete_quantile<mpl::_1>, typename Policy::discrete_quantile_type >::type discrete_quantile_type;
+ //
+ // Mathematically undefined properties:
+ //
+ typedef typename detail::find_arg<arg_list, is_assert_undefined<mpl::_1>, typename Policy::assert_undefined_type >::type assert_undefined_type;
+ //
+ // Max iterations:
+ //
+ typedef typename detail::find_arg<arg_list, is_max_series_iterations<mpl::_1>, typename Policy::max_series_iterations_type>::type max_series_iterations_type;
+ typedef typename detail::find_arg<arg_list, is_max_root_iterations<mpl::_1>, typename Policy::max_root_iterations_type>::type max_root_iterations_type;
+ //
+ // Define a typelist of the policies:
+ //
+ typedef mpl::vector<
+ domain_error_type,
+ pole_error_type,
+ overflow_error_type,
+ underflow_error_type,
+ denorm_error_type,
+ evaluation_error_type,
+ rounding_error_type,
+ indeterminate_result_error_type,
+ precision_type,
+ promote_float_type,
+ promote_double_type,
+ discrete_quantile_type,
+ assert_undefined_type,
+ max_series_iterations_type,
+ max_root_iterations_type> result_list;
+ //
+ // Remove all the policies that are the same as the default:
+ //
+ typedef typename mpl::remove_if<result_list, detail::is_default_policy<mpl::_> >::type reduced_list;
+ //
+ // Pad out the list with defaults:
+ //
+ typedef typename detail::append_N<reduced_list, default_policy, (14 - ::ndnboost::mpl::size<reduced_list>::value)>::type result_type;
+public:
+ typedef policy<
+ typename mpl::at<result_type, mpl::int_<0> >::type,
+ typename mpl::at<result_type, mpl::int_<1> >::type,
+ typename mpl::at<result_type, mpl::int_<2> >::type,
+ typename mpl::at<result_type, mpl::int_<3> >::type,
+ typename mpl::at<result_type, mpl::int_<4> >::type,
+ typename mpl::at<result_type, mpl::int_<5> >::type,
+ typename mpl::at<result_type, mpl::int_<6> >::type,
+ typename mpl::at<result_type, mpl::int_<7> >::type,
+ typename mpl::at<result_type, mpl::int_<8> >::type,
+ typename mpl::at<result_type, mpl::int_<9> >::type,
+ typename mpl::at<result_type, mpl::int_<10> >::type,
+ typename mpl::at<result_type, mpl::int_<11> >::type,
+ typename mpl::at<result_type, mpl::int_<12> >::type > type;
+};
+//
+// Full specialisation to speed up compilation of the common case:
+//
+template <>
+struct normalise<policy<>,
+ promote_float<false>,
+ promote_double<false>,
+ discrete_quantile<>,
+ assert_undefined<>,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy>
+{
+ typedef policy<detail::forwarding_arg1, detail::forwarding_arg2> type;
+};
+
+template <>
+struct normalise<policy<detail::forwarding_arg1, detail::forwarding_arg2>,
+ promote_float<false>,
+ promote_double<false>,
+ discrete_quantile<>,
+ assert_undefined<>,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy,
+ default_policy>
+{
+ typedef policy<detail::forwarding_arg1, detail::forwarding_arg2> type;
+};
+
+inline policy<> make_policy()
+{ return policy<>(); }
+
+template <class A1>
+inline typename normalise<policy<>, A1>::type make_policy(const A1&)
+{
+ typedef typename normalise<policy<>, A1>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2>
+inline typename normalise<policy<>, A1, A2>::type make_policy(const A1&, const A2&)
+{
+ typedef typename normalise<policy<>, A1, A2>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3>
+inline typename normalise<policy<>, A1, A2, A3>::type make_policy(const A1&, const A2&, const A3&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4>
+inline typename normalise<policy<>, A1, A2, A3, A4>::type make_policy(const A1&, const A2&, const A3&, const A4&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5, class A6>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5, class A6, class A7>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type result_type;
+ return result_type();
+}
+
+template <class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9, class A10, class A11>
+inline typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&, const A11&)
+{
+ typedef typename normalise<policy<>, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type result_type;
+ return result_type();
+}
+
+//
+// Traits class to handle internal promotion:
+//
+template <class Real, class Policy>
+struct evaluation
+{
+ typedef Real type;
+};
+
+template <class Policy>
+struct evaluation<float, Policy>
+{
+ typedef typename mpl::if_<typename Policy::promote_float_type, double, float>::type type;
+};
+
+template <class Policy>
+struct evaluation<double, Policy>
+{
+ typedef typename mpl::if_<typename Policy::promote_double_type, long double, double>::type type;
+};
+
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+
+template <class Real>
+struct basic_digits : public mpl::int_<0>{ };
+template <>
+struct basic_digits<float> : public mpl::int_<FLT_MANT_DIG>{ };
+template <>
+struct basic_digits<double> : public mpl::int_<DBL_MANT_DIG>{ };
+template <>
+struct basic_digits<long double> : public mpl::int_<LDBL_MANT_DIG>{ };
+
+template <class Real, class Policy>
+struct precision
+{
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<Real>::radix == 2);
+ typedef typename Policy::precision_type precision_type;
+ typedef basic_digits<Real> digits_t;
+ typedef typename mpl::if_<
+ mpl::equal_to<digits_t, mpl::int_<0> >,
+ // Possibly unknown precision:
+ precision_type,
+ typename mpl::if_<
+ mpl::or_<mpl::less_equal<digits_t, precision_type>, mpl::less_equal<precision_type, mpl::int_<0> > >,
+ // Default case, full precision for RealType:
+ digits2< ::std::numeric_limits<Real>::digits>,
+ // User customised precision:
+ precision_type
+ >::type
+ >::type type;
+};
+
+template <class Policy>
+struct precision<float, Policy>
+{
+ typedef digits2<FLT_MANT_DIG> type;
+};
+template <class Policy>
+struct precision<double, Policy>
+{
+ typedef digits2<DBL_MANT_DIG> type;
+};
+template <class Policy>
+struct precision<long double, Policy>
+{
+ typedef digits2<LDBL_MANT_DIG> type;
+};
+
+#else
+
+template <class Real, class Policy>
+struct precision
+{
+ BOOST_STATIC_ASSERT((::std::numeric_limits<Real>::radix == 2) || ((::std::numeric_limits<Real>::is_specialized == 0) || (::std::numeric_limits<Real>::digits == 0)));
+#ifndef __BORLANDC__
+ typedef typename Policy::precision_type precision_type;
+ typedef typename mpl::if_c<
+ ((::std::numeric_limits<Real>::is_specialized == 0) || (::std::numeric_limits<Real>::digits == 0)),
+ // Possibly unknown precision:
+ precision_type,
+ typename mpl::if_c<
+ ((::std::numeric_limits<Real>::digits <= precision_type::value)
+ || (Policy::precision_type::value <= 0)),
+ // Default case, full precision for RealType:
+ digits2< ::std::numeric_limits<Real>::digits>,
+ // User customised precision:
+ precision_type
+ >::type
+ >::type type;
+#else
+ typedef typename Policy::precision_type precision_type;
+ typedef mpl::int_< ::std::numeric_limits<Real>::digits> digits_t;
+ typedef mpl::bool_< ::std::numeric_limits<Real>::is_specialized> spec_t;
+ typedef typename mpl::if_<
+ mpl::or_<mpl::equal_to<spec_t, mpl::false_>, mpl::equal_to<digits_t, mpl::int_<0> > >,
+ // Possibly unknown precision:
+ precision_type,
+ typename mpl::if_<
+ mpl::or_<mpl::less_equal<digits_t, precision_type>, mpl::less_equal<precision_type, mpl::int_<0> > >,
+ // Default case, full precision for RealType:
+ digits2< ::std::numeric_limits<Real>::digits>,
+ // User customised precision:
+ precision_type
+ >::type
+ >::type type;
+#endif
+};
+
+#endif
+
+#ifdef BOOST_MATH_USE_FLOAT128
+
+template <class Policy>
+struct precision<__float128, Policy>
+{
+ typedef mpl::int_<113> type;
+};
+
+#endif
+
+namespace detail{
+
+template <class T, class Policy>
+inline int digits_imp(mpl::true_ const&)
+{
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
+#else
+ BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
+#endif
+ typedef typename ndnboost::math::policies::precision<T, Policy>::type p_t;
+ return p_t::value;
+}
+
+template <class T, class Policy>
+inline int digits_imp(mpl::false_ const&)
+{
+ return tools::digits<T>();
+}
+
+} // namespace detail
+
+template <class T, class Policy>
+inline int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
+{
+ typedef mpl::bool_< std::numeric_limits<T>::is_specialized > tag_type;
+ return detail::digits_imp<T, Policy>(tag_type());
+}
+
+template <class Policy>
+inline unsigned long get_max_series_iterations()
+{
+ typedef typename Policy::max_series_iterations_type iter_type;
+ return iter_type::value;
+}
+
+template <class Policy>
+inline unsigned long get_max_root_iterations()
+{
+ typedef typename Policy::max_root_iterations_type iter_type;
+ return iter_type::value;
+}
+
+namespace detail{
+
+template <class T, class Digits, class Small, class Default>
+struct series_factor_calc
+{
+ static T get()
+ {
+ return ldexp(T(1.0), 1 - Digits::value);
+ }
+};
+
+template <class T, class Digits>
+struct series_factor_calc<T, Digits, mpl::true_, mpl::true_>
+{
+ static T get()
+ {
+ return ndnboost::math::tools::epsilon<T>();
+ }
+};
+template <class T, class Digits>
+struct series_factor_calc<T, Digits, mpl::true_, mpl::false_>
+{
+ static T get()
+ {
+ static const ndnboost::uintmax_t v = static_cast<ndnboost::uintmax_t>(1u) << (Digits::value - 1);
+ return 1 / static_cast<T>(v);
+ }
+};
+template <class T, class Digits>
+struct series_factor_calc<T, Digits, mpl::false_, mpl::true_>
+{
+ static T get()
+ {
+ return ndnboost::math::tools::epsilon<T>();
+ }
+};
+
+template <class T, class Policy>
+inline T get_epsilon_imp(mpl::true_ const&)
+{
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::is_specialized);
+ BOOST_STATIC_ASSERT( ::std::numeric_limits<T>::radix == 2);
+#else
+ BOOST_ASSERT(::std::numeric_limits<T>::is_specialized);
+ BOOST_ASSERT(::std::numeric_limits<T>::radix == 2);
+#endif
+ typedef typename ndnboost::math::policies::precision<T, Policy>::type p_t;
+ typedef mpl::bool_<p_t::value <= std::numeric_limits<ndnboost::uintmax_t>::digits> is_small_int;
+ typedef mpl::bool_<p_t::value >= std::numeric_limits<T>::digits> is_default_value;
+ return series_factor_calc<T, p_t, is_small_int, is_default_value>::get();
+}
+
+template <class T, class Policy>
+inline T get_epsilon_imp(mpl::false_ const&)
+{
+ return tools::epsilon<T>();
+}
+
+} // namespace detail
+
+template <class T, class Policy>
+inline T get_epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T))
+{
+ typedef mpl::bool_< (std::numeric_limits<T>::is_specialized && (std::numeric_limits<T>::radix == 2)) > tag_type;
+ return detail::get_epsilon_imp<T, Policy>(tag_type());
+}
+
+namespace detail{
+
+template <class A1,
+ class A2,
+ class A3,
+ class A4,
+ class A5,
+ class A6,
+ class A7,
+ class A8,
+ class A9,
+ class A10,
+ class A11>
+char test_is_policy(const policy<A1,A2,A3,A4,A5,A6,A7,A8,A9,A10,A11>*);
+double test_is_policy(...);
+
+template <class P>
+struct is_policy_imp
+{
+ BOOST_STATIC_CONSTANT(bool, value = (sizeof(::ndnboost::math::policies::detail::test_is_policy(static_cast<P*>(0))) == 1));
+};
+
+}
+
+template <class P>
+struct is_policy : public mpl::bool_< ::ndnboost::math::policies::detail::is_policy_imp<P>::value> {};
+
+//
+// Helper traits class for distribution error handling:
+//
+template <class Policy>
+struct constructor_error_check
+{
+ typedef typename Policy::domain_error_type domain_error_type;
+ typedef typename mpl::if_c<
+ (domain_error_type::value == throw_on_error) || (domain_error_type::value == user_error),
+ mpl::true_,
+ mpl::false_>::type type;
+};
+
+template <class Policy>
+struct method_error_check
+{
+ typedef typename Policy::domain_error_type domain_error_type;
+ typedef typename mpl::if_c<
+ (domain_error_type::value == throw_on_error) && (domain_error_type::value != user_error),
+ mpl::false_,
+ mpl::true_>::type type;
+};
+
+}}} // namespaces
+
+#endif // BOOST_MATH_POLICY_HPP
+
+
+
diff --git a/ndnboost/math/special_functions/detail/fp_traits.hpp b/ndnboost/math/special_functions/detail/fp_traits.hpp
new file mode 100644
index 0000000..e1c8d78
--- /dev/null
+++ b/ndnboost/math/special_functions/detail/fp_traits.hpp
@@ -0,0 +1,570 @@
+// fp_traits.hpp
+
+#ifndef BOOST_MATH_FP_TRAITS_HPP
+#define BOOST_MATH_FP_TRAITS_HPP
+
+// Copyright (c) 2006 Johan Rade
+
+// 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)
+
+/*
+To support old compilers, care has been taken to avoid partial template
+specialization and meta function forwarding.
+With these techniques, the code could be simplified.
+*/
+
+#if defined(__vms) && defined(__DECCXX) && !__IEEE_FLOAT
+// The VAX floating point formats are used (for float and double)
+# define BOOST_FPCLASSIFY_VAX_FORMAT
+#endif
+
+#include <cstring>
+
+#include <ndnboost/assert.hpp>
+#include <ndnboost/cstdint.hpp>
+#include <ndnboost/detail/endian.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/type_traits/is_floating_point.hpp>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+ namespace std{ using ::memcpy; }
+#endif
+
+#ifndef FP_NORMAL
+
+#define FP_ZERO 0
+#define FP_NORMAL 1
+#define FP_INFINITE 2
+#define FP_NAN 3
+#define FP_SUBNORMAL 4
+
+#else
+
+#define BOOST_HAS_FPCLASSIFY
+
+#ifndef fpclassify
+# if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
+ && defined(_GLIBCXX_USE_C99_MATH) \
+ && !(defined(_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) \
+ && (_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC != 0))
+# ifdef _STLP_VENDOR_CSTD
+# if _STLPORT_VERSION >= 0x520
+# define BOOST_FPCLASSIFY_PREFIX ::__std_alias::
+# else
+# define BOOST_FPCLASSIFY_PREFIX ::_STLP_VENDOR_CSTD::
+# endif
+# else
+# define BOOST_FPCLASSIFY_PREFIX ::std::
+# endif
+# else
+# undef BOOST_HAS_FPCLASSIFY
+# define BOOST_FPCLASSIFY_PREFIX
+# endif
+#elif (defined(__HP_aCC) && !defined(__hppa))
+// aCC 6 appears to do "#define fpclassify fpclassify" which messes us up a bit!
+# define BOOST_FPCLASSIFY_PREFIX ::
+#else
+# define BOOST_FPCLASSIFY_PREFIX
+#endif
+
+#ifdef __MINGW32__
+# undef BOOST_HAS_FPCLASSIFY
+#endif
+
+#endif
+
+
+//------------------------------------------------------------------------------
+
+namespace ndnboost {
+namespace math {
+namespace detail {
+
+//------------------------------------------------------------------------------
+
+/*
+The following classes are used to tag the different methods that are used
+for floating point classification
+*/
+
+struct native_tag {};
+template <bool has_limits>
+struct generic_tag {};
+struct ieee_tag {};
+struct ieee_copy_all_bits_tag : public ieee_tag {};
+struct ieee_copy_leading_bits_tag : public ieee_tag {};
+
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+//
+// These helper functions are used only when numeric_limits<>
+// members are not compile time constants:
+//
+inline bool is_generic_tag_false(const generic_tag<false>*)
+{
+ return true;
+}
+inline bool is_generic_tag_false(const void*)
+{
+ return false;
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+/*
+Most processors support three different floating point precisions:
+single precision (32 bits), double precision (64 bits)
+and extended double precision (80 - 128 bits, depending on the processor)
+
+Note that the C++ type long double can be implemented
+both as double precision and extended double precision.
+*/
+
+struct unknown_precision{};
+struct single_precision {};
+struct double_precision {};
+struct extended_double_precision {};
+
+// native_tag version --------------------------------------------------------------
+
+template<class T> struct fp_traits_native
+{
+ typedef native_tag method;
+};
+
+// generic_tag version -------------------------------------------------------------
+
+template<class T, class U> struct fp_traits_non_native
+{
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ typedef generic_tag<std::numeric_limits<T>::is_specialized> method;
+#else
+ typedef generic_tag<false> method;
+#endif
+};
+
+// ieee_tag versions ---------------------------------------------------------------
+
+/*
+These specializations of fp_traits_non_native contain information needed
+to "parse" the binary representation of a floating point number.
+
+Typedef members:
+
+ bits -- the target type when copying the leading bytes of a floating
+ point number. It is a typedef for uint32_t or uint64_t.
+
+ method -- tells us whether all bytes are copied or not.
+ It is a typedef for ieee_copy_all_bits_tag or ieee_copy_leading_bits_tag.
+
+Static data members:
+
+ sign, exponent, flag, significand -- bit masks that give the meaning of the
+ bits in the leading bytes.
+
+Static function members:
+
+ get_bits(), set_bits() -- provide access to the leading bytes.
+
+*/
+
+// ieee_tag version, float (32 bits) -----------------------------------------------
+
+#ifndef BOOST_FPCLASSIFY_VAX_FORMAT
+
+template<> struct fp_traits_non_native<float, single_precision>
+{
+ typedef ieee_copy_all_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7f800000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x007fffff);
+
+ typedef uint32_t bits;
+ static void get_bits(float x, uint32_t& a) { std::memcpy(&a, &x, 4); }
+ static void set_bits(float& x, uint32_t a) { std::memcpy(&x, &a, 4); }
+};
+
+// ieee_tag version, double (64 bits) ----------------------------------------------
+
+#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) \
+ || defined(__BORLANDC__) || defined(__CODEGEAR__)
+
+template<> struct fp_traits_non_native<double, double_precision>
+{
+ typedef ieee_copy_leading_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
+
+ typedef uint32_t bits;
+
+ static void get_bits(double x, uint32_t& a)
+ {
+ std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+ }
+
+ static void set_bits(double& x, uint32_t a)
+ {
+ std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+ }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 4);
+#else
+ BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+//..............................................................................
+
+#else
+
+template<> struct fp_traits_non_native<double, double_precision>
+{
+ typedef ieee_copy_all_bits_tag method;
+
+ static const uint64_t sign = ((uint64_t)0x80000000u) << 32;
+ static const uint64_t exponent = ((uint64_t)0x7ff00000) << 32;
+ static const uint64_t flag = 0;
+ static const uint64_t significand
+ = (((uint64_t)0x000fffff) << 32) + ((uint64_t)0xffffffffu);
+
+ typedef uint64_t bits;
+ static void get_bits(double x, uint64_t& a) { std::memcpy(&a, &x, 8); }
+ static void set_bits(double& x, uint64_t a) { std::memcpy(&x, &a, 8); }
+};
+
+#endif
+
+#endif // #ifndef BOOST_FPCLASSIFY_VAX_FORMAT
+
+// long double (64 bits) -------------------------------------------------------
+
+#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)\
+ || defined(__BORLANDC__) || defined(__CODEGEAR__)
+
+template<> struct fp_traits_non_native<long double, double_precision>
+{
+ typedef ieee_copy_leading_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
+
+ typedef uint32_t bits;
+
+ static void get_bits(long double x, uint32_t& a)
+ {
+ std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+ }
+
+ static void set_bits(long double& x, uint32_t a)
+ {
+ std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+ }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 4);
+#else
+ BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+//..............................................................................
+
+#else
+
+template<> struct fp_traits_non_native<long double, double_precision>
+{
+ typedef ieee_copy_all_bits_tag method;
+
+ static const uint64_t sign = (uint64_t)0x80000000u << 32;
+ static const uint64_t exponent = (uint64_t)0x7ff00000 << 32;
+ static const uint64_t flag = 0;
+ static const uint64_t significand
+ = ((uint64_t)0x000fffff << 32) + (uint64_t)0xffffffffu;
+
+ typedef uint64_t bits;
+ static void get_bits(long double x, uint64_t& a) { std::memcpy(&a, &x, 8); }
+ static void set_bits(long double& x, uint64_t a) { std::memcpy(&x, &a, 8); }
+};
+
+#endif
+
+
+// long double (>64 bits), x86 and x64 -----------------------------------------
+
+#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \
+ || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) \
+ || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64)
+
+// Intel extended double precision format (80 bits)
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+ typedef ieee_copy_leading_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00008000);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff);
+
+ typedef uint32_t bits;
+
+ static void get_bits(long double x, uint32_t& a)
+ {
+ std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + 6, 4);
+ }
+
+ static void set_bits(long double& x, uint32_t a)
+ {
+ std::memcpy(reinterpret_cast<unsigned char*>(&x) + 6, &a, 4);
+ }
+};
+
+
+// long double (>64 bits), Itanium ---------------------------------------------
+
+#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64)
+
+// The floating point format is unknown at compile time
+// No template specialization is provided.
+// The generic_tag definition is used.
+
+// The Itanium supports both
+// the Intel extended double precision format (80 bits) and
+// the IEEE extended double precision format with 15 exponent bits (128 bits).
+
+
+// long double (>64 bits), PowerPC ---------------------------------------------
+
+#elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) \
+ || defined(__ppc) || defined(__ppc__) || defined(__PPC__)
+
+// PowerPC extended double precision format (128 bits)
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+ typedef ieee_copy_leading_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff);
+
+ typedef uint32_t bits;
+
+ static void get_bits(long double x, uint32_t& a)
+ {
+ std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+ }
+
+ static void set_bits(long double& x, uint32_t a)
+ {
+ std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+ }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 12);
+#else
+ BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+
+// long double (>64 bits), Motorola 68K ----------------------------------------
+
+#elif defined(__m68k) || defined(__m68k__) \
+ || defined(__mc68000) || defined(__mc68000__) \
+
+// Motorola extended double precision format (96 bits)
+
+// It is the same format as the Intel extended double precision format,
+// except that 1) it is big-endian, 2) the 3rd and 4th byte are padding, and
+// 3) the flag bit is not set for infinity
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+ typedef ieee_copy_leading_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00008000);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff);
+
+ // copy 1st, 2nd, 5th and 6th byte. 3rd and 4th byte are padding.
+
+ typedef uint32_t bits;
+
+ static void get_bits(long double x, uint32_t& a)
+ {
+ std::memcpy(&a, &x, 2);
+ std::memcpy(reinterpret_cast<unsigned char*>(&a) + 2,
+ reinterpret_cast<const unsigned char*>(&x) + 4, 2);
+ }
+
+ static void set_bits(long double& x, uint32_t a)
+ {
+ std::memcpy(&x, &a, 2);
+ std::memcpy(reinterpret_cast<unsigned char*>(&x) + 4,
+ reinterpret_cast<const unsigned char*>(&a) + 2, 2);
+ }
+};
+
+
+// long double (>64 bits), All other processors --------------------------------
+
+#else
+
+// IEEE extended double precision format with 15 exponent bits (128 bits)
+
+template<>
+struct fp_traits_non_native<long double, extended_double_precision>
+{
+ typedef ieee_copy_leading_bits_tag method;
+
+ BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u);
+ BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000);
+ BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000);
+ BOOST_STATIC_CONSTANT(uint32_t, significand = 0x0000ffff);
+
+ typedef uint32_t bits;
+
+ static void get_bits(long double x, uint32_t& a)
+ {
+ std::memcpy(&a, reinterpret_cast<const unsigned char*>(&x) + offset_, 4);
+ }
+
+ static void set_bits(long double& x, uint32_t a)
+ {
+ std::memcpy(reinterpret_cast<unsigned char*>(&x) + offset_, &a, 4);
+ }
+
+private:
+
+#if defined(BOOST_BIG_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 0);
+#elif defined(BOOST_LITTLE_ENDIAN)
+ BOOST_STATIC_CONSTANT(int, offset_ = 12);
+#else
+ BOOST_STATIC_ASSERT(false);
+#endif
+};
+
+#endif
+
+//------------------------------------------------------------------------------
+
+// size_to_precision is a type switch for converting a C++ floating point type
+// to the corresponding precision type.
+
+template<int n, bool fp> struct size_to_precision
+{
+ typedef unknown_precision type;
+};
+
+template<> struct size_to_precision<4, true>
+{
+ typedef single_precision type;
+};
+
+template<> struct size_to_precision<8, true>
+{
+ typedef double_precision type;
+};
+
+template<> struct size_to_precision<10, true>
+{
+ typedef extended_double_precision type;
+};
+
+template<> struct size_to_precision<12, true>
+{
+ typedef extended_double_precision type;
+};
+
+template<> struct size_to_precision<16, true>
+{
+ typedef extended_double_precision type;
+};
+
+//------------------------------------------------------------------------------
+//
+// Figure out whether to use native classification functions based on
+// whether T is a built in floating point type or not:
+//
+template <class T>
+struct select_native
+{
+ typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::ndnboost::is_floating_point<T>::value>::type precision;
+ typedef fp_traits_non_native<T, precision> type;
+};
+template<>
+struct select_native<float>
+{
+ typedef fp_traits_native<float> type;
+};
+template<>
+struct select_native<double>
+{
+ typedef fp_traits_native<double> type;
+};
+template<>
+struct select_native<long double>
+{
+ typedef fp_traits_native<long double> type;
+};
+
+//------------------------------------------------------------------------------
+
+// fp_traits is a type switch that selects the right fp_traits_non_native
+
+#if (defined(BOOST_MATH_USE_C99) && !(defined(__GNUC__) && (__GNUC__ < 4))) \
+ && !defined(__hpux) \
+ && !defined(__DECCXX)\
+ && !defined(__osf__) \
+ && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)\
+ && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+# define BOOST_MATH_USE_STD_FPCLASSIFY
+#endif
+
+template<class T> struct fp_traits
+{
+ typedef BOOST_DEDUCED_TYPENAME size_to_precision<sizeof(T), ::ndnboost::is_floating_point<T>::value>::type precision;
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+ typedef typename select_native<T>::type type;
+#else
+ typedef fp_traits_non_native<T, precision> type;
+#endif
+ typedef fp_traits_non_native<T, precision> sign_change_type;
+};
+
+//------------------------------------------------------------------------------
+
+} // namespace detail
+} // namespace math
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/math/special_functions/detail/round_fwd.hpp b/ndnboost/math/special_functions/detail/round_fwd.hpp
new file mode 100644
index 0000000..62d9390
--- /dev/null
+++ b/ndnboost/math/special_functions/detail/round_fwd.hpp
@@ -0,0 +1,93 @@
+// Copyright John Maddock 2008.
+
+// 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_MATH_SPECIAL_ROUND_FWD_HPP
+#define BOOST_MATH_SPECIAL_ROUND_FWD_HPP
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/math/tools/promotion.hpp>
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+namespace ndnboost
+{
+ namespace math
+ {
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type trunc(const T& v, const Policy& pol);
+ template <class T>
+ typename tools::promote_args<T>::type trunc(const T& v);
+ template <class T, class Policy>
+ int itrunc(const T& v, const Policy& pol);
+ template <class T>
+ int itrunc(const T& v);
+ template <class T, class Policy>
+ long ltrunc(const T& v, const Policy& pol);
+ template <class T>
+ long ltrunc(const T& v);
+#ifdef BOOST_HAS_LONG_LONG
+ template <class T, class Policy>
+ ndnboost::long_long_type lltrunc(const T& v, const Policy& pol);
+ template <class T>
+ ndnboost::long_long_type lltrunc(const T& v);
+#endif
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type round(const T& v, const Policy& pol);
+ template <class T>
+ typename tools::promote_args<T>::type round(const T& v);
+ template <class T, class Policy>
+ int iround(const T& v, const Policy& pol);
+ template <class T>
+ int iround(const T& v);
+ template <class T, class Policy>
+ long lround(const T& v, const Policy& pol);
+ template <class T>
+ long lround(const T& v);
+#ifdef BOOST_HAS_LONG_LONG
+ template <class T, class Policy>
+ ndnboost::long_long_type llround(const T& v, const Policy& pol);
+ template <class T>
+ ndnboost::long_long_type llround(const T& v);
+#endif
+ template <class T, class Policy>
+ T modf(const T& v, T* ipart, const Policy& pol);
+ template <class T>
+ T modf(const T& v, T* ipart);
+ template <class T, class Policy>
+ T modf(const T& v, int* ipart, const Policy& pol);
+ template <class T>
+ T modf(const T& v, int* ipart);
+ template <class T, class Policy>
+ T modf(const T& v, long* ipart, const Policy& pol);
+ template <class T>
+ T modf(const T& v, long* ipart);
+#ifdef BOOST_HAS_LONG_LONG
+ template <class T, class Policy>
+ T modf(const T& v, ndnboost::long_long_type* ipart, const Policy& pol);
+ template <class T>
+ T modf(const T& v, ndnboost::long_long_type* ipart);
+#endif
+
+ }
+}
+
+#undef BOOST_MATH_STD_USING
+#define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE\
+ using ndnboost::math::round;\
+ using ndnboost::math::iround;\
+ using ndnboost::math::lround;\
+ using ndnboost::math::trunc;\
+ using ndnboost::math::itrunc;\
+ using ndnboost::math::ltrunc;\
+ using ndnboost::math::modf;
+
+
+#endif // BOOST_MATH_SPECIAL_ROUND_FWD_HPP
+
diff --git a/ndnboost/math/special_functions/fpclassify.hpp b/ndnboost/math/special_functions/fpclassify.hpp
new file mode 100644
index 0000000..0eeea57
--- /dev/null
+++ b/ndnboost/math/special_functions/fpclassify.hpp
@@ -0,0 +1,606 @@
+// Copyright John Maddock 2005-2008.
+// Copyright (c) 2006-2008 Johan Rade
+// 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_MATH_FPCLASSIFY_HPP
+#define BOOST_MATH_FPCLASSIFY_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <math.h>
+#include <ndnboost/config/no_tr1/cmath.hpp>
+#include <ndnboost/limits.hpp>
+#include <ndnboost/math/tools/real_cast.hpp>
+#include <ndnboost/type_traits/is_floating_point.hpp>
+#include <ndnboost/math/special_functions/math_fwd.hpp>
+#include <ndnboost/math/special_functions/detail/fp_traits.hpp>
+/*!
+ \file fpclassify.hpp
+ \brief Classify floating-point value as normal, subnormal, zero, infinite, or NaN.
+ \version 1.0
+ \author John Maddock
+ */
+
+/*
+
+1. If the platform is C99 compliant, then the native floating point
+classification functions are used. However, note that we must only
+define the functions which call std::fpclassify etc if that function
+really does exist: otherwise a compiler may reject the code even though
+the template is never instantiated.
+
+2. If the platform is not C99 compliant, and the binary format for
+a floating point type (float, double or long double) can be determined
+at compile time, then the following algorithm is used:
+
+ If all exponent bits, the flag bit (if there is one),
+ and all significand bits are 0, then the number is zero.
+
+ If all exponent bits and the flag bit (if there is one) are 0,
+ and at least one significand bit is 1, then the number is subnormal.
+
+ If all exponent bits are 1 and all significand bits are 0,
+ then the number is infinity.
+
+ If all exponent bits are 1 and at least one significand bit is 1,
+ then the number is a not-a-number.
+
+ Otherwise the number is normal.
+
+ This algorithm works for the IEEE 754 representation,
+ and also for several non IEEE 754 formats.
+
+ Most formats have the structure
+ sign bit + exponent bits + significand bits.
+
+ A few have the structure
+ sign bit + exponent bits + flag bit + significand bits.
+ The flag bit is 0 for zero and subnormal numbers,
+ and 1 for normal numbers and NaN.
+ It is 0 (Motorola 68K) or 1 (Intel) for infinity.
+
+ To get the bits, the four or eight most significant bytes are copied
+ into an uint32_t or uint64_t and bit masks are applied.
+ This covers all the exponent bits and the flag bit (if there is one),
+ but not always all the significand bits.
+ Some of the functions below have two implementations,
+ depending on whether all the significand bits are copied or not.
+
+3. If the platform is not C99 compliant, and the binary format for
+a floating point type (float, double or long double) can not be determined
+at compile time, then comparison with std::numeric_limits values
+is used.
+
+*/
+
+#if defined(_MSC_VER) || defined(__BORLANDC__)
+#include <float.h>
+#endif
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+ namespace std{ using ::abs; using ::fabs; }
+#endif
+
+namespace ndnboost{
+
+//
+// This must not be located in any namespace under ndnboost::math
+// otherwise we can get into an infinite loop if isnan is
+// a #define for "isnan" !
+//
+namespace math_detail{
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4800)
+#endif
+
+template <class T>
+inline bool is_nan_helper(T t, const ndnboost::true_type&)
+{
+#ifdef isnan
+ return isnan(t);
+#elif defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) || !defined(BOOST_HAS_FPCLASSIFY)
+ (void)t;
+ return false;
+#else // BOOST_HAS_FPCLASSIFY
+ return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == (int)FP_NAN);
+#endif
+}
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+template <class T>
+inline bool is_nan_helper(T, const ndnboost::false_type&)
+{
+ return false;
+}
+
+}
+
+namespace math{
+
+namespace detail{
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+template <class T>
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const native_tag&)
+{
+ return (std::fpclassify)(t);
+}
+#endif
+
+template <class T>
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag<true>&)
+{
+ BOOST_MATH_INSTRUMENT_VARIABLE(t);
+
+ // whenever possible check for Nan's first:
+#if defined(BOOST_HAS_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY)
+ if(::ndnboost::math_detail::is_nan_helper(t, ::ndnboost::is_floating_point<T>()))
+ return FP_NAN;
+#elif defined(isnan)
+ if(ndnboost::math_detail::is_nan_helper(t, ::ndnboost::is_floating_point<T>()))
+ return FP_NAN;
+#elif defined(_MSC_VER) || defined(__BORLANDC__)
+ if(::_isnan(ndnboost::math::tools::real_cast<double>(t)))
+ return FP_NAN;
+#endif
+ // std::fabs broken on a few systems especially for long long!!!!
+ T at = (t < T(0)) ? -t : t;
+
+ // Use a process of exclusion to figure out
+ // what kind of type we have, this relies on
+ // IEEE conforming reals that will treat
+ // Nan's as unordered. Some compilers
+ // don't do this once optimisations are
+ // turned on, hence the check for nan's above.
+ if(at <= (std::numeric_limits<T>::max)())
+ {
+ if(at >= (std::numeric_limits<T>::min)())
+ return FP_NORMAL;
+ return (at != 0) ? FP_SUBNORMAL : FP_ZERO;
+ }
+ else if(at > (std::numeric_limits<T>::max)())
+ return FP_INFINITE;
+ return FP_NAN;
+}
+
+template <class T>
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag<false>&)
+{
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<T>::is_specialized)
+ return fpclassify_imp(t, generic_tag<true>());
+#endif
+ //
+ // An unknown type with no numeric_limits support,
+ // so what are we supposed to do we do here?
+ //
+ BOOST_MATH_INSTRUMENT_VARIABLE(t);
+
+ return t == 0 ? FP_ZERO : FP_NORMAL;
+}
+
+template<class T>
+int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_all_bits_tag)
+{
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_MATH_INSTRUMENT_VARIABLE(x);
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ BOOST_MATH_INSTRUMENT_VARIABLE(a);
+ a &= traits::exponent | traits::flag | traits::significand;
+ BOOST_MATH_INSTRUMENT_VARIABLE((traits::exponent | traits::flag | traits::significand));
+ BOOST_MATH_INSTRUMENT_VARIABLE(a);
+
+ if(a <= traits::significand) {
+ if(a == 0)
+ return FP_ZERO;
+ else
+ return FP_SUBNORMAL;
+ }
+
+ if(a < traits::exponent) return FP_NORMAL;
+
+ a &= traits::significand;
+ if(a == 0) return FP_INFINITE;
+
+ return FP_NAN;
+}
+
+template<class T>
+int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_leading_bits_tag)
+{
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_MATH_INSTRUMENT_VARIABLE(x);
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a &= traits::exponent | traits::flag | traits::significand;
+
+ if(a <= traits::significand) {
+ if(x == 0)
+ return FP_ZERO;
+ else
+ return FP_SUBNORMAL;
+ }
+
+ if(a < traits::exponent) return FP_NORMAL;
+
+ a &= traits::significand;
+ traits::set_bits(x,a);
+ if(x == 0) return FP_INFINITE;
+
+ return FP_NAN;
+}
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && (defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) || defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS))
+inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return ndnboost::math::detail::fpclassify_imp(t, generic_tag<true>());
+}
+#endif
+
+} // namespace detail
+
+template <class T>
+inline int fpclassify BOOST_NO_MACRO_EXPAND(T t)
+{
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+ typedef typename tools::promote_args<T>::type value_type;
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<T>::is_specialized && detail::is_generic_tag_false(static_cast<method*>(0)))
+ return detail::fpclassify_imp(static_cast<value_type>(t), detail::generic_tag<true>());
+ return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#else
+ return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#endif
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template <>
+inline int fpclassify<long double> BOOST_NO_MACRO_EXPAND(long double t)
+{
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+ typedef long double value_type;
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<long double>::is_specialized && detail::is_generic_tag_false(static_cast<method*>(0)))
+ return detail::fpclassify_imp(static_cast<value_type>(t), detail::generic_tag<true>());
+ return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#else
+ return detail::fpclassify_imp(static_cast<value_type>(t), method());
+#endif
+}
+#endif
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+ template<class T>
+ inline bool isfinite_impl(T x, native_tag const&)
+ {
+ return (std::isfinite)(x);
+ }
+#endif
+
+ template<class T>
+ inline bool isfinite_impl(T x, generic_tag<true> const&)
+ {
+ return x >= -(std::numeric_limits<T>::max)()
+ && x <= (std::numeric_limits<T>::max)();
+ }
+
+ template<class T>
+ inline bool isfinite_impl(T x, generic_tag<false> const&)
+ {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<T>::is_specialized)
+ return isfinite_impl(x, generic_tag<true>());
+#endif
+ (void)x; // warning supression.
+ return true;
+ }
+
+ template<class T>
+ inline bool isfinite_impl(T x, ieee_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME detail::fp_traits<T>::type traits;
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a &= traits::exponent;
+ return a != traits::exponent;
+ }
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+inline bool isfinite_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return ndnboost::math::detail::isfinite_impl(t, generic_tag<true>());
+}
+#endif
+
+}
+
+template<class T>
+inline bool (isfinite)(T x)
+{ //!< \brief return true if floating-point type t is finite.
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+ // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type value_type;
+ return detail::isfinite_impl(static_cast<value_type>(x), method());
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template<>
+inline bool (isfinite)(long double x)
+{ //!< \brief return true if floating-point type t is finite.
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+ typedef ndnboost::is_floating_point<long double>::type fp_tag;
+ typedef long double value_type;
+ return detail::isfinite_impl(static_cast<value_type>(x), method());
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+ template<class T>
+ inline bool isnormal_impl(T x, native_tag const&)
+ {
+ return (std::isnormal)(x);
+ }
+#endif
+
+ template<class T>
+ inline bool isnormal_impl(T x, generic_tag<true> const&)
+ {
+ if(x < 0) x = -x;
+ return x >= (std::numeric_limits<T>::min)()
+ && x <= (std::numeric_limits<T>::max)();
+ }
+
+ template<class T>
+ inline bool isnormal_impl(T x, generic_tag<false> const&)
+ {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<T>::is_specialized)
+ return isnormal_impl(x, generic_tag<true>());
+#endif
+ return !(x == 0);
+ }
+
+ template<class T>
+ inline bool isnormal_impl(T x, ieee_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME detail::fp_traits<T>::type traits;
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a &= traits::exponent | traits::flag;
+ return (a != 0) && (a < traits::exponent);
+ }
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+inline bool isnormal_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return ndnboost::math::detail::isnormal_impl(t, generic_tag<true>());
+}
+#endif
+
+}
+
+template<class T>
+inline bool (isnormal)(T x)
+{
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+ //typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type value_type;
+ return detail::isnormal_impl(static_cast<value_type>(x), method());
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template<>
+inline bool (isnormal)(long double x)
+{
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+ typedef ndnboost::is_floating_point<long double>::type fp_tag;
+ typedef long double value_type;
+ return detail::isnormal_impl(static_cast<value_type>(x), method());
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+ template<class T>
+ inline bool isinf_impl(T x, native_tag const&)
+ {
+ return (std::isinf)(x);
+ }
+#endif
+
+ template<class T>
+ inline bool isinf_impl(T x, generic_tag<true> const&)
+ {
+ (void)x; // in case the compiler thinks that x is unused because std::numeric_limits<T>::has_infinity is false
+ return std::numeric_limits<T>::has_infinity
+ && ( x == std::numeric_limits<T>::infinity()
+ || x == -std::numeric_limits<T>::infinity());
+ }
+
+ template<class T>
+ inline bool isinf_impl(T x, generic_tag<false> const&)
+ {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<T>::is_specialized)
+ return isinf_impl(x, generic_tag<true>());
+#endif
+ (void)x; // warning supression.
+ return false;
+ }
+
+ template<class T>
+ inline bool isinf_impl(T x, ieee_copy_all_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a &= traits::exponent | traits::significand;
+ return a == traits::exponent;
+ }
+
+ template<class T>
+ inline bool isinf_impl(T x, ieee_copy_leading_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a &= traits::exponent | traits::significand;
+ if(a != traits::exponent)
+ return false;
+
+ traits::set_bits(x,0);
+ return x == 0;
+ }
+
+#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY)
+inline bool isinf_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&)
+{
+ return ndnboost::math::detail::isinf_impl(t, generic_tag<true>());
+}
+#endif
+
+} // namespace detail
+
+template<class T>
+inline bool (isinf)(T x)
+{
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+ // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type value_type;
+ return detail::isinf_impl(static_cast<value_type>(x), method());
+}
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+template<>
+inline bool (isinf)(long double x)
+{
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+ typedef ndnboost::is_floating_point<long double>::type fp_tag;
+ typedef long double value_type;
+ return detail::isinf_impl(static_cast<value_type>(x), method());
+}
+#endif
+
+//------------------------------------------------------------------------------
+
+namespace detail {
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+ template<class T>
+ inline bool isnan_impl(T x, native_tag const&)
+ {
+ return (std::isnan)(x);
+ }
+#endif
+
+ template<class T>
+ inline bool isnan_impl(T x, generic_tag<true> const&)
+ {
+ return std::numeric_limits<T>::has_infinity
+ ? !(x <= std::numeric_limits<T>::infinity())
+ : x != x;
+ }
+
+ template<class T>
+ inline bool isnan_impl(T x, generic_tag<false> const&)
+ {
+#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ if(std::numeric_limits<T>::is_specialized)
+ return isnan_impl(x, generic_tag<true>());
+#endif
+ (void)x; // warning supression
+ return false;
+ }
+
+ template<class T>
+ inline bool isnan_impl(T x, ieee_copy_all_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a &= traits::exponent | traits::significand;
+ return a > traits::exponent;
+ }
+
+ template<class T>
+ inline bool isnan_impl(T x, ieee_copy_leading_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+
+ a &= traits::exponent | traits::significand;
+ if(a < traits::exponent)
+ return false;
+
+ a &= traits::significand;
+ traits::set_bits(x,a);
+ return x != 0;
+ }
+
+} // namespace detail
+
+template<class T>
+inline bool (isnan)(T x)
+{ //!< \brief return true if floating-point type t is NaN (Not A Number).
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+ // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+ return detail::isnan_impl(x, method());
+}
+
+#ifdef isnan
+template <> inline bool isnan BOOST_NO_MACRO_EXPAND<float>(float t){ return ::ndnboost::math_detail::is_nan_helper(t, ndnboost::true_type()); }
+template <> inline bool isnan BOOST_NO_MACRO_EXPAND<double>(double t){ return ::ndnboost::math_detail::is_nan_helper(t, ndnboost::true_type()); }
+template <> inline bool isnan BOOST_NO_MACRO_EXPAND<long double>(long double t){ return ::ndnboost::math_detail::is_nan_helper(t, ndnboost::true_type()); }
+#elif defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+template<>
+inline bool (isnan)(long double x)
+{ //!< \brief return true if floating-point type t is NaN (Not A Number).
+ typedef detail::fp_traits<long double>::type traits;
+ typedef traits::method method;
+ typedef ndnboost::is_floating_point<long double>::type fp_tag;
+ return detail::isnan_impl(x, method());
+}
+#endif
+
+} // namespace math
+} // namespace ndnboost
+
+#endif // BOOST_MATH_FPCLASSIFY_HPP
+
diff --git a/ndnboost/math/special_functions/math_fwd.hpp b/ndnboost/math/special_functions/math_fwd.hpp
new file mode 100644
index 0000000..aeb7b4c
--- /dev/null
+++ b/ndnboost/math/special_functions/math_fwd.hpp
@@ -0,0 +1,1408 @@
+// math_fwd.hpp
+
+// TODO revise completely for new distribution classes.
+
+// Copyright Paul A. Bristow 2006.
+// Copyright John Maddock 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)
+
+// Omnibus list of forward declarations of math special functions.
+
+// IT = Integer type.
+// RT = Real type (built-in floating-point types, float, double, long double) & User Defined Types
+// AT = Integer or Real type
+
+#ifndef BOOST_MATH_SPECIAL_MATH_FWD_HPP
+#define BOOST_MATH_SPECIAL_MATH_FWD_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <ndnboost/math/special_functions/detail/round_fwd.hpp>
+#include <ndnboost/math/tools/promotion.hpp> // for argument promotion.
+#include <ndnboost/math/policies/policy.hpp>
+#include <ndnboost/mpl/comparison.hpp>
+#include <ndnboost/config/no_tr1/complex.hpp>
+
+#define BOOST_NO_MACRO_EXPAND /**/
+
+namespace ndnboost
+{
+ namespace math
+ { // Math functions (in roughly alphabetic order).
+
+ // Beta functions.
+ template <class RT1, class RT2>
+ typename tools::promote_args<RT1, RT2>::type
+ beta(RT1 a, RT2 b); // Beta function (2 arguments).
+
+ template <class RT1, class RT2, class A>
+ typename tools::promote_args<RT1, RT2, A>::type
+ beta(RT1 a, RT2 b, A x); // Beta function (3 arguments).
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ beta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Beta function (3 arguments).
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ betac(RT1 a, RT2 b, RT3 x);
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ betac(RT1 a, RT2 b, RT3 x, const Policy& pol);
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta(RT1 a, RT2 b, RT3 x); // Incomplete beta function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta function.
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac(RT1 a, RT2 b, RT3 x); // Incomplete beta complement function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta complement function.
+
+ template <class T1, class T2, class T3, class T4>
+ typename tools::promote_args<T1, T2, T3, T4>::type
+ ibeta_inv(T1 a, T2 b, T3 p, T4* py);
+
+ template <class T1, class T2, class T3, class T4, class Policy>
+ typename tools::promote_args<T1, T2, T3, T4>::type
+ ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol);
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_inv(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_inv(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_inva(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_inva(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_invb(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_invb(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function.
+
+ template <class T1, class T2, class T3, class T4>
+ typename tools::promote_args<T1, T2, T3, T4>::type
+ ibetac_inv(T1 a, T2 b, T3 q, T4* py);
+
+ template <class T1, class T2, class T3, class T4, class Policy>
+ typename tools::promote_args<T1, T2, T3, T4>::type
+ ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol);
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac_inv(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac_inva(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac_inva(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac_invb(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function.
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibetac_invb(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function.
+
+ template <class RT1, class RT2, class RT3>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_derivative(RT1 a, RT2 b, RT3 x); // derivative of incomplete beta
+
+ template <class RT1, class RT2, class RT3, class Policy>
+ typename tools::promote_args<RT1, RT2, RT3>::type
+ ibeta_derivative(RT1 a, RT2 b, RT3 x, const Policy& pol); // derivative of incomplete beta
+
+ // erf & erfc error functions.
+ template <class RT> // Error function.
+ typename tools::promote_args<RT>::type erf(RT z);
+ template <class RT, class Policy> // Error function.
+ typename tools::promote_args<RT>::type erf(RT z, const Policy&);
+
+ template <class RT>// Error function complement.
+ typename tools::promote_args<RT>::type erfc(RT z);
+ template <class RT, class Policy>// Error function complement.
+ typename tools::promote_args<RT>::type erfc(RT z, const Policy&);
+
+ template <class RT>// Error function inverse.
+ typename tools::promote_args<RT>::type erf_inv(RT z);
+ template <class RT, class Policy>// Error function inverse.
+ typename tools::promote_args<RT>::type erf_inv(RT z, const Policy& pol);
+
+ template <class RT>// Error function complement inverse.
+ typename tools::promote_args<RT>::type erfc_inv(RT z);
+ template <class RT, class Policy>// Error function complement inverse.
+ typename tools::promote_args<RT>::type erfc_inv(RT z, const Policy& pol);
+
+ // Polynomials:
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1);
+
+ template <class T>
+ typename tools::promote_args<T>::type
+ legendre_p(int l, T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type
+ legendre_p(int l, T x, const Policy& pol);
+
+ template <class T>
+ typename tools::promote_args<T>::type
+ legendre_q(unsigned l, T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type
+ legendre_q(unsigned l, T x, const Policy& pol);
+
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1);
+
+ template <class T>
+ typename tools::promote_args<T>::type
+ legendre_p(int l, int m, T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type
+ legendre_p(int l, int m, T x, const Policy& pol);
+
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ laguerre_next(unsigned n, T1 x, T2 Ln, T3 Lnm1);
+
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ laguerre_next(unsigned n, unsigned l, T1 x, T2 Pl, T3 Plm1);
+
+ template <class T>
+ typename tools::promote_args<T>::type
+ laguerre(unsigned n, T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type
+ laguerre(unsigned n, unsigned m, T x, const Policy& pol);
+
+ template <class T1, class T2>
+ struct laguerre_result
+ {
+ typedef typename mpl::if_<
+ policies::is_policy<T2>,
+ typename tools::promote_args<T1>::type,
+ typename tools::promote_args<T2>::type
+ >::type type;
+ };
+
+ template <class T1, class T2>
+ typename laguerre_result<T1, T2>::type
+ laguerre(unsigned n, T1 m, T2 x);
+
+ template <class T>
+ typename tools::promote_args<T>::type
+ hermite(unsigned n, T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type
+ hermite(unsigned n, T x, const Policy& pol);
+
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1);
+
+ template <class T1, class T2>
+ std::complex<typename tools::promote_args<T1, T2>::type>
+ spherical_harmonic(unsigned n, int m, T1 theta, T2 phi);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename tools::promote_args<T1, T2>::type>
+ spherical_harmonic(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type
+ spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type
+ spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type
+ spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type
+ spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);
+
+ // Elliptic integrals:
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ ellint_rf(T1 x, T2 y, T3 z);
+
+ template <class T1, class T2, class T3, class Policy>
+ typename tools::promote_args<T1, T2, T3>::type
+ ellint_rf(T1 x, T2 y, T3 z, const Policy& pol);
+
+ template <class T1, class T2, class T3>
+ typename tools::promote_args<T1, T2, T3>::type
+ ellint_rd(T1 x, T2 y, T3 z);
+
+ template <class T1, class T2, class T3, class Policy>
+ typename tools::promote_args<T1, T2, T3>::type
+ ellint_rd(T1 x, T2 y, T3 z, const Policy& pol);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type
+ ellint_rc(T1 x, T2 y);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type
+ ellint_rc(T1 x, T2 y, const Policy& pol);
+
+ template <class T1, class T2, class T3, class T4>
+ typename tools::promote_args<T1, T2, T3, T4>::type
+ ellint_rj(T1 x, T2 y, T3 z, T4 p);
+
+ template <class T1, class T2, class T3, class T4, class Policy>
+ typename tools::promote_args<T1, T2, T3, T4>::type
+ ellint_rj(T1 x, T2 y, T3 z, T4 p, const Policy& pol);
+
+ template <typename T>
+ typename tools::promote_args<T>::type ellint_2(T k);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi, const Policy& pol);
+
+ template <typename T>
+ typename tools::promote_args<T>::type ellint_1(T k);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi, const Policy& pol);
+
+ namespace detail{
+
+ template <class T, class U, class V>
+ struct ellint_3_result
+ {
+ typedef typename mpl::if_<
+ policies::is_policy<V>,
+ typename tools::promote_args<T, U>::type,
+ typename tools::promote_args<T, U, V>::type
+ >::type type;
+ };
+
+ } // namespace detail
+
+
+ template <class T1, class T2, class T3>
+ typename detail::ellint_3_result<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi);
+
+ template <class T1, class T2, class T3, class Policy>
+ typename tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi, const Policy& pol);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v);
+
+ // Factorial functions.
+ // Note: not for integral types, at present.
+ template <class RT>
+ struct max_factorial;
+ template <class RT>
+ RT factorial(unsigned int);
+ template <class RT, class Policy>
+ RT factorial(unsigned int, const Policy& pol);
+ template <class RT>
+ RT unchecked_factorial(unsigned int BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(RT));
+ template <class RT>
+ RT double_factorial(unsigned i);
+ template <class RT, class Policy>
+ RT double_factorial(unsigned i, const Policy& pol);
+
+ template <class RT>
+ typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n);
+
+ template <class RT, class Policy>
+ typename tools::promote_args<RT>::type falling_factorial(RT x, unsigned n, const Policy& pol);
+
+ template <class RT>
+ typename tools::promote_args<RT>::type rising_factorial(RT x, int n);
+
+ template <class RT, class Policy>
+ typename tools::promote_args<RT>::type rising_factorial(RT x, int n, const Policy& pol);
+
+ // Gamma functions.
+ template <class RT>
+ typename tools::promote_args<RT>::type tgamma(RT z);
+
+ template <class RT>
+ typename tools::promote_args<RT>::type tgamma1pm1(RT z);
+
+ template <class RT, class Policy>
+ typename tools::promote_args<RT>::type tgamma1pm1(RT z, const Policy& pol);
+
+ template <class RT1, class RT2>
+ typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z);
+
+ template <class RT1, class RT2, class Policy>
+ typename tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z, const Policy& pol);
+
+ template <class RT>
+ typename tools::promote_args<RT>::type lgamma(RT z, int* sign);
+
+ template <class RT, class Policy>
+ typename tools::promote_args<RT>::type lgamma(RT z, int* sign, const Policy& pol);
+
+ template <class RT>
+ typename tools::promote_args<RT>::type lgamma(RT x);
+
+ template <class RT, class Policy>
+ typename tools::promote_args<RT>::type lgamma(RT x, const Policy& pol);
+
+ template <class RT1, class RT2>
+ typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z);
+
+ template <class RT1, class RT2, class Policy>
+ typename tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z, const Policy&);
+
+ template <class RT1, class RT2>
+ typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z);
+
+ template <class RT1, class RT2, class Policy>
+ typename tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z, const Policy&);
+
+ template <class RT1, class RT2>
+ typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z);
+
+ template <class RT1, class RT2, class Policy>
+ typename tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z, const Policy&);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta, const Policy&);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b, const Policy&);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x, const Policy&);
+
+ // gamma inverse.
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p, const Policy&);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p, const Policy&);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q, const Policy&);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q, const Policy&);
+
+ // digamma:
+ template <class T>
+ typename tools::promote_args<T>::type digamma(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type digamma(T x, const Policy&);
+
+ // Hypotenuse function sqrt(x ^ 2 + y ^ 2).
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type
+ hypot(T1 x, T2 y);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type
+ hypot(T1 x, T2 y, const Policy&);
+
+ // cbrt - cube root.
+ template <class RT>
+ typename tools::promote_args<RT>::type cbrt(RT z);
+
+ template <class RT, class Policy>
+ typename tools::promote_args<RT>::type cbrt(RT z, const Policy&);
+
+ // log1p is log(x + 1)
+ template <class T>
+ typename tools::promote_args<T>::type log1p(T);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type log1p(T, const Policy&);
+
+ // log1pmx is log(x + 1) - x
+ template <class T>
+ typename tools::promote_args<T>::type log1pmx(T);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type log1pmx(T, const Policy&);
+
+ // Exp (x) minus 1 functions.
+ template <class T>
+ typename tools::promote_args<T>::type expm1(T);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type expm1(T, const Policy&);
+
+ // Power - 1
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type
+ powm1(const T1 a, const T2 z);
+
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type
+ powm1(const T1 a, const T2 z, const Policy&);
+
+ // sqrt(1+x) - 1
+ template <class T>
+ typename tools::promote_args<T>::type sqrt1pm1(const T& val);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type sqrt1pm1(const T& val, const Policy&);
+
+ // sinus cardinals:
+ template <class T>
+ typename tools::promote_args<T>::type sinc_pi(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type sinc_pi(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type sinhc_pi(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type sinhc_pi(T x, const Policy&);
+
+ // inverse hyperbolics:
+ template<typename T>
+ typename tools::promote_args<T>::type asinh(T x);
+
+ template<typename T, class Policy>
+ typename tools::promote_args<T>::type asinh(T x, const Policy&);
+
+ template<typename T>
+ typename tools::promote_args<T>::type acosh(T x);
+
+ template<typename T, class Policy>
+ typename tools::promote_args<T>::type acosh(T x, const Policy&);
+
+ template<typename T>
+ typename tools::promote_args<T>::type atanh(T x);
+
+ template<typename T, class Policy>
+ typename tools::promote_args<T>::type atanh(T x, const Policy&);
+
+ namespace detail{
+
+ typedef mpl::int_<0> bessel_no_int_tag; // No integer optimisation possible.
+ typedef mpl::int_<1> bessel_maybe_int_tag; // Maybe integer optimisation.
+ typedef mpl::int_<2> bessel_int_tag; // Definite integer optimistaion.
+
+ template <class T1, class T2, class Policy>
+ struct bessel_traits
+ {
+ typedef typename tools::promote_args<
+ T1, T2
+ >::type result_type;
+
+ typedef typename policies::precision<result_type, Policy>::type precision_type;
+
+ typedef typename mpl::if_<
+ mpl::or_<
+ mpl::less_equal<precision_type, mpl::int_<0> >,
+ mpl::greater<precision_type, mpl::int_<64> > >,
+ bessel_no_int_tag,
+ typename mpl::if_<
+ is_integral<T1>,
+ bessel_int_tag,
+ bessel_maybe_int_tag
+ >::type
+ >::type optimisation_tag;
+ };
+ } // detail
+
+ // Bessel functions:
+ template <class T1, class T2, class Policy>
+ typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_j(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_j(T1 v, T2 x);
+
+ template <class T, class Policy>
+ typename detail::bessel_traits<T, T, Policy>::result_type sph_bessel(unsigned v, T x, const Policy& pol);
+
+ template <class T>
+ typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_bessel(unsigned v, T x);
+
+ template <class T1, class T2, class Policy>
+ typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_i(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_i(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_bessel_k(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_bessel_k(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ typename detail::bessel_traits<T1, T2, Policy>::result_type cyl_neumann(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type cyl_neumann(T1 v, T2 x);
+
+ template <class T, class Policy>
+ typename detail::bessel_traits<T, T, Policy>::result_type sph_neumann(unsigned v, T x, const Policy& pol);
+
+ template <class T>
+ typename detail::bessel_traits<T, T, policies::policy<> >::result_type sph_neumann(unsigned v, T x);
+
+ template <class T, class Policy>
+ typename detail::bessel_traits<T, T, Policy>::result_type cyl_bessel_j_zero(T v, int m, const Policy& pol);
+
+ template <class T>
+ typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_bessel_j_zero(T v, int m);
+
+ template <class T, class OutputIterator>
+ OutputIterator cyl_bessel_j_zero(T v,
+ int start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it);
+
+ template <class T, class OutputIterator, class Policy>
+ OutputIterator cyl_bessel_j_zero(T v,
+ int start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it,
+ const Policy&);
+
+ template <class T, class Policy>
+ typename detail::bessel_traits<T, T, Policy>::result_type cyl_neumann_zero(T v, int m, const Policy& pol);
+
+ template <class T>
+ typename detail::bessel_traits<T, T, policies::policy<> >::result_type cyl_neumann_zero(T v, int m);
+
+ template <class T, class OutputIterator>
+ OutputIterator cyl_neumann_zero(T v,
+ int start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it);
+
+ template <class T, class OutputIterator, class Policy>
+ OutputIterator cyl_neumann_zero(T v,
+ int start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it,
+ const Policy&);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_1(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_1(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> cyl_hankel_2(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> cyl_hankel_2(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_1(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_1(T1 v, T2 x);
+
+ template <class T1, class T2, class Policy>
+ std::complex<typename detail::bessel_traits<T1, T2, Policy>::result_type> sph_hankel_2(T1 v, T2 x, const Policy& pol);
+
+ template <class T1, class T2>
+ std::complex<typename detail::bessel_traits<T1, T2, policies::policy<> >::result_type> sph_hankel_2(T1 v, T2 x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type airy_ai(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type airy_ai(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type airy_bi(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type airy_bi(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type airy_ai_prime(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type airy_ai_prime(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type airy_bi_prime(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type airy_bi_prime(T x);
+
+ template <class T>
+ T airy_ai_zero(unsigned m);
+ template <class T, class Policy>
+ T airy_ai_zero(unsigned m, const Policy&);
+
+ template <class OutputIterator>
+ OutputIterator airy_ai_zero(
+ unsigned start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it);
+ template <class OutputIterator, class Policy>
+ OutputIterator airy_ai_zero(
+ unsigned start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it,
+ const Policy&);
+
+ template <class T>
+ T airy_bi_zero(unsigned m);
+ template <class T, class Policy>
+ T airy_bi_zero(unsigned m, const Policy&);
+
+ template <class OutputIterator>
+ OutputIterator airy_bi_zero(
+ unsigned start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it);
+ template <class OutputIterator, class Policy>
+ OutputIterator airy_bi_zero(
+ unsigned start_index,
+ unsigned number_of_zeros,
+ OutputIterator out_it,
+ const Policy&);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type sin_pi(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type sin_pi(T x);
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type cos_pi(T x, const Policy&);
+
+ template <class T>
+ typename tools::promote_args<T>::type cos_pi(T x);
+
+ template <class T>
+ int fpclassify BOOST_NO_MACRO_EXPAND(T t);
+
+ template <class T>
+ bool isfinite BOOST_NO_MACRO_EXPAND(T z);
+
+ template <class T>
+ bool isinf BOOST_NO_MACRO_EXPAND(T t);
+
+ template <class T>
+ bool isnan BOOST_NO_MACRO_EXPAND(T t);
+
+ template <class T>
+ bool isnormal BOOST_NO_MACRO_EXPAND(T t);
+
+ template<class T>
+ int signbit BOOST_NO_MACRO_EXPAND(T x);
+
+ template <class T>
+ int sign BOOST_NO_MACRO_EXPAND(const T& z);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y);
+
+ template <class T>
+ typename tools::promote_args<T>::type changesign BOOST_NO_MACRO_EXPAND(const T& z);
+
+ // Exponential integrals:
+ namespace detail{
+
+ template <class T, class U>
+ struct expint_result
+ {
+ typedef typename mpl::if_<
+ policies::is_policy<U>,
+ typename tools::promote_args<T>::type,
+ typename tools::promote_args<U>::type
+ >::type type;
+ };
+
+ } // namespace detail
+
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type expint(unsigned n, T z, const Policy&);
+
+ template <class T, class U>
+ typename detail::expint_result<T, U>::type expint(T const z, U const u);
+
+ template <class T>
+ typename tools::promote_args<T>::type expint(T z);
+
+ // Zeta:
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type zeta(T s, const Policy&);
+
+ // Owen's T function:
+ template <class T1, class T2, class Policy>
+ typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a, const Policy& pol);
+
+ template <class T1, class T2>
+ typename tools::promote_args<T1, T2>::type owens_t(T1 h, T2 a);
+
+ // Jacobi Functions:
+ template <class T, class U, class V, class Policy>
+ typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn, V* pdn, const Policy&);
+
+ template <class T, class U, class V>
+ typename tools::promote_args<T, U, V>::type jacobi_elliptic(T k, U theta, V* pcn = 0, V* pdn = 0);
+
+ template <class U, class T, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta, const Policy& pol);
+
+ template <class U, class T>
+ typename tools::promote_args<T, U>::type jacobi_sn(U k, T theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_cn(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_dn(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_cd(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_dc(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_ns(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_sd(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_ds(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_nc(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_nd(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_sc(T k, U theta);
+
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta, const Policy& pol);
+
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type jacobi_cs(T k, U theta);
+
+
+ template <class T>
+ typename tools::promote_args<T>::type zeta(T s);
+
+ // pow:
+ template <int N, typename T, class Policy>
+ typename tools::promote_args<T>::type pow(T base, const Policy& policy);
+
+ template <int N, typename T>
+ typename tools::promote_args<T>::type pow(T base);
+
+ // next:
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type nextafter(const T&, const U&, const Policy&);
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type nextafter(const T&, const U&);
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type float_next(const T&, const Policy&);
+ template <class T>
+ typename tools::promote_args<T>::type float_next(const T&);
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type float_prior(const T&, const Policy&);
+ template <class T>
+ typename tools::promote_args<T>::type float_prior(const T&);
+ template <class T, class U, class Policy>
+ typename tools::promote_args<T, U>::type float_distance(const T&, const U&, const Policy&);
+ template <class T, class U>
+ typename tools::promote_args<T, U>::type float_distance(const T&, const U&);
+ template <class T, class Policy>
+ typename tools::promote_args<T>::type float_advance(T val, int distance, const Policy& pol);
+ template <class T>
+ typename tools::promote_args<T>::type float_advance(const T& val, int distance);
+
+ } // namespace math
+} // namespace ndnboost
+
+#ifdef BOOST_HAS_LONG_LONG
+#define BOOST_MATH_DETAIL_LL_FUNC(Policy)\
+ \
+ template <class T>\
+ inline T modf(const T& v, ndnboost::long_long_type* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+ \
+ template <class T>\
+ inline ndnboost::long_long_type lltrunc(const T& v){ using ndnboost::math::lltrunc; return lltrunc(v, Policy()); }\
+ \
+ template <class T>\
+ inline ndnboost::long_long_type llround(const T& v){ using ndnboost::math::llround; return llround(v, Policy()); }\
+
+#else
+#define BOOST_MATH_DETAIL_LL_FUNC(Policy)
+#endif
+
+#define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\
+ \
+ BOOST_MATH_DETAIL_LL_FUNC(Policy)\
+ \
+ template <class RT1, class RT2>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type \
+ beta(RT1 a, RT2 b) { return ::ndnboost::math::beta(a, b, Policy()); }\
+\
+ template <class RT1, class RT2, class A>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, A>::type \
+ beta(RT1 a, RT2 b, A x){ return ::ndnboost::math::beta(a, b, x, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ betac(RT1 a, RT2 b, RT3 x) { return ::ndnboost::math::betac(a, b, x, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibeta(RT1 a, RT2 b, RT3 x){ return ::ndnboost::math::ibeta(a, b, x, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibetac(RT1 a, RT2 b, RT3 x){ return ::ndnboost::math::ibetac(a, b, x, Policy()); }\
+\
+ template <class T1, class T2, class T3, class T4>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3, T4>::type \
+ ibeta_inv(T1 a, T2 b, T3 p, T4* py){ return ::ndnboost::math::ibeta_inv(a, b, p, py, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibeta_inv(RT1 a, RT2 b, RT3 p){ return ::ndnboost::math::ibeta_inv(a, b, p, Policy()); }\
+\
+ template <class T1, class T2, class T3, class T4>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3, T4>::type \
+ ibetac_inv(T1 a, T2 b, T3 q, T4* py){ return ::ndnboost::math::ibetac_inv(a, b, q, py, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibeta_inva(RT1 a, RT2 b, RT3 p){ return ::ndnboost::math::ibeta_inva(a, b, p, Policy()); }\
+\
+ template <class T1, class T2, class T3>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+ ibetac_inva(T1 a, T2 b, T3 q){ return ::ndnboost::math::ibetac_inva(a, b, q, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibeta_invb(RT1 a, RT2 b, RT3 p){ return ::ndnboost::math::ibeta_invb(a, b, p, Policy()); }\
+\
+ template <class T1, class T2, class T3>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+ ibetac_invb(T1 a, T2 b, T3 q){ return ::ndnboost::math::ibetac_invb(a, b, q, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibetac_inv(RT1 a, RT2 b, RT3 q){ return ::ndnboost::math::ibetac_inv(a, b, q, Policy()); }\
+\
+ template <class RT1, class RT2, class RT3>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2, RT3>::type \
+ ibeta_derivative(RT1 a, RT2 b, RT3 x){ return ::ndnboost::math::ibeta_derivative(a, b, x, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type erf(RT z) { return ::ndnboost::math::erf(z, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type erfc(RT z){ return ::ndnboost::math::erfc(z, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type erf_inv(RT z) { return ::ndnboost::math::erf_inv(z, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type erfc_inv(RT z){ return ::ndnboost::math::erfc_inv(z, Policy()); }\
+\
+ using ndnboost::math::legendre_next;\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type \
+ legendre_p(int l, T x){ return ::ndnboost::math::legendre_p(l, x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type \
+ legendre_q(unsigned l, T x){ return ::ndnboost::math::legendre_q(l, x, Policy()); }\
+\
+ using ::ndnboost::math::legendre_next;\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type \
+ legendre_p(int l, int m, T x){ return ::ndnboost::math::legendre_p(l, m, x, Policy()); }\
+\
+ using ::ndnboost::math::laguerre_next;\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type \
+ laguerre(unsigned n, T x){ return ::ndnboost::math::laguerre(n, x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::laguerre_result<T1, T2>::type \
+ laguerre(unsigned n, T1 m, T2 x) { return ::ndnboost::math::laguerre(n, m, x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type \
+ hermite(unsigned n, T x){ return ::ndnboost::math::hermite(n, x, Policy()); }\
+\
+ using ndnboost::math::hermite_next;\
+\
+ template <class T1, class T2>\
+ inline std::complex<typename ndnboost::math::tools::promote_args<T1, T2>::type> \
+ spherical_harmonic(unsigned n, int m, T1 theta, T2 phi){ return ndnboost::math::spherical_harmonic(n, m, theta, phi, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+ spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi){ return ::ndnboost::math::spherical_harmonic_r(n, m, theta, phi, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+ spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi){ return ndnboost::math::spherical_harmonic_i(n, m, theta, phi, Policy()); }\
+\
+ template <class T1, class T2, class Policy>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+ spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);\
+\
+ template <class T1, class T2, class T3>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+ ellint_rf(T1 x, T2 y, T3 z){ return ::ndnboost::math::ellint_rf(x, y, z, Policy()); }\
+\
+ template <class T1, class T2, class T3>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type \
+ ellint_rd(T1 x, T2 y, T3 z){ return ::ndnboost::math::ellint_rd(x, y, z, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+ ellint_rc(T1 x, T2 y){ return ::ndnboost::math::ellint_rc(x, y, Policy()); }\
+\
+ template <class T1, class T2, class T3, class T4>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3, T4>::type \
+ ellint_rj(T1 x, T2 y, T3 z, T4 p){ return ndnboost::math::ellint_rj(x, y, z, p, Policy()); }\
+\
+ template <typename T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type ellint_2(T k){ return ndnboost::math::ellint_2(k, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type ellint_2(T1 k, T2 phi){ return ndnboost::math::ellint_2(k, phi, Policy()); }\
+\
+ template <typename T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type ellint_1(T k){ return ndnboost::math::ellint_1(k, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type ellint_1(T1 k, T2 phi){ return ndnboost::math::ellint_1(k, phi, Policy()); }\
+\
+ template <class T1, class T2, class T3>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2, T3>::type ellint_3(T1 k, T2 v, T3 phi){ return ndnboost::math::ellint_3(k, v, phi, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type ellint_3(T1 k, T2 v){ return ndnboost::math::ellint_3(k, v, Policy()); }\
+\
+ using ndnboost::math::max_factorial;\
+ template <class RT>\
+ inline RT factorial(unsigned int i) { return ndnboost::math::factorial<RT>(i, Policy()); }\
+ using ndnboost::math::unchecked_factorial;\
+ template <class RT>\
+ inline RT double_factorial(unsigned i){ return ndnboost::math::double_factorial<RT>(i, Policy()); }\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type falling_factorial(RT x, unsigned n){ return ndnboost::math::falling_factorial(x, n, Policy()); }\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type rising_factorial(RT x, unsigned n){ return ndnboost::math::rising_factorial(x, n, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type tgamma(RT z){ return ndnboost::math::tgamma(z, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type tgamma1pm1(RT z){ return ndnboost::math::tgamma1pm1(z, Policy()); }\
+\
+ template <class RT1, class RT2>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type tgamma(RT1 a, RT2 z){ return ndnboost::math::tgamma(a, z, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type lgamma(RT z, int* sign){ return ndnboost::math::lgamma(z, sign, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type lgamma(RT x){ return ndnboost::math::lgamma(x, Policy()); }\
+\
+ template <class RT1, class RT2>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type tgamma_lower(RT1 a, RT2 z){ return ndnboost::math::tgamma_lower(a, z, Policy()); }\
+\
+ template <class RT1, class RT2>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type gamma_q(RT1 a, RT2 z){ return ndnboost::math::gamma_q(a, z, Policy()); }\
+\
+ template <class RT1, class RT2>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type gamma_p(RT1 a, RT2 z){ return ndnboost::math::gamma_p(a, z, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type tgamma_delta_ratio(T1 z, T2 delta){ return ndnboost::math::tgamma_delta_ratio(z, delta, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type tgamma_ratio(T1 a, T2 b) { return ndnboost::math::tgamma_ratio(a, b, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_p_derivative(T1 a, T2 x){ return ndnboost::math::gamma_p_derivative(a, x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_p_inv(T1 a, T2 p){ return ndnboost::math::gamma_p_inv(a, p, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_p_inva(T1 a, T2 p){ return ndnboost::math::gamma_p_inva(a, p, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_q_inv(T1 a, T2 q){ return ndnboost::math::gamma_q_inv(a, q, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type gamma_q_inva(T1 a, T2 q){ return ndnboost::math::gamma_q_inva(a, q, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type digamma(T x){ return ndnboost::math::digamma(x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+ hypot(T1 x, T2 y){ return ndnboost::math::hypot(x, y, Policy()); }\
+\
+ template <class RT>\
+ inline typename ndnboost::math::tools::promote_args<RT>::type cbrt(RT z){ return ndnboost::math::cbrt(z, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type log1p(T x){ return ndnboost::math::log1p(x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type log1pmx(T x){ return ndnboost::math::log1pmx(x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type expm1(T x){ return ndnboost::math::expm1(x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::tools::promote_args<T1, T2>::type \
+ powm1(const T1 a, const T2 z){ return ndnboost::math::powm1(a, z, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type sqrt1pm1(const T& val){ return ndnboost::math::sqrt1pm1(val, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type sinc_pi(T x){ return ndnboost::math::sinc_pi(x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type sinhc_pi(T x){ return ndnboost::math::sinhc_pi(x, Policy()); }\
+\
+ template<typename T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type asinh(const T x){ return ndnboost::math::asinh(x, Policy()); }\
+\
+ template<typename T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type acosh(const T x){ return ndnboost::math::acosh(x, Policy()); }\
+\
+ template<typename T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type atanh(const T x){ return ndnboost::math::atanh(x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type cyl_bessel_j(T1 v, T2 x)\
+ { return ndnboost::math::cyl_bessel_j(v, x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type sph_bessel(unsigned v, T x)\
+ { return ndnboost::math::sph_bessel(v, x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
+ cyl_bessel_i(T1 v, T2 x) { return ndnboost::math::cyl_bessel_i(v, x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
+ cyl_bessel_k(T1 v, T2 x) { return ndnboost::math::cyl_bessel_k(v, x, Policy()); }\
+\
+ template <class T1, class T2>\
+ inline typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type \
+ cyl_neumann(T1 v, T2 x){ return ndnboost::math::cyl_neumann(v, x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type \
+ sph_neumann(unsigned v, T x){ return ndnboost::math::sph_neumann(v, x, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_bessel_j_zero(T v, int m)\
+ { return ndnboost::math::cyl_bessel_j_zero(v, m, Policy()); }\
+\
+template <class OutputIterator, class T>\
+ inline void cyl_bessel_j_zero(T v,\
+ int start_index,\
+ unsigned number_of_zeros,\
+ OutputIterator out_it)\
+ { ndnboost::math::cyl_bessel_j_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::detail::bessel_traits<T, T, Policy >::result_type cyl_neumann_zero(T v, int m)\
+ { return ndnboost::math::cyl_neumann_zero(v, m, Policy()); }\
+\
+template <class OutputIterator, class T>\
+ inline void cyl_neumann_zero(T v,\
+ int start_index,\
+ unsigned number_of_zeros,\
+ OutputIterator out_it)\
+ { ndnboost::math::cyl_neumann_zero(v, start_index, number_of_zeros, out_it, Policy()); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type sin_pi(T x){ return ndnboost::math::sin_pi(x); }\
+\
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type cos_pi(T x){ return ndnboost::math::cos_pi(x); }\
+\
+ using ndnboost::math::fpclassify;\
+ using ndnboost::math::isfinite;\
+ using ndnboost::math::isinf;\
+ using ndnboost::math::isnan;\
+ using ndnboost::math::isnormal;\
+ using ndnboost::math::signbit;\
+ using ndnboost::math::sign;\
+ using ndnboost::math::copysign;\
+ using ndnboost::math::changesign;\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T,U>::type expint(T const& z, U const& u)\
+ { return ndnboost::math::expint(z, u, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type expint(T z){ return ndnboost::math::expint(z, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type zeta(T s){ return ndnboost::math::zeta(s, Policy()); }\
+ \
+ template <class T>\
+ inline T round(const T& v){ using ndnboost::math::round; return round(v, Policy()); }\
+ \
+ template <class T>\
+ inline int iround(const T& v){ using ndnboost::math::iround; return iround(v, Policy()); }\
+ \
+ template <class T>\
+ inline long lround(const T& v){ using ndnboost::math::lround; return lround(v, Policy()); }\
+ \
+ template <class T>\
+ inline T trunc(const T& v){ using ndnboost::math::trunc; return trunc(v, Policy()); }\
+ \
+ template <class T>\
+ inline int itrunc(const T& v){ using ndnboost::math::itrunc; return itrunc(v, Policy()); }\
+ \
+ template <class T>\
+ inline long ltrunc(const T& v){ using ndnboost::math::ltrunc; return ltrunc(v, Policy()); }\
+ \
+ template <class T>\
+ inline T modf(const T& v, T* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+ \
+ template <class T>\
+ inline T modf(const T& v, int* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+ \
+ template <class T>\
+ inline T modf(const T& v, long* ipart){ using ndnboost::math::modf; return modf(v, ipart, Policy()); }\
+ \
+ template <int N, class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type pow(T v){ return ndnboost::math::pow<N>(v, Policy()); }\
+ \
+ template <class T> T nextafter(const T& a, const T& b){ return ndnboost::math::nextafter(a, b, Policy()); }\
+ template <class T> T float_next(const T& a){ return ndnboost::math::float_next(a, Policy()); }\
+ template <class T> T float_prior(const T& a){ return ndnboost::math::float_prior(a, Policy()); }\
+ template <class T> T float_distance(const T& a, const T& b){ return ndnboost::math::float_distance(a, b, Policy()); }\
+ \
+ template <class RT1, class RT2>\
+ inline typename ndnboost::math::tools::promote_args<RT1, RT2>::type owens_t(RT1 a, RT2 z){ return ndnboost::math::owens_t(a, z, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_1(T1 v, T2 x)\
+ { return ndnboost::math::cyl_hankel_1(v, x, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> cyl_hankel_2(T1 v, T2 x)\
+ { return ndnboost::math::cyl_hankel_2(v, x, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_1(T1 v, T2 x)\
+ { return ndnboost::math::sph_hankel_1(v, x, Policy()); }\
+ \
+ template <class T1, class T2>\
+ inline std::complex<typename ndnboost::math::detail::bessel_traits<T1, T2, Policy >::result_type> sph_hankel_2(T1 v, T2 x)\
+ { return ndnboost::math::sph_hankel_2(v, x, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type jacobi_elliptic(T k, T theta, T* pcn, T* pdn)\
+ { return ndnboost::math::jacobi_elliptic(k, theta, pcn, pdn, Policy()); }\
+ \
+ template <class U, class T>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_sn(U k, T theta)\
+ { return ndnboost::math::jacobi_sn(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_cn(T k, U theta)\
+ { return ndnboost::math::jacobi_cn(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_dn(T k, U theta)\
+ { return ndnboost::math::jacobi_dn(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_cd(T k, U theta)\
+ { return ndnboost::math::jacobi_cd(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_dc(T k, U theta)\
+ { return ndnboost::math::jacobi_dc(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_ns(T k, U theta)\
+ { return ndnboost::math::jacobi_ns(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_sd(T k, U theta)\
+ { return ndnboost::math::jacobi_sd(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_ds(T k, U theta)\
+ { return ndnboost::math::jacobi_ds(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_nc(T k, U theta)\
+ { return ndnboost::math::jacobi_nc(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_nd(T k, U theta)\
+ { return ndnboost::math::jacobi_nd(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_sc(T k, U theta)\
+ { return ndnboost::math::jacobi_sc(k, theta, Policy()); }\
+ \
+ template <class T, class U>\
+ inline typename ndnboost::math::tools::promote_args<T, U>::type jacobi_cs(T k, U theta)\
+ { return ndnboost::math::jacobi_cs(k, theta, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type airy_ai(T x)\
+ { return ndnboost::math::airy_ai(x, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type airy_bi(T x)\
+ { return ndnboost::math::airy_bi(x, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type airy_ai_prime(T x)\
+ { return ndnboost::math::airy_ai_prime(x, Policy()); }\
+ \
+ template <class T>\
+ inline typename ndnboost::math::tools::promote_args<T>::type airy_bi_prime(T x)\
+ { return ndnboost::math::airy_bi_prime(x, Policy()); }\
+ \
+ template <class T>\
+ inline T airy_ai_zero(int m)\
+ { return ndnboost::math::airy_ai_zero<T>(m, Policy()); }\
+ template <class T, class OutputIterator>\
+ OutputIterator airy_ai_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
+ { return ndnboost::math::airy_ai_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
+ \
+ template <class T>\
+ inline T airy_bi_zero(int m)\
+ { return ndnboost::math::airy_bi_zero<T>(m, Policy()); }\
+ template <class T, class OutputIterator>\
+ OutputIterator airy_bi_zero(int start_index, unsigned number_of_zeros, OutputIterator out_it)\
+ { return ndnboost::math::airy_bi_zero<T>(start_index, number_of_zeros, out_it, Policy()); }\
+ \
+
+
+
+
+
+#endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP
+
+
diff --git a/ndnboost/math/special_functions/sign.hpp b/ndnboost/math/special_functions/sign.hpp
new file mode 100644
index 0000000..fecacfb
--- /dev/null
+++ b/ndnboost/math/special_functions/sign.hpp
@@ -0,0 +1,150 @@
+// (C) Copyright John Maddock 2006.
+// (C) Copyright Johan Rade 2006.
+// (C) Copyright Paul A. Bristow 2011 (added changesign).
+
+// 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_MATH_TOOLS_SIGN_HPP
+#define BOOST_MATH_TOOLS_SIGN_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <ndnboost/math/tools/config.hpp>
+#include <ndnboost/math/special_functions/math_fwd.hpp>
+#include <ndnboost/math/special_functions/detail/fp_traits.hpp>
+
+namespace ndnboost{ namespace math{
+
+namespace detail {
+
+ // signbit
+
+#ifdef BOOST_MATH_USE_STD_FPCLASSIFY
+ template<class T>
+ inline int signbit_impl(T x, native_tag const&)
+ {
+ return (std::signbit)(x);
+ }
+#endif
+
+ template<class T>
+ inline int signbit_impl(T x, generic_tag<true> const&)
+ {
+ return x < 0;
+ }
+
+ template<class T>
+ inline int signbit_impl(T x, generic_tag<false> const&)
+ {
+ return x < 0;
+ }
+
+ template<class T>
+ inline int signbit_impl(T x, ieee_copy_all_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ return a & traits::sign ? 1 : 0;
+ }
+
+ template<class T>
+ inline int signbit_impl(T x, ieee_copy_leading_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+
+ return a & traits::sign ? 1 : 0;
+ }
+
+ // Changesign
+
+ template<class T>
+ inline T (changesign_impl)(T x, generic_tag<true> const&)
+ {
+ return -x;
+ }
+
+ template<class T>
+ inline T (changesign_impl)(T x, generic_tag<false> const&)
+ {
+ return -x;
+ }
+
+
+ template<class T>
+ inline T changesign_impl(T x, ieee_copy_all_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::sign_change_type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a ^= traits::sign;
+ traits::set_bits(x,a);
+ return x;
+ }
+
+ template<class T>
+ inline T (changesign_impl)(T x, ieee_copy_leading_bits_tag const&)
+ {
+ typedef BOOST_DEDUCED_TYPENAME fp_traits<T>::sign_change_type traits;
+
+ BOOST_DEDUCED_TYPENAME traits::bits a;
+ traits::get_bits(x,a);
+ a ^= traits::sign;
+ traits::set_bits(x,a);
+ return x;
+ }
+
+
+} // namespace detail
+
+template<class T> int (signbit)(T x)
+{
+ typedef typename detail::fp_traits<T>::type traits;
+ typedef typename traits::method method;
+ // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type result_type;
+ return detail::signbit_impl(static_cast<result_type>(x), method());
+}
+
+template <class T>
+inline int sign BOOST_NO_MACRO_EXPAND(const T& z)
+{
+ return (z == 0) ? 0 : (ndnboost::math::signbit)(z) ? -1 : 1;
+}
+
+template <class T> typename tools::promote_args<T>::type (changesign)(const T& x)
+{ //!< \brief return unchanged binary pattern of x, except for change of sign bit.
+ typedef typename detail::fp_traits<T>::sign_change_type traits;
+ typedef typename traits::method method;
+ // typedef typename ndnboost::is_floating_point<T>::type fp_tag;
+ typedef typename tools::promote_args<T>::type result_type;
+
+ return detail::changesign_impl(static_cast<result_type>(x), method());
+}
+
+template <class T, class U>
+inline typename tools::promote_args<T, U>::type
+ copysign BOOST_NO_MACRO_EXPAND(const T& x, const U& y)
+{
+ BOOST_MATH_STD_USING
+ typedef typename tools::promote_args<T, U>::type result_type;
+ return (ndnboost::math::signbit)(static_cast<result_type>(x)) != (ndnboost::math::signbit)(static_cast<result_type>(y))
+ ? (ndnboost::math::changesign)(static_cast<result_type>(x)) : static_cast<result_type>(x);
+}
+
+} // namespace math
+} // namespace ndnboost
+
+
+#endif // BOOST_MATH_TOOLS_SIGN_HPP
+
+
diff --git a/ndnboost/math/tools/config.hpp b/ndnboost/math/tools/config.hpp
new file mode 100644
index 0000000..8a2178c
--- /dev/null
+++ b/ndnboost/math/tools/config.hpp
@@ -0,0 +1,352 @@
+// Copyright (c) 2006-7 John Maddock
+// 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_MATH_TOOLS_CONFIG_HPP
+#define BOOST_MATH_TOOLS_CONFIG_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/cstdint.hpp> // for ndnboost::uintmax_t
+#include <ndnboost/detail/workaround.hpp>
+#include <algorithm> // for min and max
+#include <ndnboost/config/no_tr1/cmath.hpp>
+#include <climits>
+#include <cfloat>
+#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__))
+# include <math.h>
+#endif
+
+#include <ndnboost/math/tools/user.hpp>
+
+#if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \
+ || (defined(__hppa) && !defined(__OpenBSD__)) || (defined(__NO_LONG_DOUBLE_MATH) && (DBL_MANT_DIG != LDBL_MANT_DIG))) \
+ && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#endif
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+//
+// Borland post 5.8.2 uses Dinkumware's std C lib which
+// doesn't have true long double precision. Earlier
+// versions are problematic too:
+//
+# define BOOST_MATH_NO_REAL_CONCEPT_TESTS
+# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
+# include <float.h>
+#endif
+#ifdef __IBMCPP__
+//
+// For reasons I don't unserstand, the tests with IMB's compiler all
+// pass at long double precision, but fail with real_concept, those tests
+// are disabled for now. (JM 2012).
+# define BOOST_MATH_NO_REAL_CONCEPT_TESTS
+#endif
+#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+//
+// Darwin's rather strange "double double" is rather hard to
+// support, it should be possible given enough effort though...
+//
+# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#endif
+#if defined(unix) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1000) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+//
+// Intel compiler prior to version 10 has sporadic problems
+// calling the long double overloads of the std lib math functions:
+// calling ::powl is OK, but std::pow(long double, long double)
+// may segfault depending upon the value of the arguments passed
+// and the specific Linux distribution.
+//
+// We'll be conservative and disable long double support for this compiler.
+//
+// Comment out this #define and try building the tests to determine whether
+// your Intel compiler version has this issue or not.
+//
+# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#endif
+#if defined(unix) && defined(__INTEL_COMPILER)
+//
+// Intel compiler has sporadic issues compiling std::fpclassify depending on
+// the exact OS version used. Use our own code for this as we know it works
+// well on Intel processors:
+//
+#define BOOST_MATH_DISABLE_STD_FPCLASSIFY
+#endif
+
+#if defined(BOOST_MSVC) && !defined(_WIN32_WCE)
+ // Better safe than sorry, our tests don't support hardware exceptions:
+# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM)
+#endif
+
+#ifdef __IBMCPP__
+# define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS
+#endif
+
+#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901))
+# define BOOST_MATH_USE_C99
+#endif
+
+#if (defined(__hpux) && !defined(__hppa))
+# define BOOST_MATH_USE_C99
+#endif
+
+#if defined(__GNUC__) && defined(_GLIBCXX_USE_C99)
+# define BOOST_MATH_USE_C99
+#endif
+
+#if defined(_LIBCPP_VERSION) && !defined(_MSC_VER)
+# define BOOST_MATH_USE_C99
+#endif
+
+#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \
+ || defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \
+ || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99))\
+ || defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS)
+# define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY
+#endif
+
+#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590)
+
+# include "ndnboost/type.hpp"
+# include "ndnboost/non_type.hpp"
+
+# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) ndnboost::type<t>* = 0
+# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) ndnboost::type<t>*
+# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) ndnboost::non_type<t, v>* = 0
+# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) ndnboost::non_type<t, v>*
+
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \
+ , BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \
+ , BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \
+ , BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \
+ , BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
+
+#else
+
+// no workaround needed: expand to nothing
+
+# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t)
+# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
+# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
+# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
+
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t)
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t)
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v)
+# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v)
+
+
+#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+
+#if (defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__)) && !defined(BOOST_MATH_SMALL_CONSTANT)
+// Sun's compiler emits a hard error if a constant underflows,
+// as does aCC on PA-RISC, while gcc issues a large number of warnings:
+# define BOOST_MATH_SMALL_CONSTANT(x) 0
+#else
+# define BOOST_MATH_SMALL_CONSTANT(x) x
+#endif
+
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+//
+// Define if constants too large for a float cause "bad"
+// values to be stored in the data, rather than infinity
+// or a suitably large value.
+//
+# define BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS
+#endif
+//
+// Tune performance options for specific compilers:
+//
+#ifdef BOOST_MSVC
+# define BOOST_MATH_POLY_METHOD 2
+#elif defined(BOOST_INTEL)
+# define BOOST_MATH_POLY_METHOD 2
+# define BOOST_MATH_RATIONAL_METHOD 2
+#elif defined(__GNUC__)
+# define BOOST_MATH_POLY_METHOD 3
+# define BOOST_MATH_RATIONAL_METHOD 3
+# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
+# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
+#endif
+
+#if defined(BOOST_NO_LONG_LONG) && !defined(BOOST_MATH_INT_TABLE_TYPE)
+# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT
+# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L
+#endif
+
+//
+// The maximum order of polynomial that will be evaluated
+// via an unrolled specialisation:
+//
+#ifndef BOOST_MATH_MAX_POLY_ORDER
+# define BOOST_MATH_MAX_POLY_ORDER 17
+#endif
+//
+// Set the method used to evaluate polynomials and rationals:
+//
+#ifndef BOOST_MATH_POLY_METHOD
+# define BOOST_MATH_POLY_METHOD 1
+#endif
+#ifndef BOOST_MATH_RATIONAL_METHOD
+# define BOOST_MATH_RATIONAL_METHOD 0
+#endif
+//
+// decide whether to store constants as integers or reals:
+//
+#ifndef BOOST_MATH_INT_TABLE_TYPE
+# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT
+#endif
+#ifndef BOOST_MATH_INT_VALUE_SUFFIX
+# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF
+#endif
+//
+// Test whether to support __float128:
+//
+#if defined(_GLIBCXX_USE_FLOAT128) && defined(BOOST_GCC) && !defined(__STRICT_ANSI__)
+//
+// Only enable this when the compiler really is GCC as clang and probably
+// intel too don't support __float128 yet :-(
+//
+# define BOOST_MATH_USE_FLOAT128
+#endif
+//
+// Check for WinCE with no iostream support:
+//
+#if defined(_WIN32_WCE) && !defined(__SGI_STL_PORT)
+# define BOOST_MATH_NO_LEXICAL_CAST
+#endif
+
+//
+// Helper macro for controlling the FP behaviour:
+//
+#ifndef BOOST_MATH_CONTROL_FP
+# define BOOST_MATH_CONTROL_FP
+#endif
+//
+// Helper macro for using statements:
+//
+#define BOOST_MATH_STD_USING_CORE \
+ using std::abs;\
+ using std::acos;\
+ using std::cos;\
+ using std::fmod;\
+ using std::modf;\
+ using std::tan;\
+ using std::asin;\
+ using std::cosh;\
+ using std::frexp;\
+ using std::pow;\
+ using std::tanh;\
+ using std::atan;\
+ using std::exp;\
+ using std::ldexp;\
+ using std::sin;\
+ using std::atan2;\
+ using std::fabs;\
+ using std::log;\
+ using std::sinh;\
+ using std::ceil;\
+ using std::floor;\
+ using std::log10;\
+ using std::sqrt;
+
+#define BOOST_MATH_STD_USING BOOST_MATH_STD_USING_CORE
+
+namespace ndnboost{ namespace math{
+namespace tools
+{
+
+template <class T>
+inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c)
+{
+ return (std::max)((std::max)(a, b), c);
+}
+
+template <class T>
+inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d)
+{
+ return (std::max)((std::max)(a, b), (std::max)(c, d));
+}
+
+} // namespace tools
+
+template <class T>
+void suppress_unused_variable_warning(const T&)
+{
+}
+
+}} // namespace ndnboost namespace math
+
+#if ((defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H)
+
+ #include <ndnboost/detail/fenv.hpp>
+
+# ifdef FE_ALL_EXCEPT
+
+namespace ndnboost{ namespace math{
+ namespace detail
+ {
+ struct fpu_guard
+ {
+ fpu_guard()
+ {
+ fegetexceptflag(&m_flags, FE_ALL_EXCEPT);
+ feclearexcept(FE_ALL_EXCEPT);
+ }
+ ~fpu_guard()
+ {
+ fesetexceptflag(&m_flags, FE_ALL_EXCEPT);
+ }
+ private:
+ fexcept_t m_flags;
+ };
+
+ } // namespace detail
+ }} // namespaces
+
+# define BOOST_FPU_EXCEPTION_GUARD ndnboost::math::detail::fpu_guard local_guard_object;
+# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0);
+
+# else
+
+# define BOOST_FPU_EXCEPTION_GUARD
+# define BOOST_MATH_INSTRUMENT_FPU
+
+# endif
+
+#else // All other platforms.
+# define BOOST_FPU_EXCEPTION_GUARD
+# define BOOST_MATH_INSTRUMENT_FPU
+#endif
+
+#ifdef BOOST_MATH_INSTRUMENT
+
+# include <iostream>
+# include <iomanip>
+# include <typeinfo>
+
+# define BOOST_MATH_INSTRUMENT_CODE(x) \
+ std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl;
+# define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name)
+
+#else
+
+# define BOOST_MATH_INSTRUMENT_CODE(x)
+# define BOOST_MATH_INSTRUMENT_VARIABLE(name)
+
+#endif
+
+#endif // BOOST_MATH_TOOLS_CONFIG_HPP
+
+
+
+
+
diff --git a/ndnboost/math/tools/promotion.hpp b/ndnboost/math/tools/promotion.hpp
new file mode 100644
index 0000000..aab6d34
--- /dev/null
+++ b/ndnboost/math/tools/promotion.hpp
@@ -0,0 +1,150 @@
+// boost\math\tools\promotion.hpp
+
+// Copyright John Maddock 2006.
+// Copyright Paul A. Bristow 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)
+
+// Promote arguments functions to allow math functions to have arguments
+// provided as integer OR real (floating-point, built-in or UDT)
+// (called ArithmeticType in functions that use promotion)
+// that help to reduce the risk of creating multiple instantiations.
+// Allows creation of an inline wrapper that forwards to a foo(RT, RT) function,
+// so you never get to instantiate any mixed foo(RT, IT) functions.
+
+#ifndef BOOST_MATH_PROMOTION_HPP
+#define BOOST_MATH_PROMOTION_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+// Boost type traits:
+#include <ndnboost/math/tools/config.hpp>
+#include <ndnboost/type_traits/is_floating_point.hpp> // for ndnboost::is_floating_point;
+#include <ndnboost/type_traits/is_integral.hpp> // for ndnboost::is_integral
+#include <ndnboost/type_traits/is_convertible.hpp> // for ndnboost::is_convertible
+#include <ndnboost/type_traits/is_same.hpp>// for ndnboost::is_same
+#include <ndnboost/type_traits/remove_cv.hpp>// for ndnboost::remove_cv
+// Boost Template meta programming:
+#include <ndnboost/mpl/if.hpp> // for ndnboost::mpl::if_c.
+#include <ndnboost/mpl/and.hpp> // for ndnboost::mpl::if_c.
+#include <ndnboost/mpl/or.hpp> // for ndnboost::mpl::if_c.
+#include <ndnboost/mpl/not.hpp> // for ndnboost::mpl::if_c.
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+#include <ndnboost/static_assert.hpp>
+#endif
+
+namespace ndnboost
+{
+ namespace math
+ {
+ namespace tools
+ {
+ // If either T1 or T2 is an integer type,
+ // pretend it was a double (for the purposes of further analysis).
+ // Then pick the wider of the two floating-point types
+ // as the actual signature to forward to.
+ // For example:
+ // foo(int, short) -> double foo(double, double);
+ // foo(int, float) -> double foo(double, double);
+ // Note: NOT float foo(float, float)
+ // foo(int, double) -> foo(double, double);
+ // foo(double, float) -> double foo(double, double);
+ // foo(double, float) -> double foo(double, double);
+ // foo(any-int-or-float-type, long double) -> foo(long double, long double);
+ // but ONLY float foo(float, float) is unchanged.
+ // So the only way to get an entirely float version is to call foo(1.F, 2.F),
+ // But since most (all?) the math functions convert to double internally,
+ // probably there would not be the hoped-for gain by using float here.
+
+ // This follows the C-compatible conversion rules of pow, etc
+ // where pow(int, float) is converted to pow(double, double).
+
+ template <class T>
+ struct promote_arg
+ { // If T is integral type, then promote to double.
+ typedef typename mpl::if_<is_integral<T>, double, T>::type type;
+ };
+ // These full specialisations reduce mpl::if_ usage and speed up
+ // compilation:
+ template <> struct promote_arg<float> { typedef float type; };
+ template <> struct promote_arg<double>{ typedef double type; };
+ template <> struct promote_arg<long double> { typedef long double type; };
+ template <> struct promote_arg<int> { typedef double type; };
+
+ template <class T1, class T2>
+ struct promote_args_2
+ { // Promote, if necessary, & pick the wider of the two floating-point types.
+ // for both parameter types, if integral promote to double.
+ typedef typename promote_arg<T1>::type T1P; // T1 perhaps promoted.
+ typedef typename promote_arg<T2>::type T2P; // T2 perhaps promoted.
+
+ typedef typename mpl::if_<
+ typename mpl::and_<is_floating_point<T1P>, is_floating_point<T2P> >::type, // both T1P and T2P are floating-point?
+ typename mpl::if_< typename mpl::or_<is_same<long double, T1P>, is_same<long double, T2P> >::type, // either long double?
+ long double, // then result type is long double.
+ typename mpl::if_< typename mpl::or_<is_same<double, T1P>, is_same<double, T2P> >::type, // either double?
+ double, // result type is double.
+ float // else result type is float.
+ >::type
+ >::type,
+ // else one or the other is a user-defined type:
+ typename mpl::if_< typename mpl::and_<mpl::not_<is_floating_point<T2P> >, ::ndnboost::is_convertible<T1P, T2P> >, T2P, T1P>::type>::type type;
+ }; // promote_arg2
+ // These full specialisations reduce mpl::if_ usage and speed up
+ // compilation:
+ template <> struct promote_args_2<float, float> { typedef float type; };
+ template <> struct promote_args_2<double, double>{ typedef double type; };
+ template <> struct promote_args_2<long double, long double> { typedef long double type; };
+ template <> struct promote_args_2<int, int> { typedef double type; };
+ template <> struct promote_args_2<int, float> { typedef double type; };
+ template <> struct promote_args_2<float, int> { typedef double type; };
+ template <> struct promote_args_2<int, double> { typedef double type; };
+ template <> struct promote_args_2<double, int> { typedef double type; };
+ template <> struct promote_args_2<int, long double> { typedef long double type; };
+ template <> struct promote_args_2<long double, int> { typedef long double type; };
+ template <> struct promote_args_2<float, double> { typedef double type; };
+ template <> struct promote_args_2<double, float> { typedef double type; };
+ template <> struct promote_args_2<float, long double> { typedef long double type; };
+ template <> struct promote_args_2<long double, float> { typedef long double type; };
+ template <> struct promote_args_2<double, long double> { typedef long double type; };
+ template <> struct promote_args_2<long double, double> { typedef long double type; };
+
+ template <class T1, class T2=float, class T3=float, class T4=float, class T5=float, class T6=float>
+ struct promote_args
+ {
+ typedef typename promote_args_2<
+ typename remove_cv<T1>::type,
+ typename promote_args_2<
+ typename remove_cv<T2>::type,
+ typename promote_args_2<
+ typename remove_cv<T3>::type,
+ typename promote_args_2<
+ typename remove_cv<T4>::type,
+ typename promote_args_2<
+ typename remove_cv<T5>::type, typename remove_cv<T6>::type
+ >::type
+ >::type
+ >::type
+ >::type
+ >::type type;
+
+#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+ //
+ // Guard against use of long double if it's not supported:
+ //
+ BOOST_STATIC_ASSERT((0 == ::ndnboost::is_same<type, long double>::value));
+#endif
+ };
+
+ } // namespace tools
+ } // namespace math
+} // namespace ndnboost
+
+#endif // BOOST_MATH_PROMOTION_HPP
+
diff --git a/ndnboost/math/tools/real_cast.hpp b/ndnboost/math/tools/real_cast.hpp
new file mode 100644
index 0000000..108dcbf
--- /dev/null
+++ b/ndnboost/math/tools/real_cast.hpp
@@ -0,0 +1,29 @@
+// Copyright John Maddock 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)
+
+#ifndef BOOST_MATH_TOOLS_REAL_CAST_HPP
+#define BOOST_MATH_TOOLS_REAL_CAST_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+namespace ndnboost{ namespace math
+{
+ namespace tools
+ {
+ template <class To, class T>
+ inline To real_cast(T t)
+ {
+ return static_cast<To>(t);
+ }
+ } // namespace tools
+} // namespace math
+} // namespace ndnboost
+
+#endif // BOOST_MATH_TOOLS_REAL_CAST_HPP
+
+
+
diff --git a/ndnboost/math/tools/user.hpp b/ndnboost/math/tools/user.hpp
new file mode 100644
index 0000000..c1bdaf7
--- /dev/null
+++ b/ndnboost/math/tools/user.hpp
@@ -0,0 +1,97 @@
+// Copyright John Maddock 2007.
+// Copyright Paul A. Bristow 2007.
+
+// 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_MATH_TOOLS_USER_HPP
+#define BOOST_MATH_TOOLS_USER_HPP
+
+#ifdef _MSC_VER
+#pragma once
+#endif
+
+// This file can be modified by the user to change the default policies.
+// See "Changing the Policy Defaults" in documentation.
+
+// define this if the platform has no long double functions,
+// or if the long double versions have only double precision:
+//
+// #define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS
+//
+// Performance tuning options:
+//
+// #define BOOST_MATH_POLY_METHOD 3
+// #define BOOST_MATH_RATIONAL_METHOD 3
+//
+// The maximum order of polynomial that will be evaluated
+// via an unrolled specialisation:
+//
+// #define BOOST_MATH_MAX_POLY_ORDER 17
+//
+// decide whether to store constants as integers or reals:
+//
+// #define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT
+
+//
+// Default policies follow:
+//
+// Domain errors:
+//
+// #define BOOST_MATH_DOMAIN_ERROR_POLICY throw_on_error
+//
+// Pole errors:
+//
+// #define BOOST_MATH_POLE_ERROR_POLICY throw_on_error
+//
+// Overflow Errors:
+//
+// #define BOOST_MATH_OVERFLOW_ERROR_POLICY throw_on_error
+//
+// Internal Evaluation Errors:
+//
+// #define BOOST_MATH_EVALUATION_ERROR_POLICY throw_on_error
+//
+// Underfow:
+//
+// #define BOOST_MATH_UNDERFLOW_ERROR_POLICY ignore_error
+//
+// Denorms:
+//
+// #define BOOST_MATH_DENORM_ERROR_POLICY ignore_error
+//
+// Max digits to use for internal calculations:
+//
+// #define BOOST_MATH_DIGITS10_POLICY 0
+//
+// Promote floats to doubles internally?
+//
+// #define BOOST_MATH_PROMOTE_FLOAT_POLICY true
+//
+// Promote doubles to long double internally:
+//
+// #define BOOST_MATH_PROMOTE_DOUBLE_POLICY true
+//
+// What do discrete quantiles return?
+//
+// #define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_outwards
+//
+// If a function is mathematically undefined
+// (for example the Cauchy distribution has no mean),
+// then do we stop the code from compiling?
+//
+// #define BOOST_MATH_ASSERT_UNDEFINED_POLICY true
+//
+// Maximum series iterstions permitted:
+//
+// #define BOOST_MATH_MAX_SERIES_ITERATION_POLICY 1000000
+//
+// Maximum root finding steps permitted:
+//
+// define BOOST_MATH_MAX_ROOT_ITERATION_POLICY 200
+
+#endif // BOOST_MATH_TOOLS_USER_HPP
+
+
diff --git a/ndnboost/mpl/aux_/front_impl.hpp b/ndnboost/mpl/aux_/front_impl.hpp
deleted file mode 100644
index a912eb3..0000000
--- a/ndnboost/mpl/aux_/front_impl.hpp
+++ /dev/null
@@ -1,41 +0,0 @@
-
-#ifndef BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
-#define BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: front_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/front_fwd.hpp>
-#include <ndnboost/mpl/begin_end.hpp>
-#include <ndnboost/mpl/deref.hpp>
-#include <ndnboost/mpl/aux_/traits_lambda_spec.hpp>
-
-namespace ndnboost { namespace mpl {
-
-// default implementation; conrete sequences might override it by
-// specializing either the 'front_impl' or the primary 'front' template
-
-template< typename Tag >
-struct front_impl
-{
- template< typename Sequence > struct apply
- {
- typedef typename begin<Sequence>::type iter_;
- typedef typename deref<iter_>::type type;
- };
-};
-
-BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1,front_impl)
-
-}}
-
-#endif // BOOST_MPL_AUX_FRONT_IMPL_HPP_INCLUDED
diff --git a/ndnboost/mpl/aux_/joint_iter.hpp b/ndnboost/mpl/aux_/joint_iter.hpp
deleted file mode 100644
index 8adcdf6..0000000
--- a/ndnboost/mpl/aux_/joint_iter.hpp
+++ /dev/null
@@ -1,120 +0,0 @@
-
-#ifndef BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
-#define BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: joint_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/next_prior.hpp>
-#include <ndnboost/mpl/deref.hpp>
-#include <ndnboost/mpl/iterator_tags.hpp>
-#include <ndnboost/mpl/aux_/lambda_spec.hpp>
-#include <ndnboost/mpl/aux_/config/ctps.hpp>
-
-#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-# include <ndnboost/type_traits/is_same.hpp>
-#endif
-
-namespace ndnboost { namespace mpl {
-
-#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
-
-template<
- typename Iterator1
- , typename LastIterator1
- , typename Iterator2
- >
-struct joint_iter
-{
- typedef Iterator1 base;
- typedef forward_iterator_tag category;
-};
-
-template<
- typename LastIterator1
- , typename Iterator2
- >
-struct joint_iter<LastIterator1,LastIterator1,Iterator2>
-{
- typedef Iterator2 base;
- typedef forward_iterator_tag category;
-};
-
-
-template< typename I1, typename L1, typename I2 >
-struct deref< joint_iter<I1,L1,I2> >
-{
- typedef typename joint_iter<I1,L1,I2>::base base_;
- typedef typename deref<base_>::type type;
-};
-
-template< typename I1, typename L1, typename I2 >
-struct next< joint_iter<I1,L1,I2> >
-{
- typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > type;
-};
-
-template< typename L1, typename I2 >
-struct next< joint_iter<L1,L1,I2> >
-{
- typedef joint_iter< L1,L1,typename mpl::next<I2>::type > type;
-};
-
-#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-template<
- typename Iterator1
- , typename LastIterator1
- , typename Iterator2
- >
-struct joint_iter;
-
-template< bool > struct joint_iter_impl
-{
- template< typename I1, typename L1, typename I2 > struct result_
- {
- typedef I1 base;
- typedef forward_iterator_tag category;
- typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > next;
- typedef typename deref<I1>::type type;
- };
-};
-
-template<> struct joint_iter_impl<true>
-{
- template< typename I1, typename L1, typename I2 > struct result_
- {
- typedef I2 base;
- typedef forward_iterator_tag category;
- typedef joint_iter< L1,L1,typename mpl::next<I2>::type > next;
- typedef typename deref<I2>::type type;
- };
-};
-
-template<
- typename Iterator1
- , typename LastIterator1
- , typename Iterator2
- >
-struct joint_iter
- : joint_iter_impl< is_same<Iterator1,LastIterator1>::value >
- ::template result_<Iterator1,LastIterator1,Iterator2>
-{
-};
-
-#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-
-BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, joint_iter)
-
-}}
-
-#endif // BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
diff --git a/ndnboost/mpl/aux_/pop_front_impl.hpp b/ndnboost/mpl/aux_/pop_front_impl.hpp
deleted file mode 100644
index a4ad7ce..0000000
--- a/ndnboost/mpl/aux_/pop_front_impl.hpp
+++ /dev/null
@@ -1,44 +0,0 @@
-
-#ifndef BOOST_MPL_AUX_POP_FRONT_IMPL_HPP_INCLUDED
-#define BOOST_MPL_AUX_POP_FRONT_IMPL_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: pop_front_impl.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/pop_front_fwd.hpp>
-#include <ndnboost/mpl/aux_/traits_lambda_spec.hpp>
-#include <ndnboost/mpl/aux_/config/workaround.hpp>
-#include <ndnboost/mpl/aux_/config/msvc.hpp>
-
-namespace ndnboost { namespace mpl {
-
-// no default implementation; the definition is needed to make MSVC happy
-
-template< typename Tag >
-struct pop_front_impl
-{
- template< typename Sequence > struct apply
- // conservatively placed, but maybe should go outside surrounding
- // braces.
-#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
- {
- typedef int type;
- }
-#endif
- ;
-};
-
-BOOST_MPL_ALGORITM_TRAITS_LAMBDA_SPEC(1, pop_front_impl)
-
-}}
-
-#endif // BOOST_MPL_AUX_POP_FRONT_IMPL_HPP_INCLUDED
diff --git a/ndnboost/mpl/aux_/unwrap.hpp b/ndnboost/mpl/aux_/unwrap.hpp
new file mode 100644
index 0000000..2b755b9
--- /dev/null
+++ b/ndnboost/mpl/aux_/unwrap.hpp
@@ -0,0 +1,47 @@
+
+#ifndef BOOST_MPL_AUX_UNWRAP_HPP_INCLUDED
+#define BOOST_MPL_AUX_UNWRAP_HPP_INCLUDED
+
+// Copyright Peter Dimov and Multi Media Ltd 2001, 2002
+// Copyright David Abrahams 2001
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: unwrap.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/ref.hpp>
+
+namespace ndnboost { namespace mpl { namespace aux {
+
+template< typename F >
+inline
+F& unwrap(F& f, long)
+{
+ return f;
+}
+
+template< typename F >
+inline
+F&
+unwrap(reference_wrapper<F>& f, int)
+{
+ return f;
+}
+
+template< typename F >
+inline
+F&
+unwrap(reference_wrapper<F> const& f, int)
+{
+ return f;
+}
+
+}}}
+
+#endif // BOOST_MPL_AUX_UNWRAP_HPP_INCLUDED
diff --git a/ndnboost/mpl/begin.hpp b/ndnboost/mpl/begin.hpp
deleted file mode 100644
index 81a2cd0..0000000
--- a/ndnboost/mpl/begin.hpp
+++ /dev/null
@@ -1,19 +0,0 @@
-
-#ifndef BOOST_MPL_BEGIN_HPP_INCLUDED
-#define BOOST_MPL_BEGIN_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: begin.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/begin_end.hpp>
-
-#endif // BOOST_MPL_BEGIN_HPP_INCLUDED
diff --git a/ndnboost/mpl/bitand.hpp b/ndnboost/mpl/bitand.hpp
deleted file mode 100644
index 1358edb..0000000
--- a/ndnboost/mpl/bitand.hpp
+++ /dev/null
@@ -1,45 +0,0 @@
-
-#ifndef BOOST_MPL_BITAND_HPP_INCLUDED
-#define BOOST_MPL_BITAND_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2009
-// Copyright Jaap Suter 2003
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: bitand.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
-// $Date: 2010-07-02 01:59:55 -0700 (Fri, 02 Jul 2010) $
-// $Revision: 63520 $
-
-// agurt, 23/jan/10: workaround a conflict with <iso646.h> header's
-// macros, see http://tinyurl.com/ycwdxco; 'defined(bitand)'
-// has to be checked in a separate condition, otherwise GCC complains
-// about 'bitand' being an alternative token
-#if defined(_MSC_VER)
-#ifndef __GCCXML__
-#if defined(bitand)
-# pragma push_macro("bitand")
-# undef bitand
-# define bitand(x)
-#endif
-#endif
-#endif
-
-#define AUX778076_OP_NAME bitand_
-#define AUX778076_OP_PREFIX bitand
-#define AUX778076_OP_TOKEN &
-#include <ndnboost/mpl/aux_/arithmetic_op.hpp>
-
-#if defined(_MSC_VER)
-#ifndef __GCCXML__
-#if defined(bitand)
-# pragma pop_macro("bitand")
-#endif
-#endif
-#endif
-
-#endif // BOOST_MPL_BITAND_HPP_INCLUDED
diff --git a/ndnboost/mpl/bitxor.hpp b/ndnboost/mpl/bitxor.hpp
deleted file mode 100644
index cae9992..0000000
--- a/ndnboost/mpl/bitxor.hpp
+++ /dev/null
@@ -1,23 +0,0 @@
-
-#ifndef BOOST_MPL_BITXOR_HPP_INCLUDED
-#define BOOST_MPL_BITXOR_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-// Copyright Jaap Suter 2003
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: bitxor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#define AUX778076_OP_NAME bitxor_
-#define AUX778076_OP_PREFIX bitxor
-#define AUX778076_OP_TOKEN ^
-#include <ndnboost/mpl/aux_/arithmetic_op.hpp>
-
-#endif // BOOST_MPL_BITXOR_HPP_INCLUDED
diff --git a/ndnboost/mpl/comparison.hpp b/ndnboost/mpl/comparison.hpp
new file mode 100644
index 0000000..617ea5f
--- /dev/null
+++ b/ndnboost/mpl/comparison.hpp
@@ -0,0 +1,24 @@
+
+#ifndef BOOST_MPL_COMPARISON_HPP_INCLUDED
+#define BOOST_MPL_COMPARISON_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: comparison.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/equal_to.hpp>
+#include <ndnboost/mpl/not_equal_to.hpp>
+#include <ndnboost/mpl/less.hpp>
+#include <ndnboost/mpl/greater.hpp>
+#include <ndnboost/mpl/less_equal.hpp>
+#include <ndnboost/mpl/greater_equal.hpp>
+
+#endif // BOOST_MPL_COMPARISON_HPP_INCLUDED
diff --git a/ndnboost/mpl/for_each.hpp b/ndnboost/mpl/for_each.hpp
new file mode 100644
index 0000000..a98dc5b
--- /dev/null
+++ b/ndnboost/mpl/for_each.hpp
@@ -0,0 +1,116 @@
+
+#ifndef BOOST_MPL_FOR_EACH_HPP_INCLUDED
+#define BOOST_MPL_FOR_EACH_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2008
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: for_each.hpp 55648 2009-08-18 05:16:53Z agurtovoy $
+// $Date: 2009-08-17 22:16:53 -0700 (Mon, 17 Aug 2009) $
+// $Revision: 55648 $
+
+#include <ndnboost/mpl/is_sequence.hpp>
+#include <ndnboost/mpl/begin_end.hpp>
+#include <ndnboost/mpl/apply.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/next_prior.hpp>
+#include <ndnboost/mpl/deref.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/mpl/assert.hpp>
+#include <ndnboost/mpl/aux_/unwrap.hpp>
+
+#include <ndnboost/type_traits/is_same.hpp>
+#include <ndnboost/utility/value_init.hpp>
+
+namespace ndnboost { namespace mpl {
+
+namespace aux {
+
+template< bool done = true >
+struct for_each_impl
+{
+ template<
+ typename Iterator
+ , typename LastIterator
+ , typename TransformFunc
+ , typename F
+ >
+ static void execute(
+ Iterator*
+ , LastIterator*
+ , TransformFunc*
+ , F
+ )
+ {
+ }
+};
+
+template<>
+struct for_each_impl<false>
+{
+ template<
+ typename Iterator
+ , typename LastIterator
+ , typename TransformFunc
+ , typename F
+ >
+ static void execute(
+ Iterator*
+ , LastIterator*
+ , TransformFunc*
+ , F f
+ )
+ {
+ typedef typename deref<Iterator>::type item;
+ typedef typename apply1<TransformFunc,item>::type arg;
+
+ // dwa 2002/9/10 -- make sure not to invoke undefined behavior
+ // when we pass arg.
+ value_initialized<arg> x;
+ aux::unwrap(f, 0)(ndnboost::get(x));
+
+ typedef typename mpl::next<Iterator>::type iter;
+ for_each_impl<ndnboost::is_same<iter,LastIterator>::value>
+ ::execute( static_cast<iter*>(0), static_cast<LastIterator*>(0), static_cast<TransformFunc*>(0), f);
+ }
+};
+
+} // namespace aux
+
+// agurt, 17/mar/02: pointer default parameters are necessary to workaround
+// MSVC 6.5 function template signature's mangling bug
+template<
+ typename Sequence
+ , typename TransformOp
+ , typename F
+ >
+inline
+void for_each(F f, Sequence* = 0, TransformOp* = 0)
+{
+ BOOST_MPL_ASSERT(( is_sequence<Sequence> ));
+
+ typedef typename begin<Sequence>::type first;
+ typedef typename end<Sequence>::type last;
+
+ aux::for_each_impl< ndnboost::is_same<first,last>::value >
+ ::execute(static_cast<first*>(0), static_cast<last*>(0), static_cast<TransformOp*>(0), f);
+}
+
+template<
+ typename Sequence
+ , typename F
+ >
+inline
+void for_each(F f, Sequence* = 0)
+{
+ for_each<Sequence, identity<> >(f);
+}
+
+}}
+
+#endif // BOOST_MPL_FOR_EACH_HPP_INCLUDED
diff --git a/ndnboost/mpl/front.hpp b/ndnboost/mpl/front.hpp
deleted file mode 100644
index 118b112..0000000
--- a/ndnboost/mpl/front.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-#ifndef BOOST_MPL_FRONT_HPP_INCLUDED
-#define BOOST_MPL_FRONT_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/front_fwd.hpp>
-#include <ndnboost/mpl/aux_/front_impl.hpp>
-#include <ndnboost/mpl/sequence_tag.hpp>
-#include <ndnboost/mpl/aux_/na_spec.hpp>
-#include <ndnboost/mpl/aux_/lambda_support.hpp>
-
-namespace ndnboost { namespace mpl {
-
-template<
- typename BOOST_MPL_AUX_NA_PARAM(Sequence)
- >
-struct front
- : front_impl< typename sequence_tag<Sequence>::type >
- ::template apply< Sequence >
-{
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,front,(Sequence))
-};
-
-BOOST_MPL_AUX_NA_SPEC(1, front)
-
-}}
-
-#endif // BOOST_MPL_FRONT_HPP_INCLUDED
diff --git a/ndnboost/mpl/greater.hpp b/ndnboost/mpl/greater.hpp
new file mode 100644
index 0000000..53f5db0
--- /dev/null
+++ b/ndnboost/mpl/greater.hpp
@@ -0,0 +1,21 @@
+
+#ifndef BOOST_MPL_GREATER_HPP_INCLUDED
+#define BOOST_MPL_GREATER_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: greater.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#define AUX778076_OP_NAME greater
+#define AUX778076_OP_TOKEN >
+#include <ndnboost/mpl/aux_/comparison_op.hpp>
+
+#endif // BOOST_MPL_GREATER_HPP_INCLUDED
diff --git a/ndnboost/mpl/greater_equal.hpp b/ndnboost/mpl/greater_equal.hpp
new file mode 100644
index 0000000..0576e01
--- /dev/null
+++ b/ndnboost/mpl/greater_equal.hpp
@@ -0,0 +1,21 @@
+
+#ifndef BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED
+#define BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: greater_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#define AUX778076_OP_NAME greater_equal
+#define AUX778076_OP_TOKEN >=
+#include <ndnboost/mpl/aux_/comparison_op.hpp>
+
+#endif // BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED
diff --git a/ndnboost/mpl/joint_view.hpp b/ndnboost/mpl/joint_view.hpp
deleted file mode 100644
index 709c822..0000000
--- a/ndnboost/mpl/joint_view.hpp
+++ /dev/null
@@ -1,65 +0,0 @@
-
-#ifndef BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
-#define BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: joint_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/aux_/joint_iter.hpp>
-#include <ndnboost/mpl/plus.hpp>
-#include <ndnboost/mpl/size_fwd.hpp>
-#include <ndnboost/mpl/begin_end.hpp>
-#include <ndnboost/mpl/aux_/na_spec.hpp>
-
-namespace ndnboost { namespace mpl {
-
-namespace aux {
-struct joint_view_tag;
-}
-
-template<>
-struct size_impl< aux::joint_view_tag >
-{
- template < typename JointView > struct apply
- : plus<
- size<typename JointView::sequence1_>
- , size<typename JointView::sequence2_>
- >
- {};
-};
-
-template<
- typename BOOST_MPL_AUX_NA_PARAM(Sequence1_)
- , typename BOOST_MPL_AUX_NA_PARAM(Sequence2_)
- >
-struct joint_view
-{
- typedef typename mpl::begin<Sequence1_>::type first1_;
- typedef typename mpl::end<Sequence1_>::type last1_;
- typedef typename mpl::begin<Sequence2_>::type first2_;
- typedef typename mpl::end<Sequence2_>::type last2_;
-
- // agurt, 25/may/03: for the 'size_traits' implementation above
- typedef Sequence1_ sequence1_;
- typedef Sequence2_ sequence2_;
-
- typedef joint_view type;
- typedef aux::joint_view_tag tag;
- typedef joint_iter<first1_,last1_,first2_> begin;
- typedef joint_iter<last1_,last1_,last2_> end;
-};
-
-BOOST_MPL_AUX_NA_SPEC(2, joint_view)
-
-}}
-
-#endif // BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
diff --git a/ndnboost/mpl/less_equal.hpp b/ndnboost/mpl/less_equal.hpp
new file mode 100644
index 0000000..9fd7a46
--- /dev/null
+++ b/ndnboost/mpl/less_equal.hpp
@@ -0,0 +1,21 @@
+
+#ifndef BOOST_MPL_LESS_EQUAL_HPP_INCLUDED
+#define BOOST_MPL_LESS_EQUAL_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: less_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#define AUX778076_OP_NAME less_equal
+#define AUX778076_OP_TOKEN <=
+#include <ndnboost/mpl/aux_/comparison_op.hpp>
+
+#endif // BOOST_MPL_LESS_EQUAL_HPP_INCLUDED
diff --git a/ndnboost/mpl/limits/list.hpp b/ndnboost/mpl/limits/list.hpp
new file mode 100644
index 0000000..6ae7387
--- /dev/null
+++ b/ndnboost/mpl/limits/list.hpp
@@ -0,0 +1,21 @@
+
+#ifndef BOOST_MPL_LIMITS_LIST_HPP_INCLUDED
+#define BOOST_MPL_LIMITS_LIST_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_LIMIT_LIST_SIZE)
+# define BOOST_MPL_LIMIT_LIST_SIZE 20
+#endif
+
+#endif // BOOST_MPL_LIMITS_LIST_HPP_INCLUDED
diff --git a/ndnboost/mpl/list.hpp b/ndnboost/mpl/list.hpp
new file mode 100644
index 0000000..8ce6ad5
--- /dev/null
+++ b/ndnboost/mpl/list.hpp
@@ -0,0 +1,57 @@
+
+#ifndef BOOST_MPL_LIST_HPP_INCLUDED
+#define BOOST_MPL_LIST_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/limits/list.hpp>
+# include <ndnboost/mpl/aux_/na.hpp>
+# include <ndnboost/mpl/aux_/config/preprocessor.hpp>
+
+# include <ndnboost/preprocessor/inc.hpp>
+# include <ndnboost/preprocessor/cat.hpp>
+# include <ndnboost/preprocessor/stringize.hpp>
+
+#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
+# define AUX778076_LIST_HEADER \
+ BOOST_PP_CAT(list,BOOST_MPL_LIMIT_LIST_SIZE).hpp \
+ /**/
+#else
+# define AUX778076_LIST_HEADER \
+ BOOST_PP_CAT(list,BOOST_MPL_LIMIT_LIST_SIZE)##.hpp \
+ /**/
+#endif
+
+# include BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_HEADER)
+# undef AUX778076_LIST_HEADER
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list.hpp
+# include <ndnboost/mpl/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/mpl/limits/list.hpp>
+
+# define AUX778076_SEQUENCE_NAME list
+# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_LIST_SIZE
+# include <ndnboost/mpl/aux_/sequence_wrapper.hpp>
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+#endif // BOOST_MPL_LIST_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/O1_size.hpp b/ndnboost/mpl/list/aux_/O1_size.hpp
new file mode 100644
index 0000000..f5fda21
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/O1_size.hpp
@@ -0,0 +1,33 @@
+
+#ifndef BOOST_MPL_LIST_AUX_O1_SIZE_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_O1_SIZE_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/O1_size_fwd.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct O1_size_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ : List::size
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_O1_SIZE_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/begin_end.hpp b/ndnboost/mpl/list/aux_/begin_end.hpp
new file mode 100644
index 0000000..6c3e7ff
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/begin_end.hpp
@@ -0,0 +1,44 @@
+
+#ifndef BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: begin_end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/begin_end_fwd.hpp>
+#include <ndnboost/mpl/list/aux_/iterator.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+#include <ndnboost/mpl/list/aux_/item.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct begin_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ {
+ typedef l_iter<typename List::type> type;
+ };
+};
+
+template<>
+struct end_impl< aux::list_tag >
+{
+ template< typename > struct apply
+ {
+ typedef l_iter<l_end> type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/clear.hpp b/ndnboost/mpl/list/aux_/clear.hpp
new file mode 100644
index 0000000..05cf597
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/clear.hpp
@@ -0,0 +1,34 @@
+
+#ifndef BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: clear.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/clear_fwd.hpp>
+#include <ndnboost/mpl/list/aux_/item.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct clear_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ {
+ typedef l_end type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/empty.hpp b/ndnboost/mpl/list/aux_/empty.hpp
new file mode 100644
index 0000000..e40effc
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/empty.hpp
@@ -0,0 +1,34 @@
+
+#ifndef BOOST_MPL_LIST_AUX_EMPTY_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_EMPTY_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/empty_fwd.hpp>
+#include <ndnboost/mpl/not.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct empty_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ : not_<typename List::size>
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_EMPTY_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/front.hpp b/ndnboost/mpl/list/aux_/front.hpp
new file mode 100644
index 0000000..dcb43ab
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/front.hpp
@@ -0,0 +1,33 @@
+
+#ifndef BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/front_fwd.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct front_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ {
+ typedef typename List::item type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/include_preprocessed.hpp b/ndnboost/mpl/list/aux_/include_preprocessed.hpp
new file mode 100644
index 0000000..8ce5d6e
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/include_preprocessed.hpp
@@ -0,0 +1,35 @@
+
+// Copyright Aleksey Gurtovoy 2001-2006
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION!
+
+#include <ndnboost/mpl/aux_/config/workaround.hpp>
+
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/stringize.hpp>
+
+# define AUX778076_HEADER \
+ aux_/preprocessed/plain/BOOST_MPL_PREPROCESSED_HEADER \
+/**/
+
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(700))
+# define AUX778076_INCLUDE_STRING BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER)
+# include AUX778076_INCLUDE_STRING
+# undef AUX778076_INCLUDE_STRING
+#else
+# include BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER)
+#endif
+
+# undef AUX778076_HEADER
+
+#undef BOOST_MPL_PREPROCESSED_HEADER
diff --git a/ndnboost/mpl/list/aux_/item.hpp b/ndnboost/mpl/list/aux_/item.hpp
new file mode 100644
index 0000000..3048007
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/item.hpp
@@ -0,0 +1,55 @@
+
+#ifndef BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/long.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+#include <ndnboost/mpl/aux_/config/msvc.hpp>
+#include <ndnboost/mpl/aux_/config/workaround.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename Size
+ , typename T
+ , typename Next
+ >
+struct l_item
+{
+// agurt, 17/jul/03: to facilitate the deficient 'is_sequence' implementation
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ typedef int begin;
+#endif
+ typedef aux::list_tag tag;
+ typedef l_item type;
+
+ typedef Size size;
+ typedef T item;
+ typedef Next next;
+};
+
+struct l_end
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ typedef int begin;
+#endif
+ typedef aux::list_tag tag;
+ typedef l_end type;
+ typedef long_<0> size;
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/iterator.hpp b/ndnboost/mpl/list/aux_/iterator.hpp
new file mode 100644
index 0000000..492f779
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/iterator.hpp
@@ -0,0 +1,76 @@
+
+#ifndef BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/iterator_tags.hpp>
+#include <ndnboost/mpl/next_prior.hpp>
+#include <ndnboost/mpl/deref.hpp>
+#include <ndnboost/mpl/list/aux_/item.hpp>
+#include <ndnboost/mpl/aux_/na.hpp>
+#include <ndnboost/mpl/aux_/lambda_spec.hpp>
+#include <ndnboost/mpl/aux_/config/ctps.hpp>
+
+namespace ndnboost { namespace mpl {
+
+#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+template< typename Node >
+struct l_iter
+{
+ typedef aux::l_iter_tag tag;
+ typedef forward_iterator_tag category;
+};
+
+template< typename Node >
+struct deref< l_iter<Node> >
+{
+ typedef typename Node::item type;
+};
+
+template< typename Node >
+struct next< l_iter<Node> >
+{
+ typedef l_iter< typename Node::next > type;
+};
+
+#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+template< typename Node >
+struct l_iter
+{
+ typedef aux::l_iter_tag tag;
+ typedef forward_iterator_tag category;
+ typedef typename Node::item type;
+ typedef l_iter< typename mpl::next<Node>::type > next;
+};
+
+#endif
+
+
+template<> struct l_iter<l_end>
+{
+ typedef aux::l_iter_tag tag;
+ typedef forward_iterator_tag category;
+#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+ typedef na type;
+ typedef l_iter next;
+#endif
+};
+
+BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, l_iter)
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/numbered.hpp b/ndnboost/mpl/list/aux_/numbered.hpp
new file mode 100644
index 0000000..052c368
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/numbered.hpp
@@ -0,0 +1,68 @@
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Peter Dimov 2000-2002
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: numbered.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if defined(BOOST_PP_IS_ITERATING)
+
+#include <ndnboost/preprocessor/enum_params.hpp>
+#include <ndnboost/preprocessor/enum_shifted_params.hpp>
+#include <ndnboost/preprocessor/dec.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+
+#define i BOOST_PP_FRAME_ITERATION(1)
+
+#if i == 1
+
+template<
+ BOOST_PP_ENUM_PARAMS(i, typename T)
+ >
+struct list1
+ : l_item<
+ long_<1>
+ , T0
+ , l_end
+ >
+{
+ typedef list1 type;
+};
+
+#else
+
+# define MPL_AUX_LIST_TAIL(list, i, T) \
+ BOOST_PP_CAT(list,BOOST_PP_DEC(i))< \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(i, T) \
+ > \
+ /**/
+
+template<
+ BOOST_PP_ENUM_PARAMS(i, typename T)
+ >
+struct BOOST_PP_CAT(list,i)
+ : l_item<
+ long_<i>
+ , T0
+ , MPL_AUX_LIST_TAIL(list,i,T)
+ >
+{
+ typedef BOOST_PP_CAT(list,i) type;
+};
+
+# undef MPL_AUX_LIST_TAIL
+
+#endif // i == 1
+
+#undef i
+
+#endif // BOOST_PP_IS_ITERATING
diff --git a/ndnboost/mpl/list/aux_/numbered_c.hpp b/ndnboost/mpl/list/aux_/numbered_c.hpp
new file mode 100644
index 0000000..7126440
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/numbered_c.hpp
@@ -0,0 +1,71 @@
+
+// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: numbered_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if defined(BOOST_PP_IS_ITERATING)
+
+#include <ndnboost/preprocessor/enum_params.hpp>
+#include <ndnboost/preprocessor/enum_shifted_params.hpp>
+#include <ndnboost/preprocessor/dec.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+
+#define i BOOST_PP_FRAME_ITERATION(1)
+
+#if i == 1
+
+template<
+ typename T
+ , BOOST_PP_ENUM_PARAMS(i, T C)
+ >
+struct list1_c
+ : l_item<
+ long_<1>
+ , integral_c<T,C0>
+ , l_end
+ >
+{
+ typedef list1_c type;
+ typedef T value_type;
+};
+
+#else
+
+# define MPL_AUX_LIST_C_TAIL(list, i, C) \
+ BOOST_PP_CAT(BOOST_PP_CAT(list,BOOST_PP_DEC(i)),_c)<T, \
+ BOOST_PP_ENUM_SHIFTED_PARAMS(i, C) \
+ > \
+ /**/
+
+template<
+ typename T
+ , BOOST_PP_ENUM_PARAMS(i, T C)
+ >
+struct BOOST_PP_CAT(BOOST_PP_CAT(list,i),_c)
+ : l_item<
+ long_<i>
+ , integral_c<T,C0>
+ , MPL_AUX_LIST_C_TAIL(list,i,C)
+ >
+{
+ typedef BOOST_PP_CAT(BOOST_PP_CAT(list,i),_c) type;
+ typedef T value_type;
+};
+
+# undef MPL_AUX_LIST_C_TAIL
+
+#endif // i == 1
+
+#undef i
+
+#endif // BOOST_PP_IS_ITERATING
diff --git a/ndnboost/mpl/list/aux_/pop_front.hpp b/ndnboost/mpl/list/aux_/pop_front.hpp
new file mode 100644
index 0000000..27c2dae
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/pop_front.hpp
@@ -0,0 +1,34 @@
+
+#ifndef BOOST_MPL_LIST_AUX_POP_FRONT_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_POP_FRONT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/pop_front_fwd.hpp>
+#include <ndnboost/mpl/next_prior.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct pop_front_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ {
+ typedef typename mpl::next<List>::type type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_POP_FRONT_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list10.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list10.hpp
new file mode 100644
index 0000000..2e8edb2
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list10.hpp
@@ -0,0 +1,149 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list10.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T0
+ >
+struct list1
+ : l_item<
+ long_<1>
+ , T0
+ , l_end
+ >
+{
+ typedef list1 type;
+};
+
+template<
+ typename T0, typename T1
+ >
+struct list2
+ : l_item<
+ long_<2>
+ , T0
+ , list1<T1>
+ >
+{
+ typedef list2 type;
+};
+
+template<
+ typename T0, typename T1, typename T2
+ >
+struct list3
+ : l_item<
+ long_<3>
+ , T0
+ , list2< T1,T2 >
+ >
+{
+ typedef list3 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3
+ >
+struct list4
+ : l_item<
+ long_<4>
+ , T0
+ , list3< T1,T2,T3 >
+ >
+{
+ typedef list4 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ >
+struct list5
+ : l_item<
+ long_<5>
+ , T0
+ , list4< T1,T2,T3,T4 >
+ >
+{
+ typedef list5 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5
+ >
+struct list6
+ : l_item<
+ long_<6>
+ , T0
+ , list5< T1,T2,T3,T4,T5 >
+ >
+{
+ typedef list6 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6
+ >
+struct list7
+ : l_item<
+ long_<7>
+ , T0
+ , list6< T1,T2,T3,T4,T5,T6 >
+ >
+{
+ typedef list7 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7
+ >
+struct list8
+ : l_item<
+ long_<8>
+ , T0
+ , list7< T1,T2,T3,T4,T5,T6,T7 >
+ >
+{
+ typedef list8 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8
+ >
+struct list9
+ : l_item<
+ long_<9>
+ , T0
+ , list8< T1,T2,T3,T4,T5,T6,T7,T8 >
+ >
+{
+ typedef list9 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ >
+struct list10
+ : l_item<
+ long_<10>
+ , T0
+ , list9< T1,T2,T3,T4,T5,T6,T7,T8,T9 >
+ >
+{
+ typedef list10 type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list10_c.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list10_c.hpp
new file mode 100644
index 0000000..bfc0582
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list10_c.hpp
@@ -0,0 +1,164 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list10_c.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T
+ , T C0
+ >
+struct list1_c
+ : l_item<
+ long_<1>
+ , integral_c< T,C0 >
+ , l_end
+ >
+{
+ typedef list1_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1
+ >
+struct list2_c
+ : l_item<
+ long_<2>
+ , integral_c< T,C0 >
+ , list1_c< T,C1 >
+ >
+{
+ typedef list2_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2
+ >
+struct list3_c
+ : l_item<
+ long_<3>
+ , integral_c< T,C0 >
+ , list2_c< T,C1,C2 >
+ >
+{
+ typedef list3_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3
+ >
+struct list4_c
+ : l_item<
+ long_<4>
+ , integral_c< T,C0 >
+ , list3_c< T,C1,C2,C3 >
+ >
+{
+ typedef list4_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4
+ >
+struct list5_c
+ : l_item<
+ long_<5>
+ , integral_c< T,C0 >
+ , list4_c< T,C1,C2,C3,C4 >
+ >
+{
+ typedef list5_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5
+ >
+struct list6_c
+ : l_item<
+ long_<6>
+ , integral_c< T,C0 >
+ , list5_c< T,C1,C2,C3,C4,C5 >
+ >
+{
+ typedef list6_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6
+ >
+struct list7_c
+ : l_item<
+ long_<7>
+ , integral_c< T,C0 >
+ , list6_c< T,C1,C2,C3,C4,C5,C6 >
+ >
+{
+ typedef list7_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7
+ >
+struct list8_c
+ : l_item<
+ long_<8>
+ , integral_c< T,C0 >
+ , list7_c< T,C1,C2,C3,C4,C5,C6,C7 >
+ >
+{
+ typedef list8_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8
+ >
+struct list9_c
+ : l_item<
+ long_<9>
+ , integral_c< T,C0 >
+ , list8_c< T,C1,C2,C3,C4,C5,C6,C7,C8 >
+ >
+{
+ typedef list9_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9
+ >
+struct list10_c
+ : l_item<
+ long_<10>
+ , integral_c< T,C0 >
+ , list9_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9 >
+ >
+{
+ typedef list10_c type;
+ typedef T value_type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list20.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list20.hpp
new file mode 100644
index 0000000..8b64295
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list20.hpp
@@ -0,0 +1,169 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list20.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10
+ >
+struct list11
+ : l_item<
+ long_<11>
+ , T0
+ , list10< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 >
+ >
+{
+ typedef list11 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11
+ >
+struct list12
+ : l_item<
+ long_<12>
+ , T0
+ , list11< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 >
+ >
+{
+ typedef list12 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12
+ >
+struct list13
+ : l_item<
+ long_<13>
+ , T0
+ , list12< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 >
+ >
+{
+ typedef list13 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13
+ >
+struct list14
+ : l_item<
+ long_<14>
+ , T0
+ , list13< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 >
+ >
+{
+ typedef list14 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ >
+struct list15
+ : l_item<
+ long_<15>
+ , T0
+ , list14< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 >
+ >
+{
+ typedef list15 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15
+ >
+struct list16
+ : l_item<
+ long_<16>
+ , T0
+ , list15< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 >
+ >
+{
+ typedef list16 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16
+ >
+struct list17
+ : l_item<
+ long_<17>
+ , T0
+ , list16< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 >
+ >
+{
+ typedef list17 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17
+ >
+struct list18
+ : l_item<
+ long_<18>
+ , T0
+ , list17< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 >
+ >
+{
+ typedef list18 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18
+ >
+struct list19
+ : l_item<
+ long_<19>
+ , T0
+ , list18< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 >
+ >
+{
+ typedef list19 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ >
+struct list20
+ : l_item<
+ long_<20>
+ , T0
+ , list19< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 >
+ >
+{
+ typedef list20 type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list20_c.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list20_c.hpp
new file mode 100644
index 0000000..ec34def
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list20_c.hpp
@@ -0,0 +1,173 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list20_c.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ >
+struct list11_c
+ : l_item<
+ long_<11>
+ , integral_c< T,C0 >
+ , list10_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10 >
+ >
+{
+ typedef list11_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11
+ >
+struct list12_c
+ : l_item<
+ long_<12>
+ , integral_c< T,C0 >
+ , list11_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 >
+ >
+{
+ typedef list12_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12
+ >
+struct list13_c
+ : l_item<
+ long_<13>
+ , integral_c< T,C0 >
+ , list12_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12 >
+ >
+{
+ typedef list13_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13
+ >
+struct list14_c
+ : l_item<
+ long_<14>
+ , integral_c< T,C0 >
+ , list13_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13 >
+ >
+{
+ typedef list14_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14
+ >
+struct list15_c
+ : l_item<
+ long_<15>
+ , integral_c< T,C0 >
+ , list14_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14 >
+ >
+{
+ typedef list15_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15
+ >
+struct list16_c
+ : l_item<
+ long_<16>
+ , integral_c< T,C0 >
+ , list15_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15 >
+ >
+{
+ typedef list16_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16
+ >
+struct list17_c
+ : l_item<
+ long_<17>
+ , integral_c< T,C0 >
+ , list16_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16 >
+ >
+{
+ typedef list17_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17
+ >
+struct list18_c
+ : l_item<
+ long_<18>
+ , integral_c< T,C0 >
+ , list17_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17 >
+ >
+{
+ typedef list18_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18
+ >
+struct list19_c
+ : l_item<
+ long_<19>
+ , integral_c< T,C0 >
+ , list18_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18 >
+ >
+{
+ typedef list19_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19
+ >
+struct list20_c
+ : l_item<
+ long_<20>
+ , integral_c< T,C0 >
+ , list19_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19 >
+ >
+{
+ typedef list20_c type;
+ typedef T value_type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list30.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list30.hpp
new file mode 100644
index 0000000..5cdcac7
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list30.hpp
@@ -0,0 +1,189 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list30.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20
+ >
+struct list21
+ : l_item<
+ long_<21>
+ , T0
+ , list20< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20 >
+ >
+{
+ typedef list21 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21
+ >
+struct list22
+ : l_item<
+ long_<22>
+ , T0
+ , list21< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21 >
+ >
+{
+ typedef list22 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22
+ >
+struct list23
+ : l_item<
+ long_<23>
+ , T0
+ , list22< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22 >
+ >
+{
+ typedef list23 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23
+ >
+struct list24
+ : l_item<
+ long_<24>
+ , T0
+ , list23< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23 >
+ >
+{
+ typedef list24 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ >
+struct list25
+ : l_item<
+ long_<25>
+ , T0
+ , list24< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24 >
+ >
+{
+ typedef list25 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25
+ >
+struct list26
+ : l_item<
+ long_<26>
+ , T0
+ , list25< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25 >
+ >
+{
+ typedef list26 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26
+ >
+struct list27
+ : l_item<
+ long_<27>
+ , T0
+ , list26< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26 >
+ >
+{
+ typedef list27 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27
+ >
+struct list28
+ : l_item<
+ long_<28>
+ , T0
+ , list27< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27 >
+ >
+{
+ typedef list28 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28
+ >
+struct list29
+ : l_item<
+ long_<29>
+ , T0
+ , list28< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28 >
+ >
+{
+ typedef list29 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ >
+struct list30
+ : l_item<
+ long_<30>
+ , T0
+ , list29< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29 >
+ >
+{
+ typedef list30 type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list30_c.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list30_c.hpp
new file mode 100644
index 0000000..3398150
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list30_c.hpp
@@ -0,0 +1,183 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list30_c.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ >
+struct list21_c
+ : l_item<
+ long_<21>
+ , integral_c< T,C0 >
+ , list20_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20 >
+ >
+{
+ typedef list21_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21
+ >
+struct list22_c
+ : l_item<
+ long_<22>
+ , integral_c< T,C0 >
+ , list21_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21 >
+ >
+{
+ typedef list22_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22
+ >
+struct list23_c
+ : l_item<
+ long_<23>
+ , integral_c< T,C0 >
+ , list22_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22 >
+ >
+{
+ typedef list23_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23
+ >
+struct list24_c
+ : l_item<
+ long_<24>
+ , integral_c< T,C0 >
+ , list23_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23 >
+ >
+{
+ typedef list24_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24
+ >
+struct list25_c
+ : l_item<
+ long_<25>
+ , integral_c< T,C0 >
+ , list24_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24 >
+ >
+{
+ typedef list25_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25
+ >
+struct list26_c
+ : l_item<
+ long_<26>
+ , integral_c< T,C0 >
+ , list25_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25 >
+ >
+{
+ typedef list26_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26
+ >
+struct list27_c
+ : l_item<
+ long_<27>
+ , integral_c< T,C0 >
+ , list26_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26 >
+ >
+{
+ typedef list27_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27
+ >
+struct list28_c
+ : l_item<
+ long_<28>
+ , integral_c< T,C0 >
+ , list27_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27 >
+ >
+{
+ typedef list28_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28
+ >
+struct list29_c
+ : l_item<
+ long_<29>
+ , integral_c< T,C0 >
+ , list28_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28 >
+ >
+{
+ typedef list29_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29
+ >
+struct list30_c
+ : l_item<
+ long_<30>
+ , integral_c< T,C0 >
+ , list29_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29 >
+ >
+{
+ typedef list30_c type;
+ typedef T value_type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list40.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list40.hpp
new file mode 100644
index 0000000..810ae99
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list40.hpp
@@ -0,0 +1,209 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list40.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30
+ >
+struct list31
+ : l_item<
+ long_<31>
+ , T0
+ , list30< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30 >
+ >
+{
+ typedef list31 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31
+ >
+struct list32
+ : l_item<
+ long_<32>
+ , T0
+ , list31< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31 >
+ >
+{
+ typedef list32 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32
+ >
+struct list33
+ : l_item<
+ long_<33>
+ , T0
+ , list32< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32 >
+ >
+{
+ typedef list33 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33
+ >
+struct list34
+ : l_item<
+ long_<34>
+ , T0
+ , list33< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33 >
+ >
+{
+ typedef list34 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ >
+struct list35
+ : l_item<
+ long_<35>
+ , T0
+ , list34< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34 >
+ >
+{
+ typedef list35 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35
+ >
+struct list36
+ : l_item<
+ long_<36>
+ , T0
+ , list35< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35 >
+ >
+{
+ typedef list36 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36
+ >
+struct list37
+ : l_item<
+ long_<37>
+ , T0
+ , list36< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36 >
+ >
+{
+ typedef list37 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37
+ >
+struct list38
+ : l_item<
+ long_<38>
+ , T0
+ , list37< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37 >
+ >
+{
+ typedef list38 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38
+ >
+struct list39
+ : l_item<
+ long_<39>
+ , T0
+ , list38< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38 >
+ >
+{
+ typedef list39 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ >
+struct list40
+ : l_item<
+ long_<40>
+ , T0
+ , list39< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39 >
+ >
+{
+ typedef list40 type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list40_c.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list40_c.hpp
new file mode 100644
index 0000000..18ed649
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list40_c.hpp
@@ -0,0 +1,193 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list40_c.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ >
+struct list31_c
+ : l_item<
+ long_<31>
+ , integral_c< T,C0 >
+ , list30_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30 >
+ >
+{
+ typedef list31_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31
+ >
+struct list32_c
+ : l_item<
+ long_<32>
+ , integral_c< T,C0 >
+ , list31_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31 >
+ >
+{
+ typedef list32_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32
+ >
+struct list33_c
+ : l_item<
+ long_<33>
+ , integral_c< T,C0 >
+ , list32_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32 >
+ >
+{
+ typedef list33_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33
+ >
+struct list34_c
+ : l_item<
+ long_<34>
+ , integral_c< T,C0 >
+ , list33_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33 >
+ >
+{
+ typedef list34_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34
+ >
+struct list35_c
+ : l_item<
+ long_<35>
+ , integral_c< T,C0 >
+ , list34_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34 >
+ >
+{
+ typedef list35_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35
+ >
+struct list36_c
+ : l_item<
+ long_<36>
+ , integral_c< T,C0 >
+ , list35_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35 >
+ >
+{
+ typedef list36_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36
+ >
+struct list37_c
+ : l_item<
+ long_<37>
+ , integral_c< T,C0 >
+ , list36_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36 >
+ >
+{
+ typedef list37_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37
+ >
+struct list38_c
+ : l_item<
+ long_<38>
+ , integral_c< T,C0 >
+ , list37_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37 >
+ >
+{
+ typedef list38_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38
+ >
+struct list39_c
+ : l_item<
+ long_<39>
+ , integral_c< T,C0 >
+ , list38_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38 >
+ >
+{
+ typedef list39_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39
+ >
+struct list40_c
+ : l_item<
+ long_<40>
+ , integral_c< T,C0 >
+ , list39_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39 >
+ >
+{
+ typedef list40_c type;
+ typedef T value_type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list50.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list50.hpp
new file mode 100644
index 0000000..5b8fda5
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list50.hpp
@@ -0,0 +1,229 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list50.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40
+ >
+struct list41
+ : l_item<
+ long_<41>
+ , T0
+ , list40< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40 >
+ >
+{
+ typedef list41 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41
+ >
+struct list42
+ : l_item<
+ long_<42>
+ , T0
+ , list41< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41 >
+ >
+{
+ typedef list42 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42
+ >
+struct list43
+ : l_item<
+ long_<43>
+ , T0
+ , list42< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42 >
+ >
+{
+ typedef list43 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43
+ >
+struct list44
+ : l_item<
+ long_<44>
+ , T0
+ , list43< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43 >
+ >
+{
+ typedef list44 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43, typename T44
+ >
+struct list45
+ : l_item<
+ long_<45>
+ , T0
+ , list44< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44 >
+ >
+{
+ typedef list45 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43, typename T44
+ , typename T45
+ >
+struct list46
+ : l_item<
+ long_<46>
+ , T0
+ , list45< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45 >
+ >
+{
+ typedef list46 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43, typename T44
+ , typename T45, typename T46
+ >
+struct list47
+ : l_item<
+ long_<47>
+ , T0
+ , list46< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46 >
+ >
+{
+ typedef list47 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43, typename T44
+ , typename T45, typename T46, typename T47
+ >
+struct list48
+ : l_item<
+ long_<48>
+ , T0
+ , list47< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47 >
+ >
+{
+ typedef list48 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43, typename T44
+ , typename T45, typename T46, typename T47, typename T48
+ >
+struct list49
+ : l_item<
+ long_<49>
+ , T0
+ , list48< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48 >
+ >
+{
+ typedef list49 type;
+};
+
+template<
+ typename T0, typename T1, typename T2, typename T3, typename T4
+ , typename T5, typename T6, typename T7, typename T8, typename T9
+ , typename T10, typename T11, typename T12, typename T13, typename T14
+ , typename T15, typename T16, typename T17, typename T18, typename T19
+ , typename T20, typename T21, typename T22, typename T23, typename T24
+ , typename T25, typename T26, typename T27, typename T28, typename T29
+ , typename T30, typename T31, typename T32, typename T33, typename T34
+ , typename T35, typename T36, typename T37, typename T38, typename T39
+ , typename T40, typename T41, typename T42, typename T43, typename T44
+ , typename T45, typename T46, typename T47, typename T48, typename T49
+ >
+struct list50
+ : l_item<
+ long_<50>
+ , T0
+ , list49< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49 >
+ >
+{
+ typedef list50 type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/preprocessed/plain/list50_c.hpp b/ndnboost/mpl/list/aux_/preprocessed/plain/list50_c.hpp
new file mode 100644
index 0000000..d0f619e
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/preprocessed/plain/list50_c.hpp
@@ -0,0 +1,203 @@
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+
+// Preprocessed version of "ndnboost/mpl/list/list50_c.hpp" header
+// -- DO NOT modify by hand!
+
+namespace ndnboost { namespace mpl {
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ >
+struct list41_c
+ : l_item<
+ long_<41>
+ , integral_c< T,C0 >
+ , list40_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40 >
+ >
+{
+ typedef list41_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41
+ >
+struct list42_c
+ : l_item<
+ long_<42>
+ , integral_c< T,C0 >
+ , list41_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41 >
+ >
+{
+ typedef list42_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42
+ >
+struct list43_c
+ : l_item<
+ long_<43>
+ , integral_c< T,C0 >
+ , list42_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42 >
+ >
+{
+ typedef list43_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43
+ >
+struct list44_c
+ : l_item<
+ long_<44>
+ , integral_c< T,C0 >
+ , list43_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43 >
+ >
+{
+ typedef list44_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43, T C44
+ >
+struct list45_c
+ : l_item<
+ long_<45>
+ , integral_c< T,C0 >
+ , list44_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44 >
+ >
+{
+ typedef list45_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43, T C44, T C45
+ >
+struct list46_c
+ : l_item<
+ long_<46>
+ , integral_c< T,C0 >
+ , list45_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45 >
+ >
+{
+ typedef list46_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43, T C44, T C45, T C46
+ >
+struct list47_c
+ : l_item<
+ long_<47>
+ , integral_c< T,C0 >
+ , list46_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46 >
+ >
+{
+ typedef list47_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43, T C44, T C45, T C46, T C47
+ >
+struct list48_c
+ : l_item<
+ long_<48>
+ , integral_c< T,C0 >
+ , list47_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47 >
+ >
+{
+ typedef list48_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43, T C44, T C45, T C46, T C47, T C48
+ >
+struct list49_c
+ : l_item<
+ long_<49>
+ , integral_c< T,C0 >
+ , list48_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47,C48 >
+ >
+{
+ typedef list49_c type;
+ typedef T value_type;
+};
+
+template<
+ typename T
+ , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10
+ , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20
+ , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30
+ , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40
+ , T C41, T C42, T C43, T C44, T C45, T C46, T C47, T C48, T C49
+ >
+struct list50_c
+ : l_item<
+ long_<50>
+ , integral_c< T,C0 >
+ , list49_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47,C48,C49 >
+ >
+{
+ typedef list50_c type;
+ typedef T value_type;
+};
+
+}}
diff --git a/ndnboost/mpl/list/aux_/push_back.hpp b/ndnboost/mpl/list/aux_/push_back.hpp
new file mode 100644
index 0000000..41c2f9c
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/push_back.hpp
@@ -0,0 +1,36 @@
+
+#ifndef BOOST_MPL_LIST_AUX_PUSH_BACK_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_PUSH_BACK_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: push_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/push_back_fwd.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template< typename Tag > struct has_push_back_impl;
+
+template<>
+struct has_push_back_impl< aux::list_tag >
+{
+ template< typename Seq > struct apply
+ : false_
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_PUSH_BACK_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/push_front.hpp b/ndnboost/mpl/list/aux_/push_front.hpp
new file mode 100644
index 0000000..9b0ed8c
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/push_front.hpp
@@ -0,0 +1,39 @@
+
+#ifndef BOOST_MPL_LIST_AUX_PUSH_FRONT_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_PUSH_FRONT_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: push_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/push_front_fwd.hpp>
+#include <ndnboost/mpl/next.hpp>
+#include <ndnboost/mpl/list/aux_/item.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct push_front_impl< aux::list_tag >
+{
+ template< typename List, typename T > struct apply
+ {
+ typedef l_item<
+ typename next<typename List::size>::type
+ , T
+ , typename List::type
+ > type;
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_PUSH_FRONT_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/size.hpp b/ndnboost/mpl/list/aux_/size.hpp
new file mode 100644
index 0000000..8581584
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/size.hpp
@@ -0,0 +1,33 @@
+
+#ifndef BOOST_MPL_LIST_AUX_SIZE_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_SIZE_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/size_fwd.hpp>
+#include <ndnboost/mpl/list/aux_/tag.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template<>
+struct size_impl< aux::list_tag >
+{
+ template< typename List > struct apply
+ : List::size
+ {
+ };
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_AUX_SIZE_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/aux_/tag.hpp b/ndnboost/mpl/list/aux_/tag.hpp
new file mode 100644
index 0000000..2322a81
--- /dev/null
+++ b/ndnboost/mpl/list/aux_/tag.hpp
@@ -0,0 +1,24 @@
+
+#ifndef BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED
+#define BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+namespace ndnboost { namespace mpl { namespace aux {
+
+struct list_tag;
+struct l_iter_tag;
+
+}}}
+
+#endif // BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list0.hpp b/ndnboost/mpl/list/list0.hpp
new file mode 100644
index 0000000..3cd88e7
--- /dev/null
+++ b/ndnboost/mpl/list/list0.hpp
@@ -0,0 +1,42 @@
+
+#ifndef BOOST_MPL_LIST_LIST0_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST0_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/long.hpp>
+#include <ndnboost/mpl/aux_/na.hpp>
+#include <ndnboost/mpl/list/aux_/push_front.hpp>
+#include <ndnboost/mpl/list/aux_/pop_front.hpp>
+#include <ndnboost/mpl/list/aux_/push_back.hpp>
+#include <ndnboost/mpl/list/aux_/front.hpp>
+#include <ndnboost/mpl/list/aux_/clear.hpp>
+#include <ndnboost/mpl/list/aux_/O1_size.hpp>
+#include <ndnboost/mpl/list/aux_/size.hpp>
+#include <ndnboost/mpl/list/aux_/empty.hpp>
+#include <ndnboost/mpl/list/aux_/begin_end.hpp>
+#include <ndnboost/mpl/list/aux_/item.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template< typename Dummy = na > struct list0;
+
+template<> struct list0<na>
+ : l_end
+{
+ typedef l_end type;
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_LIST0_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list0_c.hpp b/ndnboost/mpl/list/list0_c.hpp
new file mode 100644
index 0000000..882436a
--- /dev/null
+++ b/ndnboost/mpl/list/list0_c.hpp
@@ -0,0 +1,31 @@
+
+#ifndef BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list0_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#include <ndnboost/mpl/list/list0.hpp>
+#include <ndnboost/mpl/integral_c.hpp>
+
+namespace ndnboost { namespace mpl {
+
+template< typename T > struct list0_c
+ : l_end
+{
+ typedef l_end type;
+ typedef T value_type;
+};
+
+}}
+
+#endif // BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list10.hpp b/ndnboost/mpl/list/list10.hpp
new file mode 100644
index 0000000..f78cf33
--- /dev/null
+++ b/ndnboost/mpl/list/list10.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST10_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST10_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list10.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list0.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list10.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(1, 10, <ndnboost/mpl/list/aux_/numbered.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST10_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list10_c.hpp b/ndnboost/mpl/list/list10_c.hpp
new file mode 100644
index 0000000..86f3d89
--- /dev/null
+++ b/ndnboost/mpl/list/list10_c.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST10_C_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST10_C_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list10_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list0_c.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list10_c.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(1, 10, <ndnboost/mpl/list/aux_/numbered_c.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST10_C_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list20.hpp b/ndnboost/mpl/list/list20.hpp
new file mode 100644
index 0000000..a9dd822
--- /dev/null
+++ b/ndnboost/mpl/list/list20.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST20_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST20_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list20.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list10.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list20.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(11, 20, <ndnboost/mpl/list/aux_/numbered.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST20_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list20_c.hpp b/ndnboost/mpl/list/list20_c.hpp
new file mode 100644
index 0000000..deb2125
--- /dev/null
+++ b/ndnboost/mpl/list/list20_c.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list20_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list10_c.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list20_c.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(11, 20, <ndnboost/mpl/list/aux_/numbered_c.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list30.hpp b/ndnboost/mpl/list/list30.hpp
new file mode 100644
index 0000000..eaade39
--- /dev/null
+++ b/ndnboost/mpl/list/list30.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST30_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST30_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list30.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list20.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list30.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(21, 30, <ndnboost/mpl/list/aux_/numbered.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST30_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list30_c.hpp b/ndnboost/mpl/list/list30_c.hpp
new file mode 100644
index 0000000..6f9aa3c
--- /dev/null
+++ b/ndnboost/mpl/list/list30_c.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST30_C_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST30_C_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list30_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list20_c.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list30_c.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(21, 30, <ndnboost/mpl/list/aux_/numbered_c.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST30_C_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list40.hpp b/ndnboost/mpl/list/list40.hpp
new file mode 100644
index 0000000..1cc4511
--- /dev/null
+++ b/ndnboost/mpl/list/list40.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST40_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST40_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list40.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list30.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list40.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(31, 40, <ndnboost/mpl/list/aux_/numbered.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST40_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list40_c.hpp b/ndnboost/mpl/list/list40_c.hpp
new file mode 100644
index 0000000..0bea21d
--- /dev/null
+++ b/ndnboost/mpl/list/list40_c.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST40_C_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST40_C_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list40_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list30_c.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list40_c.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(31, 40, <ndnboost/mpl/list/aux_/numbered_c.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST40_C_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list50.hpp b/ndnboost/mpl/list/list50.hpp
new file mode 100644
index 0000000..5850c5a
--- /dev/null
+++ b/ndnboost/mpl/list/list50.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST50_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST50_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list50.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list40.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list50.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(41, 50, <ndnboost/mpl/list/aux_/numbered.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST50_HPP_INCLUDED
diff --git a/ndnboost/mpl/list/list50_c.hpp b/ndnboost/mpl/list/list50_c.hpp
new file mode 100644
index 0000000..12142f8
--- /dev/null
+++ b/ndnboost/mpl/list/list50_c.hpp
@@ -0,0 +1,43 @@
+
+#ifndef BOOST_MPL_LIST_LIST50_C_HPP_INCLUDED
+#define BOOST_MPL_LIST_LIST50_C_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: list50_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#if !defined(BOOST_MPL_PREPROCESSING_MODE)
+# include <ndnboost/mpl/list/list40_c.hpp>
+#endif
+
+#include <ndnboost/mpl/aux_/config/use_preprocessed.hpp>
+
+#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
+ && !defined(BOOST_MPL_PREPROCESSING_MODE)
+
+# define BOOST_MPL_PREPROCESSED_HEADER list50_c.hpp
+# include <ndnboost/mpl/list/aux_/include_preprocessed.hpp>
+
+#else
+
+# include <ndnboost/preprocessor/iterate.hpp>
+
+namespace ndnboost { namespace mpl {
+
+# define BOOST_PP_ITERATION_PARAMS_1 \
+ (3,(41, 50, <ndnboost/mpl/list/aux_/numbered_c.hpp>))
+# include BOOST_PP_ITERATE()
+
+}}
+
+#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
+
+#endif // BOOST_MPL_LIST_LIST50_C_HPP_INCLUDED
diff --git a/ndnboost/mpl/not_equal_to.hpp b/ndnboost/mpl/not_equal_to.hpp
new file mode 100644
index 0000000..3698bf6
--- /dev/null
+++ b/ndnboost/mpl/not_equal_to.hpp
@@ -0,0 +1,21 @@
+
+#ifndef BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED
+#define BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED
+
+// Copyright Aleksey Gurtovoy 2000-2004
+//
+// 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)
+//
+// See http://www.boost.org/libs/mpl for documentation.
+
+// $Id: not_equal_to.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
+// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
+// $Revision: 49267 $
+
+#define AUX778076_OP_NAME not_equal_to
+#define AUX778076_OP_TOKEN !=
+#include <ndnboost/mpl/aux_/comparison_op.hpp>
+
+#endif // BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED
diff --git a/ndnboost/mpl/pop_front.hpp b/ndnboost/mpl/pop_front.hpp
deleted file mode 100644
index fe7f3cb..0000000
--- a/ndnboost/mpl/pop_front.hpp
+++ /dev/null
@@ -1,39 +0,0 @@
-
-#ifndef BOOST_MPL_POP_FRONT_HPP_INCLUDED
-#define BOOST_MPL_POP_FRONT_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/pop_front_fwd.hpp>
-#include <ndnboost/mpl/aux_/pop_front_impl.hpp>
-#include <ndnboost/mpl/sequence_tag.hpp>
-#include <ndnboost/mpl/aux_/na_spec.hpp>
-#include <ndnboost/mpl/aux_/lambda_support.hpp>
-
-namespace ndnboost { namespace mpl {
-
-template<
- typename BOOST_MPL_AUX_NA_PARAM(Sequence)
- >
-struct pop_front
- : pop_front_impl< typename sequence_tag<Sequence>::type >
- ::template apply< Sequence >
-{
- BOOST_MPL_AUX_LAMBDA_SUPPORT(1,pop_front,(Sequence))
-};
-
-BOOST_MPL_AUX_NA_SPEC(1, pop_front)
-
-}}
-
-#endif // BOOST_MPL_POP_FRONT_HPP_INCLUDED
diff --git a/ndnboost/mpl/remove.hpp b/ndnboost/mpl/remove.hpp
deleted file mode 100644
index b080cfc..0000000
--- a/ndnboost/mpl/remove.hpp
+++ /dev/null
@@ -1,52 +0,0 @@
-
-#ifndef BOOST_MPL_REMOVE_HPP_INCLUDED
-#define BOOST_MPL_REMOVE_HPP_INCLUDED
-
-// Copyright Aleksey Gurtovoy 2000-2004
-// Copyright David Abrahams 2003-2004
-//
-// 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)
-//
-// See http://www.boost.org/libs/mpl for documentation.
-
-// $Id: remove.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
-// $Date: 2008-10-10 23:19:02 -0700 (Fri, 10 Oct 2008) $
-// $Revision: 49267 $
-
-#include <ndnboost/mpl/remove_if.hpp>
-#include <ndnboost/mpl/same_as.hpp>
-#include <ndnboost/mpl/aux_/inserter_algorithm.hpp>
-
-namespace ndnboost { namespace mpl {
-
-namespace aux {
-
-template<
- typename Sequence
- , typename T
- , typename Inserter
- >
-struct remove_impl
- : remove_if_impl< Sequence, same_as<T>, Inserter >
-{
-};
-
-template<
- typename Sequence
- , typename T
- , typename Inserter
- >
-struct reverse_remove_impl
- : reverse_remove_if_impl< Sequence, same_as<T>, Inserter >
-{
-};
-
-} // namespace aux
-
-BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove)
-
-}}
-
-#endif // BOOST_MPL_REMOVE_HPP_INCLUDED
diff --git a/ndnboost/next_prior.hpp b/ndnboost/next_prior.hpp
new file mode 100644
index 0000000..fe00ff1
--- /dev/null
+++ b/ndnboost/next_prior.hpp
@@ -0,0 +1,51 @@
+// Boost next_prior.hpp header file ---------------------------------------//
+
+// (C) Copyright Dave Abrahams and Daniel Walker 1999-2003. 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)
+
+// See http://www.boost.org/libs/utility for documentation.
+
+// Revision History
+// 13 Dec 2003 Added next(x, n) and prior(x, n) (Daniel Walker)
+
+#ifndef BOOST_NEXT_PRIOR_HPP_INCLUDED
+#define BOOST_NEXT_PRIOR_HPP_INCLUDED
+
+#include <iterator>
+
+namespace ndnboost {
+
+// Helper functions for classes like bidirectional iterators not supporting
+// operator+ and operator-
+//
+// Usage:
+// const std::list<T>::iterator p = get_some_iterator();
+// const std::list<T>::iterator prev = ndnboost::prior(p);
+// const std::list<T>::iterator next = ndnboost::next(prev, 2);
+
+// Contributed by Dave Abrahams
+
+template <class T>
+inline T next(T x) { return ++x; }
+
+template <class T, class Distance>
+inline T next(T x, Distance n)
+{
+ std::advance(x, n);
+ return x;
+}
+
+template <class T>
+inline T prior(T x) { return --x; }
+
+template <class T, class Distance>
+inline T prior(T x, Distance n)
+{
+ std::advance(x, -n);
+ return x;
+}
+
+} // namespace ndnboost
+
+#endif // BOOST_NEXT_PRIOR_HPP_INCLUDED
diff --git a/ndnboost/none.hpp b/ndnboost/none.hpp
new file mode 100644
index 0000000..58c32c6
--- /dev/null
+++ b/ndnboost/none.hpp
@@ -0,0 +1,28 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NONE_17SEP2003_HPP
+#define BOOST_NONE_17SEP2003_HPP
+
+#include "ndnboost/none_t.hpp"
+
+// NOTE: Borland users have to include this header outside any precompiled headers
+// (bcc<=5.64 cannot include instance data in a precompiled header)
+// -- * To be verified, now that there's no unnamed namespace
+
+namespace ndnboost {
+
+none_t const none = (static_cast<none_t>(0)) ;
+
+} // namespace ndnboost
+
+#endif
+
diff --git a/ndnboost/numeric/conversion/bounds.hpp b/ndnboost/numeric/conversion/bounds.hpp
new file mode 100644
index 0000000..2792ab0
--- /dev/null
+++ b/ndnboost/numeric/conversion/bounds.hpp
@@ -0,0 +1,24 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP
+
+#include "ndnboost/numeric/conversion/detail/bounds.hpp"
+
+namespace ndnboost { namespace numeric
+{
+
+template<class N>
+struct bounds : boundsdetail::get_impl<N>::type
+{} ;
+
+} } // namespace ndnboost::numeric
+
+#endif
diff --git a/ndnboost/numeric/conversion/cast.hpp b/ndnboost/numeric/conversion/cast.hpp
new file mode 100644
index 0000000..de542eb
--- /dev/null
+++ b/ndnboost/numeric/conversion/cast.hpp
@@ -0,0 +1,61 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+//
+// Revision History
+//
+// 19 Nov 2001 Syntatic changes as suggested by Darin Adler (Fernando Cacciola)
+// 08 Nov 2001 Fixes to accommodate MSVC (Fernando Cacciola)
+// 04 Nov 2001 Fixes to accommodate gcc2.92 (Fernando Cacciola)
+// 30 Oct 2001 Some fixes suggested by Daryle Walker (Fernando Cacciola)
+// 25 Oct 2001 Initial boostification (Fernando Cacciola)
+// 23 Jan 2004 Inital add to cvs (post review)s
+// 22 Jun 2011 Added support for specializing cast policies via numeric_cast_traits (Brandon Kohn).
+//
+#ifndef BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP
+#define BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP
+
+#include <ndnboost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+
+# include<ndnboost/numeric/conversion/detail/old_numeric_cast.hpp>
+
+#else
+
+#include <ndnboost/type.hpp>
+#include <ndnboost/numeric/conversion/converter.hpp>
+#include <ndnboost/numeric/conversion/numeric_cast_traits.hpp>
+
+namespace ndnboost
+{
+ template <typename Target, typename Source>
+ inline Target numeric_cast( Source arg )
+ {
+ typedef numeric::conversion_traits<Target, Source> conv_traits;
+ typedef numeric::numeric_cast_traits<Target, Source> cast_traits;
+ typedef ndnboost::numeric::converter
+ <
+ Target,
+ Source,
+ conv_traits,
+ typename cast_traits::overflow_policy,
+ typename cast_traits::rounding_policy,
+ ndnboost::numeric::raw_converter< conv_traits >,
+ typename cast_traits::range_checking_policy
+ > converter;
+ return converter::convert(arg);
+ }
+
+ using numeric::bad_numeric_cast;
+} // namespace ndnboost
+
+#endif
+
+#endif
diff --git a/ndnboost/numeric/conversion/conversion_traits.hpp b/ndnboost/numeric/conversion/conversion_traits.hpp
new file mode 100644
index 0000000..468acb1
--- /dev/null
+++ b/ndnboost/numeric/conversion/conversion_traits.hpp
@@ -0,0 +1,39 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+
+#include "ndnboost/numeric/conversion/detail/conversion_traits.hpp"
+#include "ndnboost/detail/workaround.hpp"
+#include "ndnboost/config.hpp"
+
+namespace ndnboost { namespace numeric
+{
+
+template<class T, class S>
+struct conversion_traits
+ : convdetail::get_conversion_traits<T,S>::type
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+ typedef typename convdetail::get_conversion_traits<T,S>::type base_;
+ typedef typename base_::target_type target_type;
+ typedef typename base_::source_type source_type;
+ typedef typename base_::result_type result_type;
+ typedef typename base_::argument_type argument_type;
+#endif
+} ;
+
+} } // namespace ndnboost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/ndnboost/numeric/conversion/converter.hpp b/ndnboost/numeric/conversion/converter.hpp
new file mode 100644
index 0000000..ee406a5
--- /dev/null
+++ b/ndnboost/numeric/conversion/converter.hpp
@@ -0,0 +1,68 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP
+
+#include "ndnboost/numeric/conversion/conversion_traits.hpp"
+#include "ndnboost/numeric/conversion/converter_policies.hpp"
+
+#include "ndnboost/numeric/conversion/detail/converter.hpp"
+
+namespace ndnboost { namespace numeric
+{
+
+template<class T,
+ class S,
+ class Traits = conversion_traits<T,S>,
+ class OverflowHandler = def_overflow_handler,
+ class Float2IntRounder = Trunc< BOOST_DEDUCED_TYPENAME Traits::source_type> ,
+ class RawConverter = raw_converter<Traits>,
+ class UserRangeChecker = UseInternalRangeChecker
+ >
+struct converter : convdetail::get_converter_impl<Traits,
+ OverflowHandler,
+ Float2IntRounder,
+ RawConverter,
+ UserRangeChecker
+ >::type
+{
+ typedef Traits traits ;
+
+ typedef typename Traits::argument_type argument_type ;
+ typedef typename Traits::result_type result_type ;
+
+ result_type operator() ( argument_type s ) const { return this->convert(s) ; }
+} ;
+
+
+
+template<class S,
+ class OverflowHandler = def_overflow_handler,
+ class Float2IntRounder = Trunc<S> ,
+ class UserRangeChecker = UseInternalRangeChecker
+ >
+struct make_converter_from
+{
+ template<class T,
+ class Traits = conversion_traits<T,S>,
+ class RawConverter = raw_converter<Traits>
+ >
+ struct to
+ {
+ typedef converter<T,S,Traits,OverflowHandler,Float2IntRounder,RawConverter,UserRangeChecker> type ;
+ } ;
+
+} ;
+
+} } // namespace ndnboost::numeric
+
+#endif
+
+
diff --git a/ndnboost/numeric/conversion/converter_policies.hpp b/ndnboost/numeric/conversion/converter_policies.hpp
new file mode 100644
index 0000000..fd02094
--- /dev/null
+++ b/ndnboost/numeric/conversion/converter_policies.hpp
@@ -0,0 +1,194 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP
+
+#include <typeinfo> // for std::bad_cast
+
+#include <ndnboost/config/no_tr1/cmath.hpp> // for std::floor and std::ceil
+#include <ndnboost/throw_exception.hpp>
+
+#include <functional>
+
+#include "ndnboost/type_traits/is_arithmetic.hpp"
+
+#include "ndnboost/mpl/if.hpp"
+#include "ndnboost/mpl/integral_c.hpp"
+
+namespace ndnboost { namespace numeric
+{
+
+template<class S>
+struct Trunc
+{
+ typedef S source_type ;
+
+ typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+ static source_type nearbyint ( argument_type s )
+ {
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+ using std::floor ;
+ using std::ceil ;
+#endif
+
+ return s < static_cast<S>(0) ? ceil(s) : floor(s) ;
+ }
+
+ typedef mpl::integral_c< std::float_round_style, std::round_toward_zero> round_style ;
+} ;
+
+
+
+template<class S>
+struct Floor
+{
+ typedef S source_type ;
+
+ typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+ static source_type nearbyint ( argument_type s )
+ {
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+ using std::floor ;
+#endif
+
+ return floor(s) ;
+ }
+
+ typedef mpl::integral_c< std::float_round_style, std::round_toward_neg_infinity> round_style ;
+} ;
+
+template<class S>
+struct Ceil
+{
+ typedef S source_type ;
+
+ typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+ static source_type nearbyint ( argument_type s )
+ {
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+ using std::ceil ;
+#endif
+
+ return ceil(s) ;
+ }
+
+ typedef mpl::integral_c< std::float_round_style, std::round_toward_infinity> round_style ;
+} ;
+
+template<class S>
+struct RoundEven
+{
+ typedef S source_type ;
+
+ typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+ static source_type nearbyint ( argument_type s )
+ {
+ // Algorithm contributed by Guillaume Melquiond
+
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+ using std::floor ;
+ using std::ceil ;
+#endif
+
+ // only works inside the range not at the boundaries
+ S prev = floor(s);
+ S next = ceil(s);
+
+ S rt = (s - prev) - (next - s); // remainder type
+
+ S const zero(0.0);
+ S const two(2.0);
+
+ if ( rt < zero )
+ return prev;
+ else if ( rt > zero )
+ return next;
+ else
+ {
+ bool is_prev_even = two * floor(prev / two) == prev ;
+ return ( is_prev_even ? prev : next ) ;
+ }
+ }
+
+ typedef mpl::integral_c< std::float_round_style, std::round_to_nearest> round_style ;
+} ;
+
+
+enum range_check_result
+{
+ cInRange = 0 ,
+ cNegOverflow = 1 ,
+ cPosOverflow = 2
+} ;
+
+class bad_numeric_cast : public std::bad_cast
+{
+ public:
+
+ virtual const char * what() const throw()
+ { return "bad numeric conversion: overflow"; }
+};
+
+class negative_overflow : public bad_numeric_cast
+{
+ public:
+
+ virtual const char * what() const throw()
+ { return "bad numeric conversion: negative overflow"; }
+};
+class positive_overflow : public bad_numeric_cast
+{
+ public:
+
+ virtual const char * what() const throw()
+ { return "bad numeric conversion: positive overflow"; }
+};
+
+struct def_overflow_handler
+{
+ void operator() ( range_check_result r ) // throw(negative_overflow,positive_overflow)
+ {
+#ifndef BOOST_NO_EXCEPTIONS
+ if ( r == cNegOverflow )
+ throw negative_overflow() ;
+ else if ( r == cPosOverflow )
+ throw positive_overflow() ;
+#else
+ if ( r == cNegOverflow )
+ ::ndnboost::throw_exception(negative_overflow()) ;
+ else if ( r == cPosOverflow )
+ ::ndnboost::throw_exception(positive_overflow()) ;
+#endif
+ }
+} ;
+
+struct silent_overflow_handler
+{
+ void operator() ( range_check_result ) {} // throw()
+} ;
+
+template<class Traits>
+struct raw_converter
+{
+ typedef typename Traits::result_type result_type ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static result_type low_level_convert ( argument_type s ) { return static_cast<result_type>(s) ; }
+} ;
+
+struct UseInternalRangeChecker {} ;
+
+} } // namespace ndnboost::numeric
+
+#endif
diff --git a/ndnboost/numeric/conversion/detail/bounds.hpp b/ndnboost/numeric/conversion/detail/bounds.hpp
new file mode 100644
index 0000000..34effae
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/bounds.hpp
@@ -0,0 +1,58 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
+
+#include "ndnboost/limits.hpp"
+#include "ndnboost/config.hpp"
+#include "ndnboost/mpl/if.hpp"
+
+namespace ndnboost { namespace numeric { namespace boundsdetail
+{
+ template<class N>
+ class Integral
+ {
+ typedef std::numeric_limits<N> limits ;
+
+ public :
+
+ static N lowest () { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+ static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+ static N smallest() { return static_cast<N>(1); }
+ } ;
+
+ template<class N>
+ class Float
+ {
+ typedef std::numeric_limits<N> limits ;
+
+ public :
+
+ static N lowest () { return static_cast<N>(-limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) ; }
+ static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+ static N smallest() { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+ } ;
+
+ template<class N>
+ struct get_impl
+ {
+ typedef mpl::bool_< ::std::numeric_limits<N>::is_integer > is_int ;
+
+ typedef Integral<N> impl_int ;
+ typedef Float <N> impl_float ;
+
+ typedef typename mpl::if_<is_int,impl_int,impl_float>::type type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::boundsdetail.
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/ndnboost/numeric/conversion/detail/conversion_traits.hpp b/ndnboost/numeric/conversion/detail/conversion_traits.hpp
new file mode 100644
index 0000000..55c7d86
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/conversion_traits.hpp
@@ -0,0 +1,97 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+
+#include "ndnboost/type_traits/is_arithmetic.hpp"
+#include "ndnboost/type_traits/is_same.hpp"
+#include "ndnboost/type_traits/remove_cv.hpp"
+
+#include "ndnboost/numeric/conversion/detail/meta.hpp"
+#include "ndnboost/numeric/conversion/detail/int_float_mixture.hpp"
+#include "ndnboost/numeric/conversion/detail/sign_mixture.hpp"
+#include "ndnboost/numeric/conversion/detail/udt_builtin_mixture.hpp"
+#include "ndnboost/numeric/conversion/detail/is_subranged.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ //-------------------------------------------------------------------
+ // Implementation of the Conversion Traits for T != S
+ //
+ // This is a VISIBLE base class of the user-level conversion_traits<> class.
+ //-------------------------------------------------------------------
+ template<class T,class S>
+ struct non_trivial_traits_impl
+ {
+ typedef typename get_int_float_mixture <T,S>::type int_float_mixture ;
+ typedef typename get_sign_mixture <T,S>::type sign_mixture ;
+ typedef typename get_udt_builtin_mixture <T,S>::type udt_builtin_mixture ;
+
+ typedef typename get_is_subranged<T,S>::type subranged ;
+
+ typedef mpl::false_ trivial ;
+
+ typedef T target_type ;
+ typedef S source_type ;
+ typedef T result_type ;
+
+ typedef typename mpl::if_< is_arithmetic<S>, S, S const&>::type argument_type ;
+
+ typedef typename mpl::if_<subranged,S,T>::type supertype ;
+ typedef typename mpl::if_<subranged,T,S>::type subtype ;
+ } ;
+
+ //-------------------------------------------------------------------
+ // Implementation of the Conversion Traits for T == S
+ //
+ // This is a VISIBLE base class of the user-level conversion_traits<> class.
+ //-------------------------------------------------------------------
+ template<class N>
+ struct trivial_traits_impl
+ {
+ typedef typename get_int_float_mixture <N,N>::type int_float_mixture ;
+ typedef typename get_sign_mixture <N,N>::type sign_mixture ;
+ typedef typename get_udt_builtin_mixture<N,N>::type udt_builtin_mixture ;
+
+ typedef mpl::false_ subranged ;
+ typedef mpl::true_ trivial ;
+
+ typedef N target_type ;
+ typedef N source_type ;
+ typedef N const& result_type ;
+ typedef N const& argument_type ;
+
+ typedef N supertype ;
+ typedef N subtype ;
+
+ } ;
+
+ //-------------------------------------------------------------------
+ // Top level implementation selector.
+ //-------------------------------------------------------------------
+ template<class T, class S>
+ struct get_conversion_traits
+ {
+ typedef typename remove_cv<T>::type target_type ;
+ typedef typename remove_cv<S>::type source_type ;
+
+ typedef typename is_same<target_type,source_type>::type is_trivial ;
+
+ typedef trivial_traits_impl <target_type> trivial_imp ;
+ typedef non_trivial_traits_impl<target_type,source_type> non_trivial_imp ;
+
+ typedef typename mpl::if_<is_trivial,trivial_imp,non_trivial_imp>::type type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+
+
diff --git a/ndnboost/numeric/conversion/detail/converter.hpp b/ndnboost/numeric/conversion/detail/converter.hpp
new file mode 100644
index 0000000..813a5c3
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/converter.hpp
@@ -0,0 +1,602 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP
+
+#include <functional>
+
+#include "ndnboost/numeric/conversion/detail/meta.hpp"
+#include "ndnboost/numeric/conversion/detail/conversion_traits.hpp"
+#include "ndnboost/numeric/conversion/bounds.hpp"
+
+#include "ndnboost/type_traits/is_same.hpp"
+
+#include "ndnboost/mpl/integral_c.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ // Integral Constants representing rounding modes
+ typedef mpl::integral_c<std::float_round_style, std::round_toward_zero> round2zero_c ;
+ typedef mpl::integral_c<std::float_round_style, std::round_to_nearest> round2nearest_c ;
+ typedef mpl::integral_c<std::float_round_style, std::round_toward_infinity> round2inf_c ;
+ typedef mpl::integral_c<std::float_round_style, std::round_toward_neg_infinity> round2neg_inf_c ;
+
+ // Metafunction:
+ //
+ // for_round_style<RoundStyle,RoundToZero,RoundToNearest,RoundToInf,RoundToNegInf>::type
+ //
+ // {RoundStyle} Integral Constant specifying a round style as declared above.
+ // {RoundToZero,RoundToNearest,RoundToInf,RoundToNegInf} arbitrary types.
+ //
+ // Selects one of the 4 types according to the value of RoundStyle.
+ //
+ template<class RoundStyle,class RoundToZero,class RoundToNearest,class RoundToInf,class RoundToNegInf>
+ struct for_round_style
+ {
+ typedef ct_switch4<RoundStyle
+ , round2zero_c, round2nearest_c, round2inf_c // round2neg_inf_c
+ , RoundToZero , RoundToNearest , RoundToInf , RoundToNegInf
+ > selector ;
+
+ typedef typename selector::type type ;
+ } ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//--------------------------------------------------------------------------
+// Range Checking Logic.
+//
+// The range checking logic is built up by combining 1 or 2 predicates.
+// Each predicate is encapsulated in a template class and exposes
+// the static member function 'apply'.
+//
+//--------------------------------------------------------------------------
+
+
+ // Because a particular logic can combine either 1 or two predicates, the following
+ // tags are used to allow the predicate applier to receive 2 preds, but optimize away
+ // one of them if it is 'non-applicable'
+ struct non_applicable { typedef mpl::false_ do_apply ; } ;
+ struct applicable { typedef mpl::true_ do_apply ; } ;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Range Checking Logic implementations.
+ //
+ // The following classes, collectivelly named 'Predicates', are instantiated within
+ // the corresponding range checkers.
+ // Their static member function 'apply' is called to perform the actual range checking logic.
+ //--------------------------------------------------------------------------
+
+ // s < Lowest(T) ? cNegOverflow : cInRange
+ //
+ template<class Traits>
+ struct LT_LoT : applicable
+ {
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s < static_cast<S>(bounds<T>::lowest()) ? cNegOverflow : cInRange ;
+ }
+ } ;
+
+ // s < 0 ? cNegOverflow : cInRange
+ //
+ template<class Traits>
+ struct LT_Zero : applicable
+ {
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s < static_cast<S>(0) ? cNegOverflow : cInRange ;
+ }
+ } ;
+
+ // s <= Lowest(T)-1 ? cNegOverflow : cInRange
+ //
+ template<class Traits>
+ struct LE_PrevLoT : applicable
+ {
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s <= static_cast<S>(bounds<T>::lowest()) - static_cast<S>(1.0)
+ ? cNegOverflow : cInRange ;
+ }
+ } ;
+
+ // s < Lowest(T)-0.5 ? cNegOverflow : cInRange
+ //
+ template<class Traits>
+ struct LT_HalfPrevLoT : applicable
+ {
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s < static_cast<S>(bounds<T>::lowest()) - static_cast<S>(0.5)
+ ? cNegOverflow : cInRange ;
+ }
+ } ;
+
+ // s > Highest(T) ? cPosOverflow : cInRange
+ //
+ template<class Traits>
+ struct GT_HiT : applicable
+ {
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s > static_cast<S>(bounds<T>::highest())
+ ? cPosOverflow : cInRange ;
+ }
+ } ;
+
+ // s >= Lowest(T) + 1 ? cPosOverflow : cInRange
+ //
+ template<class Traits>
+ struct GE_SuccHiT : applicable
+ {
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s >= static_cast<S>(bounds<T>::highest()) + static_cast<S>(1.0)
+ ? cPosOverflow : cInRange ;
+ }
+ } ;
+
+ // s >= Lowest(T) + 0.5 ? cPosgOverflow : cInRange
+ //
+ template<class Traits>
+ struct GT_HalfSuccHiT : applicable
+ {
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ return s >= static_cast<S>(bounds<T>::highest()) + static_cast<S>(0.5)
+ ? cPosOverflow : cInRange ;
+ }
+ } ;
+
+
+ //--------------------------------------------------------------------------
+ //
+ // Predicate Combiner.
+ //
+ // This helper classes are used to possibly combine the range checking logic
+ // individually performed by the predicates
+ //
+ //--------------------------------------------------------------------------
+
+
+ // Applies both predicates: first 'PredA', and if it equals 'cInRange', 'PredB'
+ template<class PredA, class PredB>
+ struct applyBoth
+ {
+ typedef typename PredA::argument_type argument_type ;
+
+ static range_check_result apply ( argument_type s )
+ {
+ range_check_result r = PredA::apply(s) ;
+ if ( r == cInRange )
+ r = PredB::apply(s);
+ return r ;
+ }
+ } ;
+
+ template<class PredA, class PredB>
+ struct combine
+ {
+ typedef applyBoth<PredA,PredB> Both ;
+ typedef void NNone ; // 'None' is defined as a macro in (/usr/X11R6/include/X11/X.h)
+
+ typedef typename PredA::do_apply do_applyA ;
+ typedef typename PredB::do_apply do_applyB ;
+
+ typedef typename for_both<do_applyA, do_applyB, Both, PredA, PredB, NNone>::type type ;
+ } ;
+
+
+
+
+
+
+
+
+
+
+
+
+//--------------------------------------------------------------------------
+// Range Checker classes.
+//
+// The following classes are VISIBLE base classes of the user-level converter<> class.
+// They supply the optimized 'out_of_range()' and 'validate_range()' static member functions
+// visible in the user interface.
+//
+//--------------------------------------------------------------------------
+
+ // Dummy range checker.
+ template<class Traits>
+ struct dummy_range_checker
+ {
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result out_of_range ( argument_type ) { return cInRange ; }
+ static void validate_range ( argument_type ) {}
+ } ;
+
+ // Generic range checker.
+ //
+ // All the range checking logic for all possible combinations of source and target
+ // can be arranged in terms of one or two predicates, which test overflow on both neg/pos 'sides'
+ // of the ranges.
+ //
+ // These predicates are given here as IsNegOverflow and IsPosOverflow.
+ //
+ template<class Traits, class IsNegOverflow, class IsPosOverflow, class OverflowHandler>
+ struct generic_range_checker
+ {
+ typedef OverflowHandler overflow_handler ;
+
+ typedef typename Traits::argument_type argument_type ;
+
+ static range_check_result out_of_range ( argument_type s )
+ {
+ typedef typename combine<IsNegOverflow,IsPosOverflow>::type Predicate ;
+
+ return Predicate::apply(s);
+ }
+
+ static void validate_range ( argument_type s )
+ { OverflowHandler()( out_of_range(s) ) ; }
+ } ;
+
+
+
+//--------------------------------------------------------------------------
+//
+// Selectors for the optimized Range Checker class.
+//
+//--------------------------------------------------------------------------
+
+ template<class Traits,class OverflowHandler>
+ struct GetRC_Sig2Sig_or_Unsig2Unsig
+ {
+ typedef dummy_range_checker<Traits> Dummy ;
+
+ typedef LT_LoT<Traits> Pred1 ;
+ typedef GT_HiT<Traits> Pred2 ;
+
+ typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> Normal ;
+
+ typedef typename Traits::subranged subranged ;
+
+ typedef typename mpl::if_<subranged,Normal,Dummy>::type type ;
+ } ;
+
+ template<class Traits, class OverflowHandler>
+ struct GetRC_Sig2Unsig
+ {
+ typedef LT_Zero<Traits> Pred1 ;
+ typedef GT_HiT <Traits> Pred2 ;
+
+ typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> ChoiceA ;
+
+ typedef generic_range_checker<Traits,Pred1,non_applicable,OverflowHandler> ChoiceB ;
+
+ typedef typename Traits::target_type T ;
+ typedef typename Traits::source_type S ;
+
+ typedef typename subranged_Unsig2Sig<S,T>::type oposite_subranged ;
+
+ typedef typename mpl::not_<oposite_subranged>::type positively_subranged ;
+
+ typedef typename mpl::if_<positively_subranged,ChoiceA,ChoiceB>::type type ;
+ } ;
+
+ template<class Traits, class OverflowHandler>
+ struct GetRC_Unsig2Sig
+ {
+ typedef GT_HiT<Traits> Pred1 ;
+
+ typedef generic_range_checker<Traits,non_applicable,Pred1,OverflowHandler> type ;
+ } ;
+
+ template<class Traits,class OverflowHandler>
+ struct GetRC_Int2Int
+ {
+ typedef GetRC_Sig2Sig_or_Unsig2Unsig<Traits,OverflowHandler> Sig2SigQ ;
+ typedef GetRC_Sig2Unsig <Traits,OverflowHandler> Sig2UnsigQ ;
+ typedef GetRC_Unsig2Sig <Traits,OverflowHandler> Unsig2SigQ ;
+ typedef Sig2SigQ Unsig2UnsigQ ;
+
+ typedef typename Traits::sign_mixture sign_mixture ;
+
+ typedef typename
+ for_sign_mixture<sign_mixture,Sig2SigQ,Sig2UnsigQ,Unsig2SigQ,Unsig2UnsigQ>::type
+ selector ;
+
+ typedef typename selector::type type ;
+ } ;
+
+ template<class Traits>
+ struct GetRC_Int2Float
+ {
+ typedef dummy_range_checker<Traits> type ;
+ } ;
+
+ template<class Traits, class OverflowHandler, class Float2IntRounder>
+ struct GetRC_Float2Int
+ {
+ typedef LE_PrevLoT <Traits> Pred1 ;
+ typedef GE_SuccHiT <Traits> Pred2 ;
+ typedef LT_HalfPrevLoT<Traits> Pred3 ;
+ typedef GT_HalfSuccHiT<Traits> Pred4 ;
+ typedef GT_HiT <Traits> Pred5 ;
+ typedef LT_LoT <Traits> Pred6 ;
+
+ typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> ToZero ;
+ typedef generic_range_checker<Traits,Pred3,Pred4,OverflowHandler> ToNearest ;
+ typedef generic_range_checker<Traits,Pred1,Pred5,OverflowHandler> ToInf ;
+ typedef generic_range_checker<Traits,Pred6,Pred2,OverflowHandler> ToNegInf ;
+
+ typedef typename Float2IntRounder::round_style round_style ;
+
+ typedef typename for_round_style<round_style,ToZero,ToNearest,ToInf,ToNegInf>::type type ;
+ } ;
+
+ template<class Traits, class OverflowHandler>
+ struct GetRC_Float2Float
+ {
+ typedef dummy_range_checker<Traits> Dummy ;
+
+ typedef LT_LoT<Traits> Pred1 ;
+ typedef GT_HiT<Traits> Pred2 ;
+
+ typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> Normal ;
+
+ typedef typename Traits::subranged subranged ;
+
+ typedef typename mpl::if_<subranged,Normal,Dummy>::type type ;
+ } ;
+
+ template<class Traits, class OverflowHandler, class Float2IntRounder>
+ struct GetRC_BuiltIn2BuiltIn
+ {
+ typedef GetRC_Int2Int<Traits,OverflowHandler> Int2IntQ ;
+ typedef GetRC_Int2Float<Traits> Int2FloatQ ;
+ typedef GetRC_Float2Int<Traits,OverflowHandler,Float2IntRounder> Float2IntQ ;
+ typedef GetRC_Float2Float<Traits,OverflowHandler> Float2FloatQ ;
+
+ typedef typename Traits::int_float_mixture int_float_mixture ;
+
+ typedef typename for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ>::type selector ;
+
+ typedef typename selector::type type ;
+ } ;
+
+ template<class Traits, class OverflowHandler, class Float2IntRounder>
+ struct GetRC
+ {
+ typedef GetRC_BuiltIn2BuiltIn<Traits,OverflowHandler,Float2IntRounder> BuiltIn2BuiltInQ ;
+
+ typedef dummy_range_checker<Traits> Dummy ;
+
+ typedef mpl::identity<Dummy> DummyQ ;
+
+ typedef typename Traits::udt_builtin_mixture udt_builtin_mixture ;
+
+ typedef typename for_udt_builtin_mixture<udt_builtin_mixture,BuiltIn2BuiltInQ,DummyQ,DummyQ,DummyQ>::type selector ;
+
+ typedef typename selector::type type ;
+ } ;
+
+
+
+
+//--------------------------------------------------------------------------
+// Converter classes.
+//
+// The following classes are VISIBLE base classes of the user-level converter<> class.
+// They supply the optimized 'nearbyint()' and 'convert()' static member functions
+// visible in the user interface.
+//
+//--------------------------------------------------------------------------
+
+ //
+ // Trivial Converter : used when (cv-unqualified) T == (cv-unqualified) S
+ //
+ template<class Traits>
+ struct trivial_converter_impl : public std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
+ ,BOOST_DEDUCED_TYPENAME Traits::result_type
+ >
+ ,public dummy_range_checker<Traits>
+ {
+ typedef Traits traits ;
+
+ typedef typename Traits::source_type source_type ;
+ typedef typename Traits::argument_type argument_type ;
+ typedef typename Traits::result_type result_type ;
+
+ static result_type low_level_convert ( argument_type s ) { return s ; }
+ static source_type nearbyint ( argument_type s ) { return s ; }
+ static result_type convert ( argument_type s ) { return s ; }
+ } ;
+
+
+ //
+ // Rounding Converter : used for float to integral conversions.
+ //
+ template<class Traits,class RangeChecker,class RawConverter,class Float2IntRounder>
+ struct rounding_converter : public std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
+ ,BOOST_DEDUCED_TYPENAME Traits::result_type
+ >
+ ,public RangeChecker
+ ,public Float2IntRounder
+ ,public RawConverter
+ {
+ typedef RangeChecker RangeCheckerBase ;
+ typedef Float2IntRounder Float2IntRounderBase ;
+ typedef RawConverter RawConverterBase ;
+
+ typedef Traits traits ;
+
+ typedef typename Traits::source_type source_type ;
+ typedef typename Traits::argument_type argument_type ;
+ typedef typename Traits::result_type result_type ;
+
+ static result_type convert ( argument_type s )
+ {
+ RangeCheckerBase::validate_range(s);
+ source_type s1 = Float2IntRounderBase::nearbyint(s);
+ return RawConverterBase::low_level_convert(s1);
+ }
+ } ;
+
+
+ //
+ // Non-Rounding Converter : used for all other conversions.
+ //
+ template<class Traits,class RangeChecker,class RawConverter>
+ struct non_rounding_converter : public std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
+ ,BOOST_DEDUCED_TYPENAME Traits::result_type
+ >
+ ,public RangeChecker
+ ,public RawConverter
+ {
+ typedef RangeChecker RangeCheckerBase ;
+ typedef RawConverter RawConverterBase ;
+
+ typedef Traits traits ;
+
+ typedef typename Traits::source_type source_type ;
+ typedef typename Traits::argument_type argument_type ;
+ typedef typename Traits::result_type result_type ;
+
+ static source_type nearbyint ( argument_type s ) { return s ; }
+
+ static result_type convert ( argument_type s )
+ {
+ RangeCheckerBase::validate_range(s);
+ return RawConverterBase::low_level_convert(s);
+ }
+ } ;
+
+
+
+
+//--------------------------------------------------------------------------
+//
+// Selectors for the optimized Converter class.
+//
+//--------------------------------------------------------------------------
+
+ template<class Traits,class OverflowHandler,class Float2IntRounder,class RawConverter, class UserRangeChecker>
+ struct get_non_trivial_converter
+ {
+ typedef GetRC<Traits,OverflowHandler,Float2IntRounder> InternalRangeCheckerQ ;
+
+ typedef is_same<UserRangeChecker,UseInternalRangeChecker> use_internal_RC ;
+
+ typedef mpl::identity<UserRangeChecker> UserRangeCheckerQ ;
+
+ typedef typename
+ mpl::eval_if<use_internal_RC,InternalRangeCheckerQ,UserRangeCheckerQ>::type
+ RangeChecker ;
+
+ typedef non_rounding_converter<Traits,RangeChecker,RawConverter> NonRounding ;
+ typedef rounding_converter<Traits,RangeChecker,RawConverter,Float2IntRounder> Rounding ;
+
+ typedef mpl::identity<NonRounding> NonRoundingQ ;
+ typedef mpl::identity<Rounding> RoundingQ ;
+
+ typedef typename Traits::int_float_mixture int_float_mixture ;
+
+ typedef typename
+ for_int_float_mixture<int_float_mixture, NonRoundingQ, NonRoundingQ, RoundingQ, NonRoundingQ>::type
+ selector ;
+
+ typedef typename selector::type type ;
+ } ;
+
+ template< class Traits
+ ,class OverflowHandler
+ ,class Float2IntRounder
+ ,class RawConverter
+ ,class UserRangeChecker
+ >
+ struct get_converter_impl
+ {
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x0561 ) )
+ // bcc55 prefers sometimes template parameters to be explicit local types.
+ // (notice that is is illegal to reuse the names like this)
+ typedef Traits Traits ;
+ typedef OverflowHandler OverflowHandler ;
+ typedef Float2IntRounder Float2IntRounder ;
+ typedef RawConverter RawConverter ;
+ typedef UserRangeChecker UserRangeChecker ;
+#endif
+
+ typedef trivial_converter_impl<Traits> Trivial ;
+ typedef mpl::identity <Trivial> TrivialQ ;
+
+ typedef get_non_trivial_converter< Traits
+ ,OverflowHandler
+ ,Float2IntRounder
+ ,RawConverter
+ ,UserRangeChecker
+ > NonTrivialQ ;
+
+ typedef typename Traits::trivial trivial ;
+
+ typedef typename mpl::eval_if<trivial,TrivialQ,NonTrivialQ>::type type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+
+
diff --git a/ndnboost/numeric/conversion/detail/int_float_mixture.hpp b/ndnboost/numeric/conversion/detail/int_float_mixture.hpp
new file mode 100644
index 0000000..437b56a
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/int_float_mixture.hpp
@@ -0,0 +1,72 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
+
+#include "ndnboost/config.hpp"
+#include "ndnboost/limits.hpp"
+
+#include "ndnboost/numeric/conversion/int_float_mixture_enum.hpp"
+#include "ndnboost/numeric/conversion/detail/meta.hpp"
+
+#include "ndnboost/mpl/integral_c.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ // Integral Constants for 'IntFloatMixture'
+ typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
+ typedef mpl::integral_c<int_float_mixture_enum, integral_to_float> int2float_c ;
+ typedef mpl::integral_c<int_float_mixture_enum, float_to_integral> float2int_c ;
+ typedef mpl::integral_c<int_float_mixture_enum, float_to_float> float2float_c ;
+
+ // Metafunction:
+ //
+ // get_int_float_mixture<T,S>::type
+ //
+ // Selects the appropriate Int-Float Mixture Integral Constant for the combination T,S.
+ //
+ template<class T,class S>
+ struct get_int_float_mixture
+ {
+ typedef mpl::bool_< ::std::numeric_limits<S>::is_integer > S_int ;
+ typedef mpl::bool_< ::std::numeric_limits<T>::is_integer > T_int ;
+
+ typedef typename
+ for_both<S_int, T_int, int2int_c, int2float_c, float2int_c, float2float_c>::type
+ type ;
+ } ;
+
+ // Metafunction:
+ //
+ // for_int_float_mixture<Mixture,int_int,int_float,float_int,float_float>::type
+ //
+ // {Mixture} is one of the Integral Constants for Mixture, declared above.
+ // {int_int,int_float,float_int,float_float} are aribtrary types. (not metafunctions)
+ //
+ // According to the value of 'IntFloatMixture', selects the corresponding type.
+ //
+ template<class IntFloatMixture, class Int2Int, class Int2Float, class Float2Int, class Float2Float>
+ struct for_int_float_mixture
+ {
+ typedef typename
+ ct_switch4<IntFloatMixture
+ ,int2int_c, int2float_c, float2int_c // default
+ ,Int2Int , Int2Float , Float2Int , Float2Float
+ >::type
+ type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/ndnboost/numeric/conversion/detail/is_subranged.hpp b/ndnboost/numeric/conversion/detail/is_subranged.hpp
new file mode 100644
index 0000000..6f84872
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/is_subranged.hpp
@@ -0,0 +1,234 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP
+
+#include "ndnboost/config.hpp"
+#include "ndnboost/limits.hpp"
+
+#include "ndnboost/mpl/int.hpp"
+#include "ndnboost/mpl/multiplies.hpp"
+#include "ndnboost/mpl/less.hpp"
+#include "ndnboost/mpl/equal_to.hpp"
+
+#include "ndnboost/type_traits/is_same.hpp"
+
+#include "ndnboost/numeric/conversion/detail/meta.hpp"
+#include "ndnboost/numeric/conversion/detail/int_float_mixture.hpp"
+#include "ndnboost/numeric/conversion/detail/sign_mixture.hpp"
+#include "ndnboost/numeric/conversion/detail/udt_builtin_mixture.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ //---------------------------------------------------------------
+ // Implementations of the compile time predicate "T is subranged"
+ //---------------------------------------------------------------
+
+ // for integral to integral conversions
+ template<class T,class S>
+ struct subranged_Sig2Unsig
+ {
+ // Signed to unsigned conversions are 'subranged' because of possible loose
+ // of negative values.
+ typedef mpl::true_ type ;
+ } ;
+
+ // for unsigned integral to signed integral conversions
+ template<class T,class S>
+ struct subranged_Unsig2Sig
+ {
+ // IMPORTANT NOTE:
+ //
+ // This code assumes that signed/unsigned integral values are represented
+ // such that:
+ //
+ // numeric_limits<signed T>::digits + 1 == numeric_limits<unsigned T>::digits
+ //
+ // The '+1' is required since numeric_limits<>::digits gives 1 bit less for signed integral types.
+ //
+ // This fact is used by the following logic:
+ //
+ // if ( (numeric_limits<T>::digits+1) < (2*numeric_limits<S>::digits) )
+ // then the conversion is subranged.
+ //
+
+ typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
+ typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
+
+ // T is signed, so take digits+1
+ typedef typename T_digits::next u_T_digits ;
+
+ typedef mpl::int_<2> Two ;
+
+ typedef typename mpl::multiplies<S_digits,Two>::type S_digits_times_2 ;
+
+ typedef typename mpl::less<u_T_digits,S_digits_times_2>::type type ;
+ } ;
+
+ // for integral to integral conversions of the same sign.
+ template<class T,class S>
+ struct subranged_SameSign
+ {
+ // An integral conversion of the same sign is subranged if digits(T) < digits(S).
+
+ typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
+ typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
+
+ typedef typename mpl::less<T_digits,S_digits>::type type ;
+ } ;
+
+ // for integral to float conversions
+ template<class T,class S>
+ struct subranged_Int2Float
+ {
+ typedef mpl::false_ type ;
+ } ;
+
+ // for float to integral conversions
+ template<class T,class S>
+ struct subranged_Float2Int
+ {
+ typedef mpl::true_ type ;
+ } ;
+
+ // for float to float conversions
+ template<class T,class S>
+ struct subranged_Float2Float
+ {
+ // If both T and S are floats,
+ // compare exponent bits and if they match, mantisa bits.
+
+ typedef mpl::int_< ::std::numeric_limits<S>::digits > S_mantisa ;
+ typedef mpl::int_< ::std::numeric_limits<T>::digits > T_mantisa ;
+
+ typedef mpl::int_< ::std::numeric_limits<S>::max_exponent > S_exponent ;
+ typedef mpl::int_< ::std::numeric_limits<T>::max_exponent > T_exponent ;
+
+ typedef typename mpl::less<T_exponent,S_exponent>::type T_smaller_exponent ;
+
+ typedef typename mpl::equal_to<T_exponent,S_exponent>::type equal_exponents ;
+
+ typedef mpl::less<T_mantisa,S_mantisa> T_smaller_mantisa ;
+
+ typedef mpl::eval_if<equal_exponents,T_smaller_mantisa,mpl::false_> not_bigger_exponent_case ;
+
+ typedef typename
+ mpl::eval_if<T_smaller_exponent,mpl::true_,not_bigger_exponent_case>::type
+ type ;
+ } ;
+
+ // for Udt to built-in conversions
+ template<class T,class S>
+ struct subranged_Udt2BuiltIn
+ {
+ typedef mpl::true_ type ;
+ } ;
+
+ // for built-in to Udt conversions
+ template<class T,class S>
+ struct subranged_BuiltIn2Udt
+ {
+ typedef mpl::false_ type ;
+ } ;
+
+ // for Udt to Udt conversions
+ template<class T,class S>
+ struct subranged_Udt2Udt
+ {
+ typedef mpl::false_ type ;
+ } ;
+
+ //-------------------------------------------------------------------
+ // Selectors for the implementations of the subranged predicate
+ //-------------------------------------------------------------------
+
+ template<class T,class S>
+ struct get_subranged_Int2Int
+ {
+ typedef subranged_SameSign<T,S> Sig2Sig ;
+ typedef subranged_Sig2Unsig<T,S> Sig2Unsig ;
+ typedef subranged_Unsig2Sig<T,S> Unsig2Sig ;
+ typedef Sig2Sig Unsig2Unsig ;
+
+ typedef typename get_sign_mixture<T,S>::type sign_mixture ;
+
+ typedef typename
+ for_sign_mixture<sign_mixture, Sig2Sig, Sig2Unsig, Unsig2Sig, Unsig2Unsig>::type
+ type ;
+ } ;
+
+ template<class T,class S>
+ struct get_subranged_BuiltIn2BuiltIn
+ {
+ typedef get_subranged_Int2Int<T,S> Int2IntQ ;
+
+ typedef subranged_Int2Float <T,S> Int2Float ;
+ typedef subranged_Float2Int <T,S> Float2Int ;
+ typedef subranged_Float2Float<T,S> Float2Float ;
+
+ typedef mpl::identity<Int2Float > Int2FloatQ ;
+ typedef mpl::identity<Float2Int > Float2IntQ ;
+ typedef mpl::identity<Float2Float> Float2FloatQ ;
+
+ typedef typename get_int_float_mixture<T,S>::type int_float_mixture ;
+
+ typedef for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ> for_ ;
+
+ typedef typename for_::type selected ;
+
+ typedef typename selected::type type ;
+ } ;
+
+ template<class T,class S>
+ struct get_subranged
+ {
+ typedef get_subranged_BuiltIn2BuiltIn<T,S> BuiltIn2BuiltInQ ;
+
+ typedef subranged_BuiltIn2Udt<T,S> BuiltIn2Udt ;
+ typedef subranged_Udt2BuiltIn<T,S> Udt2BuiltIn ;
+ typedef subranged_Udt2Udt<T,S> Udt2Udt ;
+
+ typedef mpl::identity<BuiltIn2Udt> BuiltIn2UdtQ ;
+ typedef mpl::identity<Udt2BuiltIn> Udt2BuiltInQ ;
+ typedef mpl::identity<Udt2Udt > Udt2UdtQ ;
+
+ typedef typename get_udt_builtin_mixture<T,S>::type udt_builtin_mixture ;
+
+ typedef typename
+ for_udt_builtin_mixture<udt_builtin_mixture, BuiltIn2BuiltInQ, BuiltIn2UdtQ, Udt2BuiltInQ, Udt2UdtQ>::type
+ selected ;
+
+ typedef typename selected::type selected2 ;
+
+ typedef typename selected2::type type ;
+ } ;
+
+
+ //-------------------------------------------------------------------
+ // Top level implementation selector.
+ //-------------------------------------------------------------------
+ template<class T, class S>
+ struct get_is_subranged
+ {
+ typedef get_subranged<T,S> non_trivial_case ;
+ typedef mpl::identity<mpl::false_> trivial_case ;
+
+ typedef is_same<T,S> is_trivial ;
+
+ typedef typename mpl::if_<is_trivial,trivial_case,non_trivial_case>::type selected ;
+
+ typedef typename selected::type type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+
+
diff --git a/ndnboost/numeric/conversion/detail/meta.hpp b/ndnboost/numeric/conversion/detail/meta.hpp
new file mode 100644
index 0000000..a79d670
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/meta.hpp
@@ -0,0 +1,120 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP
+
+#include "ndnboost/type_traits/remove_cv.hpp"
+
+#include "ndnboost/mpl/if.hpp"
+#include "ndnboost/mpl/eval_if.hpp"
+#include "ndnboost/mpl/equal_to.hpp"
+#include "ndnboost/mpl/not.hpp"
+#include "ndnboost/mpl/and.hpp"
+#include "ndnboost/mpl/bool.hpp"
+#include "ndnboost/mpl/identity.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ template< class T1, class T2>
+ struct equal_to
+ {
+ #if !defined(__BORLANDC__)
+
+ enum { x = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value == BOOST_MPL_AUX_VALUE_WKND(T2)::value ) };
+
+ BOOST_STATIC_CONSTANT(bool, value = x);
+
+ typedef mpl::bool_<value> type;
+
+ #else
+
+ BOOST_STATIC_CONSTANT(bool, value = (
+ BOOST_MPL_AUX_VALUE_WKND(T1)::value
+ == BOOST_MPL_AUX_VALUE_WKND(T2)::value
+ ));
+
+ typedef mpl::bool_<(
+ BOOST_MPL_AUX_VALUE_WKND(T1)::value
+ == BOOST_MPL_AUX_VALUE_WKND(T2)::value
+ )> type;
+ #endif
+ };
+
+// Metafunction:
+ //
+ // ct_switch4<Value,Case0Val,Case1Val,Case2Val,Case0Type,Case1Type,Case2Type,DefaultType>::type
+ //
+ // {Value,Case(X)Val} are Integral Constants (such as: mpl::int_<>)
+ // {Case(X)Type,DefaultType} are arbitrary types. (not metafunctions)
+ //
+ // Returns Case(X)Type if Val==Case(X)Val; DefaultType otherwise.
+ //
+ template<class Value,
+ class Case0Val,
+ class Case1Val,
+ class Case2Val,
+ class Case0Type,
+ class Case1Type,
+ class Case2Type,
+ class DefaultType
+ >
+ struct ct_switch4
+ {
+ typedef mpl::identity<Case0Type> Case0TypeQ ;
+ typedef mpl::identity<Case1Type> Case1TypeQ ;
+
+ typedef equal_to<Value,Case0Val> is_case0 ;
+ typedef equal_to<Value,Case1Val> is_case1 ;
+ typedef equal_to<Value,Case2Val> is_case2 ;
+
+ typedef mpl::if_<is_case2,Case2Type,DefaultType> choose_2_3Q ;
+ typedef mpl::eval_if<is_case1,Case1TypeQ,choose_2_3Q> choose_1_2_3Q ;
+
+ typedef typename
+ mpl::eval_if<is_case0,Case0TypeQ,choose_1_2_3Q>::type
+ type ;
+ } ;
+
+
+
+
+ // Metafunction:
+ //
+ // for_both<expr0,expr1,TT,TF,FT,FF>::type
+ //
+ // {exp0,expr1} are Boolean Integral Constants
+ // {TT,TF,FT,FF} are aribtrary types. (not metafunctions)
+ //
+ // According to the combined boolean value of 'expr0 && expr1', selects the corresponding type.
+ //
+ template<class expr0, class expr1, class TT, class TF, class FT, class FF>
+ struct for_both
+ {
+ typedef mpl::identity<TF> TF_Q ;
+ typedef mpl::identity<TT> TT_Q ;
+
+ typedef typename mpl::not_<expr0>::type not_expr0 ;
+ typedef typename mpl::not_<expr1>::type not_expr1 ;
+
+ typedef typename mpl::and_<expr0,expr1>::type caseTT ;
+ typedef typename mpl::and_<expr0,not_expr1>::type caseTF ;
+ typedef typename mpl::and_<not_expr0,expr1>::type caseFT ;
+
+ typedef mpl::if_<caseFT,FT,FF> choose_FT_FF_Q ;
+ typedef mpl::eval_if<caseTF,TF_Q,choose_FT_FF_Q> choose_TF_FT_FF_Q ;
+
+ typedef typename mpl::eval_if<caseTT,TT_Q,choose_TF_FT_FF_Q>::type type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+
+
diff --git a/ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp b/ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp
new file mode 100644
index 0000000..eaccf5c
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp
@@ -0,0 +1,138 @@
+//
+//! Copyright (c) 2011-2012
+//! Brandon Kohn
+//
+// 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)
+//
+
+#if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES)
+
+ #include <ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp>
+
+ #if !defined(BOOST_NO_LONG_LONG)
+ #include <ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp>
+ #endif
+
+#else
+#if !BOOST_PP_IS_ITERATING
+
+ #include <ndnboost/preprocessor/seq/elem.hpp>
+ #include <ndnboost/preprocessor/seq/size.hpp>
+ #include <ndnboost/preprocessor/iteration/iterate.hpp>
+
+ #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp")
+ #endif
+//
+//! Copyright (c) 2011-2012
+//! Brandon Kohn
+//
+// 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)
+//
+ #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+ //! These are the assumed common built in fundamental types (not typedefs/macros.)
+ #define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \
+ (char) \
+ (signed char) \
+ (unsigned char) \
+ (short) \
+ (unsigned short) \
+ (int) \
+ (unsigned int) \
+ (long) \
+ (unsigned long) \
+ (float) \
+ (double) \
+ (long double) \
+ /***/
+
+ #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
+ #define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()
+
+namespace ndnboost { namespace numeric {
+
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp>))
+ #include BOOST_PP_ITERATE()
+
+}}//namespace ndnboost::numeric;
+
+ #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG)
+
+ #undef BOOST_NUMERIC_CONVERSION_SEQ_A
+ #undef BOOST_NUMERIC_CONVERSION_SEQ_B
+
+ #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp")
+ #endif
+
+//
+//! Copyright (c) 2011-2012
+//! Brandon Kohn
+//
+// 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)
+//
+ #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(preserve: 1)
+ #endif
+
+namespace ndnboost { namespace numeric {
+
+ #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(ndnboost::long_long_type)(ndnboost::ulong_long_type)
+ #define BOOST_NUMERIC_CONVERSION_SEQ_B() (ndnboost::long_long_type)(ndnboost::ulong_long_type)
+
+ #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), <ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp>))
+ #include BOOST_PP_ITERATE()
+
+}}//namespace ndnboost::numeric;
+
+ #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES)
+ #pragma wave option(output: null)
+ #endif
+
+ #endif
+
+ #undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES
+ #undef BOOST_NUMERIC_CONVERSION_SEQ_A
+ #undef BOOST_NUMERIC_CONVERSION_SEQ_B
+
+#elif BOOST_PP_ITERATION_DEPTH() == 1
+
+ #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), <ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp>))
+ #include BOOST_PP_ITERATE()
+
+#elif BOOST_PP_ITERATION_DEPTH() == 2
+
+ //! Generate default traits for the specified source and target.
+ #define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1)
+ #define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2)
+
+ template <>
+ struct numeric_cast_traits
+ <
+ BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A())
+ , BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B())> rounding_policy;
+ };
+
+ #undef BOOST_NUMERIC_CONVERSION_A
+ #undef BOOST_NUMERIC_CONVERSION_B
+
+#endif//! Depth 2.
+#endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES
diff --git a/ndnboost/numeric/conversion/detail/old_numeric_cast.hpp b/ndnboost/numeric/conversion/detail/old_numeric_cast.hpp
new file mode 100644
index 0000000..10d9596
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/old_numeric_cast.hpp
@@ -0,0 +1,339 @@
+// boost cast.hpp header file ----------------------------------------------//
+
+// (C) Copyright Kevlin Henney and Dave Abrahams 1999.
+// 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)
+
+// See http://www.boost.org/libs/conversion for Documentation.
+
+// Revision History
+// 23 JUN 05 Code extracted from /boost/cast.hpp into this new header.
+// Keeps this legacy version of numeric_cast<> for old compilers
+// wich can't compile the new version in /boost/numeric/conversion/cast.hpp
+// (Fernando Cacciola)
+// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included
+// <ndnboost/limits.hpp> instead (the workaround did not
+// actually compile when BOOST_NO_LIMITS was defined in
+// any case, so we loose nothing). (John Maddock)
+// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never
+// worked with stock GCC; trying to get it to do that broke
+// vc-stlport.
+// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
+// Removed unused BOOST_EXPLICIT_TARGET macro. Moved
+// ndnboost::detail::type to boost/type.hpp. Made it compile with
+// stock gcc again (Dave Abrahams)
+// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal
+// Review (Beman Dawes)
+// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams)
+// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC
+// (Dave Abrahams)
+// 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams)
+// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes)
+// 27 Jun 00 More MSVC6 workarounds
+// 15 Jun 00 Add workarounds for MSVC6
+// 2 Feb 00 Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
+// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
+// 29 Dec 99 Change using declarations so usages in other namespaces work
+// correctly (Dave Abrahams)
+// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors
+// as suggested Darin Adler and improved by Valentin Bonnard.
+// 2 Sep 99 Remove controversial asserts, simplify, rename.
+// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast,
+// place in nested namespace.
+// 3 Aug 99 Initial version
+
+#ifndef BOOST_OLD_NUMERIC_CAST_HPP
+#define BOOST_OLD_NUMERIC_CAST_HPP
+
+# include <ndnboost/config.hpp>
+# include <cassert>
+# include <typeinfo>
+# include <ndnboost/type.hpp>
+# include <ndnboost/limits.hpp>
+# include <ndnboost/numeric/conversion/converter_policies.hpp>
+
+// It has been demonstrated numerous times that MSVC 6.0 fails silently at link
+// time if you use a template function which has template parameters that don't
+// appear in the function's argument list.
+//
+// TODO: Add this to config.hpp?
+// FLC: This macro is repeated in boost/cast.hpp but only locally (is undefined at the bottom)
+// so is OK to reproduce it here.
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+# define BOOST_EXPLICIT_DEFAULT_TARGET , ::ndnboost::type<Target>* = 0
+# else
+# define BOOST_EXPLICIT_DEFAULT_TARGET
+# endif
+
+namespace ndnboost
+{
+ using numeric::bad_numeric_cast;
+
+// LEGACY numeric_cast [only for some old broken compilers] --------------------------------------//
+
+// Contributed by Kevlin Henney
+
+// numeric_cast ------------------------------------------------------------//
+
+#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)
+
+ namespace detail
+ {
+ template <class T>
+ struct signed_numeric_limits : std::numeric_limits<T>
+ {
+ static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+ return (std::numeric_limits<T>::min)() >= 0
+ // unary minus causes integral promotion, thus the static_cast<>
+ ? static_cast<T>(-(std::numeric_limits<T>::max)())
+ : (std::numeric_limits<T>::min)();
+ };
+ };
+
+ // Move to namespace ndnboost in utility.hpp?
+ template <class T, bool specialized>
+ struct fixed_numeric_limits_base
+ : public if_true< std::numeric_limits<T>::is_signed >
+ ::BOOST_NESTED_TEMPLATE then< signed_numeric_limits<T>,
+ std::numeric_limits<T>
+ >::type
+ {};
+
+ template <class T>
+ struct fixed_numeric_limits
+ : fixed_numeric_limits_base<T,(std::numeric_limits<T>::is_specialized)>
+ {};
+
+# ifdef BOOST_HAS_LONG_LONG
+ // cover implementations which supply no specialization for long
+ // long / unsigned long long. Not intended to be full
+ // numeric_limits replacements, but good enough for numeric_cast<>
+ template <>
+ struct fixed_numeric_limits_base< ::ndnboost::long_long_type, false>
+ {
+ BOOST_STATIC_CONSTANT(bool, is_specialized = true);
+ BOOST_STATIC_CONSTANT(bool, is_signed = true);
+ static ::ndnboost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+# ifdef LONGLONG_MAX
+ return LONGLONG_MAX;
+# else
+ return 9223372036854775807LL; // hope this is portable
+# endif
+ }
+
+ static ::ndnboost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+# ifdef LONGLONG_MIN
+ return LONGLONG_MIN;
+# else
+ return -( 9223372036854775807LL )-1; // hope this is portable
+# endif
+ }
+ };
+
+ template <>
+ struct fixed_numeric_limits_base< ::ndnboost::ulong_long_type, false>
+ {
+ BOOST_STATIC_CONSTANT(bool, is_specialized = true);
+ BOOST_STATIC_CONSTANT(bool, is_signed = false);
+ static ::ndnboost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+# ifdef ULONGLONG_MAX
+ return ULONGLONG_MAX;
+# else
+ return 0xffffffffffffffffULL; // hope this is portable
+# endif
+ }
+
+ static ::ndnboost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
+ };
+# endif
+ } // namespace detail
+
+// less_than_type_min -
+ // x_is_signed should be numeric_limits<X>::is_signed
+ // y_is_signed should be numeric_limits<Y>::is_signed
+ // y_min should be numeric_limits<Y>::min()
+ //
+ // check(x, y_min) returns true iff x < y_min without invoking comparisons
+ // between signed and unsigned values.
+ //
+ // "poor man's partial specialization" is in use here.
+ template <bool x_is_signed, bool y_is_signed>
+ struct less_than_type_min
+ {
+ template <class X, class Y>
+ static bool check(X x, Y y_min)
+ { return x < y_min; }
+ };
+
+ template <>
+ struct less_than_type_min<false, true>
+ {
+ template <class X, class Y>
+ static bool check(X, Y)
+ { return false; }
+ };
+
+ template <>
+ struct less_than_type_min<true, false>
+ {
+ template <class X, class Y>
+ static bool check(X x, Y)
+ { return x < 0; }
+ };
+
+ // greater_than_type_max -
+ // same_sign should be:
+ // numeric_limits<X>::is_signed == numeric_limits<Y>::is_signed
+ // y_max should be numeric_limits<Y>::max()
+ //
+ // check(x, y_max) returns true iff x > y_max without invoking comparisons
+ // between signed and unsigned values.
+ //
+ // "poor man's partial specialization" is in use here.
+ template <bool same_sign, bool x_is_signed>
+ struct greater_than_type_max;
+
+ template<>
+ struct greater_than_type_max<true, true>
+ {
+ template <class X, class Y>
+ static inline bool check(X x, Y y_max)
+ { return x > y_max; }
+ };
+
+ template <>
+ struct greater_than_type_max<false, true>
+ {
+ // What does the standard say about this? I think it's right, and it
+ // will work with every compiler I know of.
+ template <class X, class Y>
+ static inline bool check(X x, Y)
+ { return x >= 0 && static_cast<X>(static_cast<Y>(x)) != x; }
+
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+ // MSVC6 can't static_cast unsigned __int64 -> floating types
+# define BOOST_UINT64_CAST(src_type) \
+ static inline bool check(src_type x, unsigned __int64) \
+ { \
+ if (x < 0) return false; \
+ unsigned __int64 y = static_cast<unsigned __int64>(x); \
+ bool odd = y & 0x1; \
+ __int64 div2 = static_cast<__int64>(y >> 1); \
+ return ((static_cast<src_type>(div2) * 2.0) + odd) != x; \
+ }
+
+ BOOST_UINT64_CAST(long double);
+ BOOST_UINT64_CAST(double);
+ BOOST_UINT64_CAST(float);
+# undef BOOST_UINT64_CAST
+# endif
+ };
+
+ template<>
+ struct greater_than_type_max<true, false>
+ {
+ template <class X, class Y>
+ static inline bool check(X x, Y y_max)
+ { return x > y_max; }
+ };
+
+ template <>
+ struct greater_than_type_max<false, false>
+ {
+ // What does the standard say about this? I think it's right, and it
+ // will work with every compiler I know of.
+ template <class X, class Y>
+ static inline bool check(X x, Y)
+ { return static_cast<X>(static_cast<Y>(x)) != x; }
+ };
+
+#else // use #pragma hacks if available
+
+ namespace detail
+ {
+# if BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4018)
+# pragma warning(disable : 4146)
+#elif defined(__BORLANDC__)
+# pragma option push -w-8041
+# endif
+
+ // Move to namespace ndnboost in utility.hpp?
+ template <class T>
+ struct fixed_numeric_limits : public std::numeric_limits<T>
+ {
+ static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+ {
+ return std::numeric_limits<T>::is_signed && (std::numeric_limits<T>::min)() >= 0
+ ? T(-(std::numeric_limits<T>::max)()) : (std::numeric_limits<T>::min)();
+ }
+ };
+
+# if BOOST_MSVC
+# pragma warning(pop)
+#elif defined(__BORLANDC__)
+# pragma option pop
+# endif
+ } // namespace detail
+
+#endif
+
+ template<typename Target, typename Source>
+ inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
+ {
+ // typedefs abbreviating respective trait classes
+ typedef detail::fixed_numeric_limits<Source> arg_traits;
+ typedef detail::fixed_numeric_limits<Target> result_traits;
+
+#if defined(BOOST_STRICT_CONFIG) \
+ || (!defined(__HP_aCC) || __HP_aCC > 33900) \
+ && (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \
+ || defined(BOOST_SGI_CPP_LIMITS))
+ // typedefs that act as compile time assertions
+ // (to be replaced by boost compile time assertions
+ // as and when they become available and are stable)
+ typedef bool argument_must_be_numeric[arg_traits::is_specialized];
+ typedef bool result_must_be_numeric[result_traits::is_specialized];
+
+ const bool arg_is_signed = arg_traits::is_signed;
+ const bool result_is_signed = result_traits::is_signed;
+ const bool same_sign = arg_is_signed == result_is_signed;
+
+ if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, (result_traits::min)())
+ || greater_than_type_max<same_sign, arg_is_signed>::check(arg, (result_traits::max)())
+ )
+
+#else // We need to use #pragma hacks if available
+
+# if BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable : 4018)
+#elif defined(__BORLANDC__)
+#pragma option push -w-8012
+# endif
+ if ((arg < 0 && !result_traits::is_signed) // loss of negative range
+ || (arg_traits::is_signed && arg < (result_traits::min)()) // underflow
+ || arg > (result_traits::max)()) // overflow
+# if BOOST_MSVC
+# pragma warning(pop)
+#elif defined(__BORLANDC__)
+#pragma option pop
+# endif
+#endif
+ {
+ throw bad_numeric_cast();
+ }
+ return static_cast<Target>(arg);
+ } // numeric_cast
+
+# undef BOOST_EXPLICIT_DEFAULT_TARGET
+
+} // namespace ndnboost
+
+#endif // BOOST_OLD_NUMERIC_CAST_HPP
diff --git a/ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp b/ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp
new file mode 100644
index 0000000..48eee6a
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp
@@ -0,0 +1,1741 @@
+//
+//! Copyright (c) 2011-2012
+//! Brandon Kohn
+//
+// 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)
+//
+
+
+
+namespace ndnboost { namespace numeric {
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , signed char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<signed char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , unsigned char
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned char> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , unsigned short
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned short> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , unsigned int
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned int> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , unsigned long
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<unsigned long> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , float
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<float> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<double> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , long double
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<long double> rounding_policy;
+ };
+}}
diff --git a/ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp b/ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp
new file mode 100644
index 0000000..ef8d541
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp
@@ -0,0 +1,347 @@
+//
+//! Copyright (c) 2011-2012
+//! Brandon Kohn
+//
+// 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)
+//
+namespace ndnboost { namespace numeric {
+
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ char
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ signed char
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned char
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ short
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned short
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ int
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned int
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ unsigned long
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ float
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ double
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ long double
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ ndnboost::long_long_type
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ ndnboost::long_long_type
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ ndnboost::ulong_long_type
+ , ndnboost::long_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::long_long_type> rounding_policy;
+ };
+
+ template <>
+ struct numeric_cast_traits
+ <
+ ndnboost::ulong_long_type
+ , ndnboost::ulong_long_type
+ >
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<ndnboost::ulong_long_type> rounding_policy;
+ };
+}}
diff --git a/ndnboost/numeric/conversion/detail/sign_mixture.hpp b/ndnboost/numeric/conversion/detail/sign_mixture.hpp
new file mode 100644
index 0000000..e49ad1d
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/sign_mixture.hpp
@@ -0,0 +1,72 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
+
+#include "ndnboost/config.hpp"
+#include "ndnboost/limits.hpp"
+
+#include "ndnboost/numeric/conversion/sign_mixture_enum.hpp"
+#include "ndnboost/numeric/conversion/detail/meta.hpp"
+
+#include "ndnboost/mpl/integral_c.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ // Integral Constants for 'SignMixture'
+ typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
+ typedef mpl::integral_c<sign_mixture_enum, signed_to_signed> sig2sig_c ;
+ typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned> sig2unsig_c ;
+ typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed> unsig2sig_c ;
+
+ // Metafunction:
+ //
+ // get_sign_mixture<T,S>::type
+ //
+ // Selects the appropriate SignMixture Integral Constant for the combination T,S.
+ //
+ template<class T,class S>
+ struct get_sign_mixture
+ {
+ typedef mpl::bool_< ::std::numeric_limits<S>::is_signed > S_signed ;
+ typedef mpl::bool_< ::std::numeric_limits<T>::is_signed > T_signed ;
+
+ typedef typename
+ for_both<S_signed, T_signed, sig2sig_c, sig2unsig_c, unsig2sig_c, unsig2unsig_c>::type
+ type ;
+ } ;
+
+ // Metafunction:
+ //
+ // for_sign_mixture<SignMixture,Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig>::type
+ //
+ // {SignMixture} is one of the Integral Constants for SignMixture, declared above.
+ // {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions)
+ //
+ // According to the value of 'SignMixture', selects the corresponding type.
+ //
+ template<class SignMixture, class Sig2Sig, class Sig2Unsig, class Unsig2Sig, class Unsig2Unsig>
+ struct for_sign_mixture
+ {
+ typedef typename
+ ct_switch4<SignMixture
+ , sig2sig_c, sig2unsig_c, unsig2sig_c // default
+ , Sig2Sig , Sig2Unsig , Unsig2Sig , Unsig2Unsig
+ >::type
+ type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/ndnboost/numeric/conversion/detail/udt_builtin_mixture.hpp b/ndnboost/numeric/conversion/detail/udt_builtin_mixture.hpp
new file mode 100644
index 0000000..6b1e282
--- /dev/null
+++ b/ndnboost/numeric/conversion/detail/udt_builtin_mixture.hpp
@@ -0,0 +1,69 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
+
+#include "ndnboost/type_traits/is_arithmetic.hpp"
+
+#include "ndnboost/numeric/conversion/udt_builtin_mixture_enum.hpp"
+#include "ndnboost/numeric/conversion/detail/meta.hpp"
+
+#include "ndnboost/mpl/integral_c.hpp"
+
+namespace ndnboost { namespace numeric { namespace convdetail
+{
+ // Integral Constants for 'UdtMixture'
+ typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
+ typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt> builtin2udt_c ;
+ typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin> udt2builtin_c ;
+ typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt> udt2udt_c ;
+
+ // Metafunction:
+ //
+ // for_udt_mixture<UdtMixture,BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt>::type
+ //
+ // {UdtMixture} is one of the Integral Constants for UdMixture, declared above.
+ // {BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt} are aribtrary types. (not metafunctions)
+ //
+ // According to the value of 'UdtMixture', selects the corresponding type.
+ //
+ template<class UdtMixture, class BuiltIn2BuiltIn, class BuiltIn2Udt, class Udt2BuiltIn, class Udt2Udt>
+ struct for_udt_builtin_mixture
+ {
+ typedef typename
+ ct_switch4<UdtMixture
+ , builtin2builtin_c, builtin2udt_c, udt2builtin_c // default
+ , BuiltIn2BuiltIn , BuiltIn2Udt , Udt2BuiltIn , Udt2Udt
+ >::type
+ type ;
+ } ;
+
+ // Metafunction:
+ //
+ // get_udt_mixture<T,S>::type
+ //
+ // Selects the appropriate UdtMixture Integral Constant for the combination T,S.
+ //
+ template<class T,class S>
+ struct get_udt_builtin_mixture
+ {
+ typedef is_arithmetic<S> S_builtin ;
+ typedef is_arithmetic<T> T_builtin ;
+
+ typedef typename
+ for_both<S_builtin, T_builtin, builtin2builtin_c, builtin2udt_c, udt2builtin_c, udt2udt_c>::type
+ type ;
+ } ;
+
+} } } // namespace ndnboost::numeric::convdetail
+
+#endif
+
+
diff --git a/ndnboost/numeric/conversion/int_float_mixture_enum.hpp b/ndnboost/numeric/conversion/int_float_mixture_enum.hpp
new file mode 100644
index 0000000..a733404
--- /dev/null
+++ b/ndnboost/numeric/conversion/int_float_mixture_enum.hpp
@@ -0,0 +1,29 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP
+
+namespace ndnboost { namespace numeric
+{
+ enum int_float_mixture_enum
+ {
+ integral_to_integral
+ ,integral_to_float
+ ,float_to_integral
+ ,float_to_float
+ } ;
+
+} } // namespace ndnboost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/ndnboost/numeric/conversion/numeric_cast_traits.hpp b/ndnboost/numeric/conversion/numeric_cast_traits.hpp
new file mode 100644
index 0000000..d482bfd
--- /dev/null
+++ b/ndnboost/numeric/conversion/numeric_cast_traits.hpp
@@ -0,0 +1,31 @@
+//
+//! Copyright (c) 2011
+//! Brandon Kohn
+//
+// 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)
+//
+#ifndef BOOST_NUMERIC_CAST_TRAITS_HPP
+#define BOOST_NUMERIC_CAST_TRAITS_HPP
+
+#include <ndnboost/numeric/conversion/converter_policies.hpp>
+
+namespace ndnboost { namespace numeric {
+
+ template <typename Target, typename Source, typename EnableIf = void>
+ struct numeric_cast_traits
+ {
+ typedef def_overflow_handler overflow_policy;
+ typedef UseInternalRangeChecker range_checking_policy;
+ typedef Trunc<Source> rounding_policy;
+ };
+
+}}//namespace ndnboost::numeric;
+
+#if !defined( BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS )
+#include <ndnboost/cstdint.hpp>
+#include <ndnboost/numeric/conversion/detail/numeric_cast_traits.hpp>
+#endif//!defined BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS
+
+#endif//BOOST_NUMERIC_CAST_TRAITS_HPP
diff --git a/ndnboost/numeric/conversion/sign_mixture_enum.hpp b/ndnboost/numeric/conversion/sign_mixture_enum.hpp
new file mode 100644
index 0000000..cfb7151
--- /dev/null
+++ b/ndnboost/numeric/conversion/sign_mixture_enum.hpp
@@ -0,0 +1,29 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+
+namespace ndnboost { namespace numeric
+{
+ enum sign_mixture_enum
+ {
+ unsigned_to_unsigned
+ ,signed_to_signed
+ ,signed_to_unsigned
+ ,unsigned_to_signed
+ } ;
+
+} } // namespace ndnboost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/ndnboost/numeric/conversion/udt_builtin_mixture_enum.hpp b/ndnboost/numeric/conversion/udt_builtin_mixture_enum.hpp
new file mode 100644
index 0000000..6e5bf5d
--- /dev/null
+++ b/ndnboost/numeric/conversion/udt_builtin_mixture_enum.hpp
@@ -0,0 +1,26 @@
+// (c) Copyright Fernando Luis Cacciola Carballal 2000-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)
+
+// See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+
+namespace ndnboost { namespace numeric
+{
+ enum udt_builtin_mixture_enum
+ {
+ builtin_to_builtin
+ ,builtin_to_udt
+ ,udt_to_builtin
+ ,udt_to_udt
+ } ;
+
+} } // namespace ndnboost::numeric
+
+#endif
+
diff --git a/ndnboost/optional.hpp b/ndnboost/optional.hpp
new file mode 100644
index 0000000..0eeecbe
--- /dev/null
+++ b/ndnboost/optional.hpp
@@ -0,0 +1,18 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_OPTIONAL_FLC_19NOV2002_HPP
+#define BOOST_OPTIONAL_FLC_19NOV2002_HPP
+
+#include "ndnboost/optional/optional.hpp"
+
+#endif
+
diff --git a/ndnboost/optional/optional.hpp b/ndnboost/optional/optional.hpp
new file mode 100644
index 0000000..19dc46b
--- /dev/null
+++ b/ndnboost/optional/optional.hpp
@@ -0,0 +1,991 @@
+// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+// Revisions:
+// 27 Apr 2008 (improved swap) Fernando Cacciola, Niels Dekker, Thorsten Ottosen
+//
+#ifndef BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
+#define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP
+
+#include <new>
+#include <algorithm>
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/assert.hpp>
+#include <ndnboost/type.hpp>
+#include <ndnboost/type_traits/alignment_of.hpp>
+#include <ndnboost/type_traits/has_nothrow_constructor.hpp>
+#include <ndnboost/type_traits/type_with_alignment.hpp>
+#include <ndnboost/type_traits/remove_reference.hpp>
+#include <ndnboost/type_traits/is_reference.hpp>
+#include <ndnboost/mpl/if.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/mpl/not.hpp>
+#include <ndnboost/detail/reference_content.hpp>
+#include <ndnboost/none.hpp>
+#include <ndnboost/utility/swap.hpp>
+#include <ndnboost/utility/addressof.hpp>
+#include <ndnboost/utility/compare_pointees.hpp>
+#include <ndnboost/utility/in_place_factory.hpp>
+
+#include <ndnboost/optional/optional_fwd.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
+// VC6.0 has the following bug:
+// When a templated assignment operator exist, an implicit conversion
+// constructing an optional<T> is used when assigment of the form:
+// optional<T> opt ; opt = T(...);
+// is compiled.
+// However, optional's ctor is _explicit_ and the assignemt shouldn't compile.
+// Therefore, for VC6.0 templated assignment is disabled.
+//
+#define BOOST_OPTIONAL_NO_CONVERTING_ASSIGNMENT
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
+// VC7.0 has the following bug:
+// When both a non-template and a template copy-ctor exist
+// and the templated version is made 'explicit', the explicit is also
+// given to the non-templated version, making the class non-implicitely-copyable.
+//
+#define BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
+#endif
+
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) || BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION,<=700)
+// AFAICT only VC7.1 correctly resolves the overload set
+// that includes the in-place factory taking functions,
+// so for the other VC versions, in-place factory support
+// is disabled
+#define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+#endif
+
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x551)
+// BCB (5.5.1) cannot parse the nested template struct in an inplace factory.
+#define BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+#endif
+
+#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) \
+ && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581) )
+// BCB (up to 5.64) has the following bug:
+// If there is a member function/operator template of the form
+// template<class Expr> mfunc( Expr expr ) ;
+// some calls are resolved to this even if there are other better matches.
+// The effect of this bug is that calls to converting ctors and assignments
+// are incrorrectly sink to this general catch-all member function template as shown above.
+#define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
+#endif
+
+#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) > 302 \
+ && !defined(__INTEL_COMPILER)
+// GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with
+// regard to violation of the strict aliasing rules. The optional< T > storage type is marked
+// with this attribute in order to let the compiler know that it will alias objects of type T
+// and silence compilation warnings.
+#define BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS
+#endif
+
+// Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<>
+// member template of a factory as used in the optional<> implementation.
+// He proposed this simple fix which is to move the call to apply<> outside
+// namespace ndnboost.
+namespace ndnboost_optional_detail
+{
+ template <class T, class Factory>
+ inline void construct(Factory const& factory, void* address)
+ {
+ factory.BOOST_NESTED_TEMPLATE apply<T>(address);
+ }
+}
+
+
+namespace ndnboost {
+
+class in_place_factory_base ;
+class typed_in_place_factory_base ;
+
+// This forward is needed to refer to namespace scope swap from the member swap
+template<class T> void swap ( optional<T>& x, optional<T>& y );
+
+namespace optional_detail {
+
+// This local class is used instead of that in "aligned_storage.hpp"
+// because I've found the 'official' class to ICE BCB5.5
+// when some types are used with optional<>
+// (due to sizeof() passed down as a non-type template parameter)
+template <class T>
+class aligned_storage
+{
+ // Borland ICEs if unnamed unions are used for this!
+ union
+ // This works around GCC warnings about breaking strict aliasing rules when casting storage address to T*
+#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
+ __attribute__((may_alias))
+#endif
+ dummy_u
+ {
+ char data[ sizeof(T) ];
+ BOOST_DEDUCED_TYPENAME type_with_alignment<
+ ::ndnboost::alignment_of<T>::value >::type aligner_;
+ } dummy_ ;
+
+ public:
+
+#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
+ void const* address() const { return &dummy_; }
+ void * address() { return &dummy_; }
+#else
+ void const* address() const { return dummy_.data; }
+ void * address() { return dummy_.data; }
+#endif
+} ;
+
+template<class T>
+struct types_when_isnt_ref
+{
+ typedef T const& reference_const_type ;
+ typedef T & reference_type ;
+ typedef T const* pointer_const_type ;
+ typedef T * pointer_type ;
+ typedef T const& argument_type ;
+} ;
+template<class T>
+struct types_when_is_ref
+{
+ typedef BOOST_DEDUCED_TYPENAME remove_reference<T>::type raw_type ;
+
+ typedef raw_type& reference_const_type ;
+ typedef raw_type& reference_type ;
+ typedef raw_type* pointer_const_type ;
+ typedef raw_type* pointer_type ;
+ typedef raw_type& argument_type ;
+} ;
+
+struct optional_tag {} ;
+
+template<class T>
+class optional_base : public optional_tag
+{
+ private :
+
+ typedef
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ BOOST_DEDUCED_TYPENAME
+#endif
+ ::ndnboost::detail::make_reference_content<T>::type internal_type ;
+
+ typedef aligned_storage<internal_type> storage_type ;
+
+ typedef types_when_isnt_ref<T> types_when_not_ref ;
+ typedef types_when_is_ref<T> types_when_ref ;
+
+ typedef optional_base<T> this_type ;
+
+ protected :
+
+ typedef T value_type ;
+
+ typedef mpl::true_ is_reference_tag ;
+ typedef mpl::false_ is_not_reference_tag ;
+
+ typedef BOOST_DEDUCED_TYPENAME is_reference<T>::type is_reference_predicate ;
+
+ public:
+ typedef BOOST_DEDUCED_TYPENAME mpl::if_<is_reference_predicate,types_when_ref,types_when_not_ref>::type types ;
+
+ protected:
+ typedef bool (this_type::*unspecified_bool_type)() const;
+
+ typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::reference_const_type reference_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::pointer_type pointer_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::pointer_const_type pointer_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME types::argument_type argument_type ;
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional_base()
+ :
+ m_initialized(false) {}
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional_base ( none_t )
+ :
+ m_initialized(false) {}
+
+ // Creates an optional<T> initialized with 'val'.
+ // Can throw if T::T(T const&) does
+ optional_base ( argument_type val )
+ :
+ m_initialized(false)
+ {
+ construct(val);
+ }
+
+ // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialzed optional<T>.
+ // Can throw if T::T(T const&) does
+ optional_base ( bool cond, argument_type val )
+ :
+ m_initialized(false)
+ {
+ if ( cond )
+ construct(val);
+ }
+
+ // Creates a deep copy of another optional<T>
+ // Can throw if T::T(T const&) does
+ optional_base ( optional_base const& rhs )
+ :
+ m_initialized(false)
+ {
+ if ( rhs.is_initialized() )
+ construct(rhs.get_impl());
+ }
+
+
+ // This is used for both converting and in-place constructions.
+ // Derived classes use the 'tag' to select the appropriate
+ // implementation (the correct 'construct()' overload)
+ template<class Expr>
+ explicit optional_base ( Expr const& expr, Expr const* tag )
+ :
+ m_initialized(false)
+ {
+ construct(expr,tag);
+ }
+
+
+
+ // No-throw (assuming T::~T() doesn't)
+ ~optional_base() { destroy() ; }
+
+ // Assigns from another optional<T> (deep-copies the rhs value)
+ void assign ( optional_base const& rhs )
+ {
+ if (is_initialized())
+ {
+ if ( rhs.is_initialized() )
+ assign_value(rhs.get_impl(), is_reference_predicate() );
+ else destroy();
+ }
+ else
+ {
+ if ( rhs.is_initialized() )
+ construct(rhs.get_impl());
+ }
+ }
+
+ // Assigns from another _convertible_ optional<U> (deep-copies the rhs value)
+ template<class U>
+ void assign ( optional<U> const& rhs )
+ {
+ if (is_initialized())
+ {
+ if ( rhs.is_initialized() )
+ assign_value(static_cast<value_type>(rhs.get()), is_reference_predicate() );
+ else destroy();
+ }
+ else
+ {
+ if ( rhs.is_initialized() )
+ construct(static_cast<value_type>(rhs.get()));
+ }
+ }
+
+ // Assigns from a T (deep-copies the rhs value)
+ void assign ( argument_type val )
+ {
+ if (is_initialized())
+ assign_value(val, is_reference_predicate() );
+ else construct(val);
+ }
+
+ // Assigns from "none", destroying the current value, if any, leaving this UNINITIALIZED
+ // No-throw (assuming T::~T() doesn't)
+ void assign ( none_t ) { destroy(); }
+
+#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+ template<class Expr>
+ void assign_expr ( Expr const& expr, Expr const* tag )
+ {
+ if (is_initialized())
+ assign_expr_to_initialized(expr,tag);
+ else construct(expr,tag);
+ }
+#endif
+
+ public :
+
+ // Destroys the current value, if any, leaving this UNINITIALIZED
+ // No-throw (assuming T::~T() doesn't)
+ void reset() { destroy(); }
+
+ // Replaces the current value -if any- with 'val'
+ void reset ( argument_type val ) { assign(val); }
+
+ // Returns a pointer to the value if this is initialized, otherwise,
+ // returns NULL.
+ // No-throw
+ pointer_const_type get_ptr() const { return m_initialized ? get_ptr_impl() : 0 ; }
+ pointer_type get_ptr() { return m_initialized ? get_ptr_impl() : 0 ; }
+
+ bool is_initialized() const { return m_initialized ; }
+
+ protected :
+
+ void construct ( argument_type val )
+ {
+ new (m_storage.address()) internal_type(val) ;
+ m_initialized = true ;
+ }
+
+#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+ // Constructs in-place using the given factory
+ template<class Expr>
+ void construct ( Expr const& factory, in_place_factory_base const* )
+ {
+ BOOST_STATIC_ASSERT ( ::ndnboost::mpl::not_<is_reference_predicate>::value ) ;
+ ndnboost_optional_detail::construct<value_type>(factory, m_storage.address());
+ m_initialized = true ;
+ }
+
+ // Constructs in-place using the given typed factory
+ template<class Expr>
+ void construct ( Expr const& factory, typed_in_place_factory_base const* )
+ {
+ BOOST_STATIC_ASSERT ( ::ndnboost::mpl::not_<is_reference_predicate>::value ) ;
+ factory.apply(m_storage.address()) ;
+ m_initialized = true ;
+ }
+
+ template<class Expr>
+ void assign_expr_to_initialized ( Expr const& factory, in_place_factory_base const* tag )
+ {
+ destroy();
+ construct(factory,tag);
+ }
+
+ // Constructs in-place using the given typed factory
+ template<class Expr>
+ void assign_expr_to_initialized ( Expr const& factory, typed_in_place_factory_base const* tag )
+ {
+ destroy();
+ construct(factory,tag);
+ }
+#endif
+
+ // Constructs using any expression implicitely convertible to the single argument
+ // of a one-argument T constructor.
+ // Converting constructions of optional<T> from optional<U> uses this function with
+ // 'Expr' being of type 'U' and relying on a converting constructor of T from U.
+ template<class Expr>
+ void construct ( Expr const& expr, void const* )
+ {
+ new (m_storage.address()) internal_type(expr) ;
+ m_initialized = true ;
+ }
+
+ // Assigns using a form any expression implicitely convertible to the single argument
+ // of a T's assignment operator.
+ // Converting assignments of optional<T> from optional<U> uses this function with
+ // 'Expr' being of type 'U' and relying on a converting assignment of T from U.
+ template<class Expr>
+ void assign_expr_to_initialized ( Expr const& expr, void const* )
+ {
+ assign_value(expr, is_reference_predicate());
+ }
+
+#ifdef BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION
+ // BCB5.64 (and probably lower versions) workaround.
+ // The in-place factories are supported by means of catch-all constructors
+ // and assignment operators (the functions are parameterized in terms of
+ // an arbitrary 'Expr' type)
+ // This compiler incorrectly resolves the overload set and sinks optional<T> and optional<U>
+ // to the 'Expr'-taking functions even though explicit overloads are present for them.
+ // Thus, the following overload is needed to properly handle the case when the 'lhs'
+ // is another optional.
+ //
+ // For VC<=70 compilers this workaround dosen't work becasue the comnpiler issues and error
+ // instead of choosing the wrong overload
+ //
+ // Notice that 'Expr' will be optional<T> or optional<U> (but not optional_base<..>)
+ template<class Expr>
+ void construct ( Expr const& expr, optional_tag const* )
+ {
+ if ( expr.is_initialized() )
+ {
+ // An exception can be thrown here.
+ // It it happens, THIS will be left uninitialized.
+ new (m_storage.address()) internal_type(expr.get()) ;
+ m_initialized = true ;
+ }
+ }
+#endif
+
+ void assign_value ( argument_type val, is_not_reference_tag ) { get_impl() = val; }
+ void assign_value ( argument_type val, is_reference_tag ) { construct(val); }
+
+ void destroy()
+ {
+ if ( m_initialized )
+ destroy_impl(is_reference_predicate()) ;
+ }
+
+ unspecified_bool_type safe_bool() const { return m_initialized ? &this_type::is_initialized : 0 ; }
+
+ reference_const_type get_impl() const { return dereference(get_object(), is_reference_predicate() ) ; }
+ reference_type get_impl() { return dereference(get_object(), is_reference_predicate() ) ; }
+
+ pointer_const_type get_ptr_impl() const { return cast_ptr(get_object(), is_reference_predicate() ) ; }
+ pointer_type get_ptr_impl() { return cast_ptr(get_object(), is_reference_predicate() ) ; }
+
+ private :
+
+ // internal_type can be either T or reference_content<T>
+#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS)
+ // This workaround is supposed to silence GCC warnings about broken strict aliasing rules
+ internal_type const* get_object() const
+ {
+ union { void const* ap_pvoid; internal_type const* as_ptype; } caster = { m_storage.address() };
+ return caster.as_ptype;
+ }
+ internal_type * get_object()
+ {
+ union { void* ap_pvoid; internal_type* as_ptype; } caster = { m_storage.address() };
+ return caster.as_ptype;
+ }
+#else
+ internal_type const* get_object() const { return static_cast<internal_type const*>(m_storage.address()); }
+ internal_type * get_object() { return static_cast<internal_type *> (m_storage.address()); }
+#endif
+
+ // reference_content<T> lacks an implicit conversion to T&, so the following is needed to obtain a proper reference.
+ reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; }
+ reference_type dereference( internal_type* p, is_not_reference_tag ) { return *p ; }
+ reference_const_type dereference( internal_type const* p, is_reference_tag ) const { return p->get() ; }
+ reference_type dereference( internal_type* p, is_reference_tag ) { return p->get() ; }
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x581))
+ void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->internal_type::~internal_type() ; m_initialized = false ; }
+#else
+ void destroy_impl ( is_not_reference_tag ) { get_ptr_impl()->T::~T() ; m_initialized = false ; }
+#endif
+
+ void destroy_impl ( is_reference_tag ) { m_initialized = false ; }
+
+ // If T is of reference type, trying to get a pointer to the held value must result in a compile-time error.
+ // Decent compilers should disallow conversions from reference_content<T>* to T*, but just in case,
+ // the following olverloads are used to filter out the case and guarantee an error in case of T being a reference.
+ pointer_const_type cast_ptr( internal_type const* p, is_not_reference_tag ) const { return p ; }
+ pointer_type cast_ptr( internal_type * p, is_not_reference_tag ) { return p ; }
+ pointer_const_type cast_ptr( internal_type const* p, is_reference_tag ) const { return &p->get() ; }
+ pointer_type cast_ptr( internal_type * p, is_reference_tag ) { return &p->get() ; }
+
+ bool m_initialized ;
+ storage_type m_storage ;
+} ;
+
+} // namespace optional_detail
+
+template<class T>
+class optional : public optional_detail::optional_base<T>
+{
+ typedef optional_detail::optional_base<T> base ;
+
+ typedef BOOST_DEDUCED_TYPENAME base::unspecified_bool_type unspecified_bool_type ;
+
+ public :
+
+ typedef optional<T> this_type ;
+
+ typedef BOOST_DEDUCED_TYPENAME base::value_type value_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::reference_type reference_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::reference_const_type reference_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::pointer_type pointer_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::pointer_const_type pointer_const_type ;
+ typedef BOOST_DEDUCED_TYPENAME base::argument_type argument_type ;
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional() : base() {}
+
+ // Creates an optional<T> uninitialized.
+ // No-throw
+ optional( none_t none_ ) : base(none_) {}
+
+ // Creates an optional<T> initialized with 'val'.
+ // Can throw if T::T(T const&) does
+ optional ( argument_type val ) : base(val) {}
+
+ // Creates an optional<T> initialized with 'val' IFF cond is true, otherwise creates an uninitialized optional.
+ // Can throw if T::T(T const&) does
+ optional ( bool cond, argument_type val ) : base(cond,val) {}
+
+#ifndef BOOST_OPTIONAL_NO_CONVERTING_COPY_CTOR
+ // NOTE: MSVC needs templated versions first
+
+ // Creates a deep copy of another convertible optional<U>
+ // Requires a valid conversion from U to T.
+ // Can throw if T::T(U const&) does
+ template<class U>
+ explicit optional ( optional<U> const& rhs )
+ :
+ base()
+ {
+ if ( rhs.is_initialized() )
+ this->construct(rhs.get());
+ }
+#endif
+
+#ifndef BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT
+ // Creates an optional<T> with an expression which can be either
+ // (a) An instance of InPlaceFactory (i.e. in_place(a,b,...,n);
+ // (b) An instance of TypedInPlaceFactory ( i.e. in_place<T>(a,b,...,n);
+ // (c) Any expression implicitely convertible to the single type
+ // of a one-argument T's constructor.
+ // (d*) Weak compilers (BCB) might also resolved Expr as optional<T> and optional<U>
+ // even though explicit overloads are present for these.
+ // Depending on the above some T ctor is called.
+ // Can throw is the resolved T ctor throws.
+ template<class Expr>
+ explicit optional ( Expr const& expr ) : base(expr,ndnboost::addressof(expr)) {}
+#endif
+
+ // Creates a deep copy of another optional<T>
+ // Can throw if T::T(T const&) does
+ optional ( optional const& rhs ) : base( static_cast<base const&>(rhs) ) {}
+
+ // No-throw (assuming T::~T() doesn't)
+ ~optional() {}
+
+#if !defined(BOOST_OPTIONAL_NO_INPLACE_FACTORY_SUPPORT) && !defined(BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION)
+ // Assigns from an expression. See corresponding constructor.
+ // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED
+ template<class Expr>
+ optional& operator= ( Expr const& expr )
+ {
+ this->assign_expr(expr,ndnboost::addressof(expr));
+ return *this ;
+ }
+#endif
+
+
+#ifndef BOOST_OPTIONAL_NO_CONVERTING_ASSIGNMENT
+ // Assigns from another convertible optional<U> (converts && deep-copies the rhs value)
+ // Requires a valid conversion from U to T.
+ // Basic Guarantee: If T::T( U const& ) throws, this is left UNINITIALIZED
+ template<class U>
+ optional& operator= ( optional<U> const& rhs )
+ {
+ this->assign(rhs);
+ return *this ;
+ }
+#endif
+
+ // Assigns from another optional<T> (deep-copies the rhs value)
+ // Basic Guarantee: If T::T( T const& ) throws, this is left UNINITIALIZED
+ // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw)
+ optional& operator= ( optional const& rhs )
+ {
+ this->assign( static_cast<base const&>(rhs) ) ;
+ return *this ;
+ }
+
+ // Assigns from a T (deep-copies the rhs value)
+ // Basic Guarantee: If T::( T const& ) throws, this is left UNINITIALIZED
+ optional& operator= ( argument_type val )
+ {
+ this->assign( val ) ;
+ return *this ;
+ }
+
+ // Assigns from a "none"
+ // Which destroys the current value, if any, leaving this UNINITIALIZED
+ // No-throw (assuming T::~T() doesn't)
+ optional& operator= ( none_t none_ )
+ {
+ this->assign( none_ ) ;
+ return *this ;
+ }
+
+ void swap( optional & arg )
+ {
+ // allow for Koenig lookup
+ using ndnboost::swap;
+ swap(*this, arg);
+ }
+
+
+ // Returns a reference to the value if this is initialized, otherwise,
+ // the behaviour is UNDEFINED
+ // No-throw
+ reference_const_type get() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
+ reference_type get() { BOOST_ASSERT(this->is_initialized()) ; return this->get_impl(); }
+
+ // Returns a copy of the value if this is initialized, 'v' otherwise
+ reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; }
+ reference_type get_value_or ( reference_type v ) { return this->is_initialized() ? get() : v ; }
+
+ // Returns a pointer to the value if this is initialized, otherwise,
+ // the behaviour is UNDEFINED
+ // No-throw
+ pointer_const_type operator->() const { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
+ pointer_type operator->() { BOOST_ASSERT(this->is_initialized()) ; return this->get_ptr_impl() ; }
+
+ // Returns a reference to the value if this is initialized, otherwise,
+ // the behaviour is UNDEFINED
+ // No-throw
+ reference_const_type operator *() const { return this->get() ; }
+ reference_type operator *() { return this->get() ; }
+
+ // implicit conversion to "bool"
+ // No-throw
+ operator unspecified_bool_type() const { return this->safe_bool() ; }
+
+ // This is provided for those compilers which don't like the conversion to bool
+ // on some contexts.
+ bool operator!() const { return !this->is_initialized() ; }
+} ;
+
+// Returns optional<T>(v)
+template<class T>
+inline
+optional<T> make_optional ( T const& v )
+{
+ return optional<T>(v);
+}
+
+// Returns optional<T>(cond,v)
+template<class T>
+inline
+optional<T> make_optional ( bool cond, T const& v )
+{
+ return optional<T>(cond,v);
+}
+
+// Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type
+get ( optional<T> const& opt )
+{
+ return opt.get() ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_type
+get ( optional<T>& opt )
+{
+ return opt.get() ;
+}
+
+// Returns a pointer to the value if this is initialized, otherwise, returns NULL.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_const_type
+get ( optional<T> const* opt )
+{
+ return opt->get_ptr() ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_type
+get ( optional<T>* opt )
+{
+ return opt->get_ptr() ;
+}
+
+// Returns a reference to the value if this is initialized, otherwise, the behaviour is UNDEFINED.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type
+get_optional_value_or ( optional<T> const& opt, BOOST_DEDUCED_TYPENAME optional<T>::reference_const_type v )
+{
+ return opt.get_value_or(v) ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::reference_type
+get_optional_value_or ( optional<T>& opt, BOOST_DEDUCED_TYPENAME optional<T>::reference_type v )
+{
+ return opt.get_value_or(v) ;
+}
+
+// Returns a pointer to the value if this is initialized, otherwise, returns NULL.
+// No-throw
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_const_type
+get_pointer ( optional<T> const& opt )
+{
+ return opt.get_ptr() ;
+}
+
+template<class T>
+inline
+BOOST_DEDUCED_TYPENAME optional<T>::pointer_type
+get_pointer ( optional<T>& opt )
+{
+ return opt.get_ptr() ;
+}
+
+// optional's relational operators ( ==, !=, <, >, <=, >= ) have deep-semantics (compare values).
+// WARNING: This is UNLIKE pointers. Use equal_pointees()/less_pointess() in generic code instead.
+
+
+//
+// optional<T> vs optional<T> cases
+//
+
+template<class T>
+inline
+bool operator == ( optional<T> const& x, optional<T> const& y )
+{ return equal_pointees(x,y); }
+
+template<class T>
+inline
+bool operator < ( optional<T> const& x, optional<T> const& y )
+{ return less_pointees(x,y); }
+
+template<class T>
+inline
+bool operator != ( optional<T> const& x, optional<T> const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( optional<T> const& x, optional<T> const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( optional<T> const& x, optional<T> const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( optional<T> const& x, optional<T> const& y )
+{ return !( x < y ) ; }
+
+
+//
+// optional<T> vs T cases
+//
+template<class T>
+inline
+bool operator == ( optional<T> const& x, T const& y )
+{ return equal_pointees(x, optional<T>(y)); }
+
+template<class T>
+inline
+bool operator < ( optional<T> const& x, T const& y )
+{ return less_pointees(x, optional<T>(y)); }
+
+template<class T>
+inline
+bool operator != ( optional<T> const& x, T const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( optional<T> const& x, T const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( optional<T> const& x, T const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( optional<T> const& x, T const& y )
+{ return !( x < y ) ; }
+
+//
+// T vs optional<T> cases
+//
+
+template<class T>
+inline
+bool operator == ( T const& x, optional<T> const& y )
+{ return equal_pointees( optional<T>(x), y ); }
+
+template<class T>
+inline
+bool operator < ( T const& x, optional<T> const& y )
+{ return less_pointees( optional<T>(x), y ); }
+
+template<class T>
+inline
+bool operator != ( T const& x, optional<T> const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( T const& x, optional<T> const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( T const& x, optional<T> const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( T const& x, optional<T> const& y )
+{ return !( x < y ) ; }
+
+
+//
+// optional<T> vs none cases
+//
+
+template<class T>
+inline
+bool operator == ( optional<T> const& x, none_t )
+{ return equal_pointees(x, optional<T>() ); }
+
+template<class T>
+inline
+bool operator < ( optional<T> const& x, none_t )
+{ return less_pointees(x,optional<T>() ); }
+
+template<class T>
+inline
+bool operator != ( optional<T> const& x, none_t y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( optional<T> const& x, none_t y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( optional<T> const& x, none_t y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( optional<T> const& x, none_t y )
+{ return !( x < y ) ; }
+
+//
+// none vs optional<T> cases
+//
+
+template<class T>
+inline
+bool operator == ( none_t , optional<T> const& y )
+{ return equal_pointees(optional<T>() ,y); }
+
+template<class T>
+inline
+bool operator < ( none_t , optional<T> const& y )
+{ return less_pointees(optional<T>() ,y); }
+
+template<class T>
+inline
+bool operator != ( none_t x, optional<T> const& y )
+{ return !( x == y ) ; }
+
+template<class T>
+inline
+bool operator > ( none_t x, optional<T> const& y )
+{ return y < x ; }
+
+template<class T>
+inline
+bool operator <= ( none_t x, optional<T> const& y )
+{ return !( y < x ) ; }
+
+template<class T>
+inline
+bool operator >= ( none_t x, optional<T> const& y )
+{ return !( x < y ) ; }
+
+namespace optional_detail {
+
+template<bool use_default_constructor> struct swap_selector;
+
+template<>
+struct swap_selector<true>
+{
+ template<class T>
+ static void optional_swap ( optional<T>& x, optional<T>& y )
+ {
+ const bool hasX = !!x;
+ const bool hasY = !!y;
+
+ if ( !hasX && !hasY )
+ return;
+
+ if( !hasX )
+ x = ndnboost::in_place();
+ else if ( !hasY )
+ y = ndnboost::in_place();
+
+ // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
+ ndnboost::swap(x.get(),y.get());
+
+ if( !hasX )
+ y = ndnboost::none ;
+ else if( !hasY )
+ x = ndnboost::none ;
+ }
+};
+
+template<>
+struct swap_selector<false>
+{
+ template<class T>
+ static void optional_swap ( optional<T>& x, optional<T>& y )
+ {
+ const bool hasX = !!x;
+ const bool hasY = !!y;
+
+ if ( !hasX && hasY )
+ {
+ x = y.get();
+ y = ndnboost::none ;
+ }
+ else if ( hasX && !hasY )
+ {
+ y = x.get();
+ x = ndnboost::none ;
+ }
+ else if ( hasX && hasY )
+ {
+ // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
+ ndnboost::swap(x.get(),y.get());
+ }
+ }
+};
+
+} // namespace optional_detail
+
+template<class T>
+struct optional_swap_should_use_default_constructor : has_nothrow_default_constructor<T> {} ;
+
+template<class T> inline void swap ( optional<T>& x, optional<T>& y )
+{
+ optional_detail::swap_selector<optional_swap_should_use_default_constructor<T>::value>::optional_swap(x, y);
+}
+
+} // namespace ndnboost
+
+#endif
diff --git a/ndnboost/optional/optional_fwd.hpp b/ndnboost/optional/optional_fwd.hpp
new file mode 100644
index 0000000..70fd54b
--- /dev/null
+++ b/ndnboost/optional/optional_fwd.hpp
@@ -0,0 +1,29 @@
+// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+// Revisions:
+// 10 May 2008 (added swap related forward declaration) Niels Dekker
+//
+#ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
+#define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
+
+namespace ndnboost {
+
+template<class T> class optional ;
+
+template<class T> void swap ( optional<T>& , optional<T>& ) ;
+
+template<class T> struct optional_swap_should_use_default_constructor ;
+
+} // namespace ndnboost
+
+#endif
+
diff --git a/ndnboost/preprocessor/arithmetic/detail/div_base.hpp b/ndnboost/preprocessor/arithmetic/detail/div_base.hpp
new file mode 100644
index 0000000..5f8e234
--- /dev/null
+++ b/ndnboost/preprocessor/arithmetic/detail/div_base.hpp
@@ -0,0 +1,61 @@
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * 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)
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP
+# define BOOST_PREPROCESSOR_ARITHMETIC_DETAIL_DIV_BASE_HPP
+#
+# include <ndnboost/preprocessor/arithmetic/inc.hpp>
+# include <ndnboost/preprocessor/arithmetic/sub.hpp>
+# include <ndnboost/preprocessor/comparison/less_equal.hpp>
+# include <ndnboost/preprocessor/config/config.hpp>
+# include <ndnboost/preprocessor/control/while.hpp>
+# include <ndnboost/preprocessor/tuple/elem.hpp>
+# include <ndnboost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_DIV_BASE */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_DIV_BASE(x, y) BOOST_PP_WHILE(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
+# else
+# define BOOST_PP_DIV_BASE(x, y) BOOST_PP_DIV_BASE_I(x, y)
+# define BOOST_PP_DIV_BASE_I(x, y) BOOST_PP_WHILE(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
+# endif
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_DIV_BASE_P(d, rxy) BOOST_PP_DIV_BASE_P_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
+# define BOOST_PP_DIV_BASE_P_IM(d, im) BOOST_PP_DIV_BASE_P_I(d, im)
+# else
+# define BOOST_PP_DIV_BASE_P(d, rxy) BOOST_PP_DIV_BASE_P_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
+# endif
+#
+# define BOOST_PP_DIV_BASE_P_I(d, r, x, y) BOOST_PP_LESS_EQUAL_D(d, y, x)
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_DIV_BASE_O(d, rxy) BOOST_PP_DIV_BASE_O_IM(d, BOOST_PP_TUPLE_REM_3 rxy)
+# define BOOST_PP_DIV_BASE_O_IM(d, im) BOOST_PP_DIV_BASE_O_I(d, im)
+# else
+# define BOOST_PP_DIV_BASE_O(d, rxy) BOOST_PP_DIV_BASE_O_I(d, BOOST_PP_TUPLE_ELEM(3, 0, rxy), BOOST_PP_TUPLE_ELEM(3, 1, rxy), BOOST_PP_TUPLE_ELEM(3, 2, rxy))
+# endif
+#
+# define BOOST_PP_DIV_BASE_O_I(d, r, x, y) (BOOST_PP_INC(r), BOOST_PP_SUB_D(d, x, y), y)
+#
+# /* BOOST_PP_DIV_BASE_D */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_DIV_BASE_D(d, x, y) BOOST_PP_WHILE_ ## d(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
+# else
+# define BOOST_PP_DIV_BASE_D(d, x, y) BOOST_PP_DIV_BASE_D_I(d, x, y)
+# define BOOST_PP_DIV_BASE_D_I(d, x, y) BOOST_PP_WHILE_ ## d(BOOST_PP_DIV_BASE_P, BOOST_PP_DIV_BASE_O, (0, x, y))
+# endif
+#
+# endif
diff --git a/ndnboost/preprocessor/arithmetic/mod.hpp b/ndnboost/preprocessor/arithmetic/mod.hpp
new file mode 100644
index 0000000..aa85437
--- /dev/null
+++ b/ndnboost/preprocessor/arithmetic/mod.hpp
@@ -0,0 +1,39 @@
+# /* Copyright (C) 2001
+# * Housemarque Oy
+# * http://www.housemarque.com
+# *
+# * 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)
+# */
+#
+# /* Revised by Paul Mensonides (2002) */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_ARITHMETIC_MOD_HPP
+# define BOOST_PREPROCESSOR_ARITHMETIC_MOD_HPP
+#
+# include <ndnboost/preprocessor/arithmetic/detail/div_base.hpp>
+# include <ndnboost/preprocessor/config/config.hpp>
+# include <ndnboost/preprocessor/tuple/elem.hpp>
+#
+# /* BOOST_PP_MOD */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_MOD(x, y) BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_DIV_BASE(x, y))
+# else
+# define BOOST_PP_MOD(x, y) BOOST_PP_MOD_I(x, y)
+# define BOOST_PP_MOD_I(x, y) BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_DIV_BASE(x, y))
+# endif
+#
+# /* BOOST_PP_MOD_D */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_MOD_D(d, x, y) BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_DIV_BASE_D(d, x, y))
+# else
+# define BOOST_PP_MOD_D(d, x, y) BOOST_PP_MOD_D_I(d, x, y)
+# define BOOST_PP_MOD_D_I(d, x, y) BOOST_PP_TUPLE_ELEM(3, 1, BOOST_PP_DIV_BASE_D(d, x, y))
+# endif
+#
+# endif
diff --git a/ndnboost/preprocessor/comparison/greater.hpp b/ndnboost/preprocessor/comparison/greater.hpp
deleted file mode 100644
index 34e5a9e..0000000
--- a/ndnboost/preprocessor/comparison/greater.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-# /* Copyright (C) 2001
-# * Housemarque Oy
-# * http://www.housemarque.com
-# *
-# * 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)
-# */
-#
-# /* Revised by Paul Mensonides (2002) */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_COMPARISON_GREATER_HPP
-# define BOOST_PREPROCESSOR_COMPARISON_GREATER_HPP
-#
-# include <ndnboost/preprocessor/comparison/less.hpp>
-# include <ndnboost/preprocessor/config/config.hpp>
-#
-# /* BOOST_PP_GREATER */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_GREATER(x, y) BOOST_PP_LESS(y, x)
-# else
-# define BOOST_PP_GREATER(x, y) BOOST_PP_GREATER_I(x, y)
-# define BOOST_PP_GREATER_I(x, y) BOOST_PP_LESS(y, x)
-# endif
-#
-# /* BOOST_PP_GREATER_D */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_GREATER_D(d, x, y) BOOST_PP_LESS_D(d, y, x)
-# else
-# define BOOST_PP_GREATER_D(d, x, y) BOOST_PP_GREATER_D_I(d, x, y)
-# define BOOST_PP_GREATER_D_I(d, x, y) BOOST_PP_LESS_D(d, y, x)
-# endif
-#
-# endif
diff --git a/ndnboost/preprocessor/comparison/less.hpp b/ndnboost/preprocessor/comparison/less.hpp
deleted file mode 100644
index 5f138cf..0000000
--- a/ndnboost/preprocessor/comparison/less.hpp
+++ /dev/null
@@ -1,46 +0,0 @@
-# /* Copyright (C) 2001
-# * Housemarque Oy
-# * http://www.housemarque.com
-# *
-# * 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)
-# */
-#
-# /* Revised by Paul Mensonides (2002) */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_COMPARISON_LESS_HPP
-# define BOOST_PREPROCESSOR_COMPARISON_LESS_HPP
-#
-# include <ndnboost/preprocessor/comparison/less_equal.hpp>
-# include <ndnboost/preprocessor/comparison/not_equal.hpp>
-# include <ndnboost/preprocessor/config/config.hpp>
-# include <ndnboost/preprocessor/control/iif.hpp>
-# include <ndnboost/preprocessor/logical/bitand.hpp>
-# include <ndnboost/preprocessor/tuple/eat.hpp>
-#
-# /* BOOST_PP_LESS */
-#
-# if BOOST_PP_CONFIG_FLAGS() & (BOOST_PP_CONFIG_MWCC() | BOOST_PP_CONFIG_DMC())
-# define BOOST_PP_LESS(x, y) BOOST_PP_BITAND(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL(x, y))
-# elif ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_LESS(x, y) BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL, 0 BOOST_PP_TUPLE_EAT_2)(x, y)
-# else
-# define BOOST_PP_LESS(x, y) BOOST_PP_LESS_I(x, y)
-# define BOOST_PP_LESS_I(x, y) BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL, 0 BOOST_PP_TUPLE_EAT_2)(x, y)
-# endif
-#
-# /* BOOST_PP_LESS_D */
-#
-# if BOOST_PP_CONFIG_FLAGS() & (BOOST_PP_CONFIG_MWCC() | BOOST_PP_CONFIG_DMC())
-# define BOOST_PP_LESS_D(d, x, y) BOOST_PP_BITAND(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL_D(d, x, y))
-# elif ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_LESS_D(d, x, y) BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL_D, 0 BOOST_PP_TUPLE_EAT_3)(d, x, y)
-# else
-# define BOOST_PP_LESS_D(d, x, y) BOOST_PP_LESS_D_I(d, x, y)
-# define BOOST_PP_LESS_D_I(d, x, y) BOOST_PP_IIF(BOOST_PP_NOT_EQUAL(x, y), BOOST_PP_LESS_EQUAL_D, 0 BOOST_PP_TUPLE_EAT_3)(d, x, y)
-# endif
-#
-# endif
diff --git a/ndnboost/preprocessor/comparison/not_equal.hpp b/ndnboost/preprocessor/comparison/not_equal.hpp
deleted file mode 100644
index 9153890..0000000
--- a/ndnboost/preprocessor/comparison/not_equal.hpp
+++ /dev/null
@@ -1,814 +0,0 @@
-# /* Copyright (C) 2001
-# * Housemarque Oy
-# * http://www.housemarque.com
-# *
-# * 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)
-# */
-#
-# /* Revised by Paul Mensonides (2002) */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_COMPARISON_NOT_EQUAL_HPP
-# define BOOST_PREPROCESSOR_COMPARISON_NOT_EQUAL_HPP
-#
-# include <ndnboost/preprocessor/cat.hpp>
-# include <ndnboost/preprocessor/config/config.hpp>
-# include <ndnboost/preprocessor/control/iif.hpp>
-#
-# /* BOOST_PP_NOT_EQUAL */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
-# define BOOST_PP_NOT_EQUAL(x, y) BOOST_PP_NOT_EQUAL_I(x, y)
-# else
-# define BOOST_PP_NOT_EQUAL(x, y) BOOST_PP_NOT_EQUAL_OO((x, y))
-# define BOOST_PP_NOT_EQUAL_OO(par) BOOST_PP_NOT_EQUAL_I ## par
-# endif
-#
-# define BOOST_PP_NOT_EQUAL_I(x, y) BOOST_PP_CAT(BOOST_PP_NOT_EQUAL_CHECK_, BOOST_PP_NOT_EQUAL_ ## x(0, BOOST_PP_NOT_EQUAL_ ## y))
-#
-# /* BOOST_PP_NOT_EQUAL_D */
-#
-# define BOOST_PP_NOT_EQUAL_D(d, x, y) BOOST_PP_NOT_EQUAL(x, y)
-#
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NIL 1
-#
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_0(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_1(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_2(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_3(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_4(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_5(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_6(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_7(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_8(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_9(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_10(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_11(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_12(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_13(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_14(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_15(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_16(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_17(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_18(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_19(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_20(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_21(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_22(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_23(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_24(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_25(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_26(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_27(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_28(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_29(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_30(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_31(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_32(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_33(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_34(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_35(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_36(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_37(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_38(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_39(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_40(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_41(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_42(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_43(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_44(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_45(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_46(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_47(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_48(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_49(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_50(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_51(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_52(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_53(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_54(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_55(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_56(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_57(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_58(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_59(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_60(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_61(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_62(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_63(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_64(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_65(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_66(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_67(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_68(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_69(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_70(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_71(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_72(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_73(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_74(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_75(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_76(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_77(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_78(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_79(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_80(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_81(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_82(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_83(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_84(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_85(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_86(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_87(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_88(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_89(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_90(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_91(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_92(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_93(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_94(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_95(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_96(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_97(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_98(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_99(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_100(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_101(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_102(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_103(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_104(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_105(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_106(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_107(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_108(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_109(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_110(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_111(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_112(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_113(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_114(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_115(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_116(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_117(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_118(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_119(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_120(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_121(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_122(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_123(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_124(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_125(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_126(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_127(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_128(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_129(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_130(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_131(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_132(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_133(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_134(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_135(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_136(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_137(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_138(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_139(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_140(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_141(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_142(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_143(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_144(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_145(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_146(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_147(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_148(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_149(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_150(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_151(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_152(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_153(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_154(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_155(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_156(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_157(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_158(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_159(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_160(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_161(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_162(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_163(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_164(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_165(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_166(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_167(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_168(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_169(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_170(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_171(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_172(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_173(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_174(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_175(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_176(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_177(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_178(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_179(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_180(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_181(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_182(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_183(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_184(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_185(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_186(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_187(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_188(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_189(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_190(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_191(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_192(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_193(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_194(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_195(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_196(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_197(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_198(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_199(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_200(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_201(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_202(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_203(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_204(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_205(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_206(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_207(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_208(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_209(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_210(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_211(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_212(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_213(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_214(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_215(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_216(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_217(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_218(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_219(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_220(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_221(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_222(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_223(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_224(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_225(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_226(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_227(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_228(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_229(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_230(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_231(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_232(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_233(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_234(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_235(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_236(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_237(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_238(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_239(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_240(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_241(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_242(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_243(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_244(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_245(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_246(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_247(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_248(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_249(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_250(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_251(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_252(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_253(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_254(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_255(c, y) 0
-# define BOOST_PP_NOT_EQUAL_CHECK_BOOST_PP_NOT_EQUAL_256(c, y) 0
-#
-#if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
-# define BOOST_PP_NOT_EQUAL_0(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_1(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_2(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_3(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_4(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_5(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_6(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_7(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_8(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_9(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_10(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_11(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_12(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_13(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_14(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_15(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_16(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_17(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_18(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_19(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_20(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_21(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_22(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_23(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_24(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_25(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_26(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_27(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_28(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_29(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_30(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_31(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_32(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_33(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_34(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_35(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_36(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_37(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_38(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_39(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_40(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_41(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_42(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_43(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_44(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_45(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_46(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_47(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_48(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_49(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_50(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_51(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_52(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_53(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_54(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_55(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_56(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_57(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_58(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_59(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_60(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_61(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_62(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_63(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_64(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_65(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_66(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_67(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_68(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_69(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_70(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_71(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_72(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_73(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_74(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_75(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_76(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_77(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_78(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_79(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_80(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_81(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_82(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_83(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_84(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_85(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_86(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_87(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_88(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_89(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_90(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_91(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_92(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_93(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_94(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_95(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_96(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_97(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_98(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_99(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_100(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_101(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_102(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_103(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_104(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_105(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_106(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_107(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_108(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_109(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_110(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_111(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_112(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_113(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_114(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_115(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_116(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_117(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_118(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_119(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_120(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_121(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_122(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_123(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_124(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_125(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_126(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_127(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_128(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_129(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_130(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_131(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_132(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_133(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_134(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_135(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_136(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_137(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_138(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_139(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_140(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_141(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_142(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_143(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_144(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_145(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_146(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_147(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_148(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_149(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_150(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_151(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_152(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_153(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_154(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_155(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_156(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_157(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_158(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_159(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_160(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_161(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_162(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_163(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_164(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_165(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_166(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_167(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_168(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_169(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_170(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_171(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_172(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_173(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_174(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_175(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_176(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_177(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_178(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_179(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_180(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_181(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_182(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_183(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_184(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_185(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_186(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_187(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_188(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_189(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_190(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_191(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_192(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_193(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_194(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_195(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_196(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_197(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_198(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_199(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_200(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_201(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_202(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_203(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_204(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_205(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_206(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_207(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_208(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_209(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_210(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_211(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_212(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_213(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_214(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_215(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_216(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_217(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_218(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_219(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_220(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_221(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_222(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_223(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_224(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_225(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_226(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_227(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_228(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_229(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_230(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_231(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_232(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_233(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_234(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_235(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_236(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_237(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_238(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_239(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_240(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_241(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_242(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_243(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_244(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_245(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_246(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_247(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_248(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_249(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_250(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_251(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_252(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_253(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_254(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_255(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_256(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y(1, BOOST_PP_NIL))
-# else
-# define BOOST_PP_NOT_EQUAL_0(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_1(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_2(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_3(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_4(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_5(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_6(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_7(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_8(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_9(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_10(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_11(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_12(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_13(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_14(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_15(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_16(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_17(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_18(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_19(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_20(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_21(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_22(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_23(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_24(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_25(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_26(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_27(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_28(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_29(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_30(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_31(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_32(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_33(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_34(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_35(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_36(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_37(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_38(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_39(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_40(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_41(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_42(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_43(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_44(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_45(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_46(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_47(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_48(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_49(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_50(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_51(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_52(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_53(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_54(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_55(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_56(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_57(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_58(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_59(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_60(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_61(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_62(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_63(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_64(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_65(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_66(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_67(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_68(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_69(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_70(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_71(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_72(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_73(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_74(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_75(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_76(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_77(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_78(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_79(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_80(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_81(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_82(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_83(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_84(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_85(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_86(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_87(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_88(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_89(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_90(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_91(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_92(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_93(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_94(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_95(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_96(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_97(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_98(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_99(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_100(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_101(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_102(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_103(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_104(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_105(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_106(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_107(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_108(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_109(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_110(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_111(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_112(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_113(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_114(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_115(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_116(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_117(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_118(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_119(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_120(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_121(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_122(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_123(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_124(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_125(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_126(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_127(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_128(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_129(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_130(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_131(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_132(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_133(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_134(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_135(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_136(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_137(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_138(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_139(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_140(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_141(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_142(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_143(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_144(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_145(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_146(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_147(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_148(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_149(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_150(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_151(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_152(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_153(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_154(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_155(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_156(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_157(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_158(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_159(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_160(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_161(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_162(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_163(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_164(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_165(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_166(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_167(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_168(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_169(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_170(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_171(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_172(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_173(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_174(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_175(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_176(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_177(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_178(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_179(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_180(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_181(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_182(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_183(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_184(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_185(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_186(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_187(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_188(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_189(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_190(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_191(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_192(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_193(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_194(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_195(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_196(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_197(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_198(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_199(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_200(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_201(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_202(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_203(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_204(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_205(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_206(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_207(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_208(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_209(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_210(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_211(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_212(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_213(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_214(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_215(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_216(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_217(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_218(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_219(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_220(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_221(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_222(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_223(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_224(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_225(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_226(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_227(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_228(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_229(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_230(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_231(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_232(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_233(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_234(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_235(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_236(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_237(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_238(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_239(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_240(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_241(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_242(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_243(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_244(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_245(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_246(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_247(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_248(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_249(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_250(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_251(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_252(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_253(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_254(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_255(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# define BOOST_PP_NOT_EQUAL_256(c, y) BOOST_PP_IIF(c, BOOST_PP_NIL, y##(1, BOOST_PP_NIL))
-# endif
-#
-# endif
diff --git a/ndnboost/preprocessor/control/deduce_d.hpp b/ndnboost/preprocessor/control/deduce_d.hpp
new file mode 100644
index 0000000..1aba271
--- /dev/null
+++ b/ndnboost/preprocessor/control/deduce_d.hpp
@@ -0,0 +1,22 @@
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * 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)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_CONTROL_DEDUCE_D_HPP
+# define BOOST_PREPROCESSOR_CONTROL_DEDUCE_D_HPP
+#
+# include <ndnboost/preprocessor/control/while.hpp>
+# include <ndnboost/preprocessor/detail/auto_rec.hpp>
+#
+# /* BOOST_PP_DEDUCE_D */
+#
+# define BOOST_PP_DEDUCE_D() BOOST_PP_AUTO_REC(BOOST_PP_WHILE_P, 256)
+#
+# endif
diff --git a/ndnboost/preprocessor/facilities/expand.hpp b/ndnboost/preprocessor/facilities/expand.hpp
deleted file mode 100644
index 6212830..0000000
--- a/ndnboost/preprocessor/facilities/expand.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-# /* Copyright (C) 2001
-# * Housemarque Oy
-# * http://www.housemarque.com
-# *
-# * 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)
-# */
-#
-# /* Revised by Paul Mensonides (2002) */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_FACILITIES_EXPAND_HPP
-# define BOOST_PREPROCESSOR_FACILITIES_EXPAND_HPP
-#
-# include <ndnboost/preprocessor/config/config.hpp>
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC() && ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_DMC()
-# define BOOST_PP_EXPAND(x) BOOST_PP_EXPAND_I(x)
-# else
-# define BOOST_PP_EXPAND(x) BOOST_PP_EXPAND_OO((x))
-# define BOOST_PP_EXPAND_OO(par) BOOST_PP_EXPAND_I ## par
-# endif
-#
-# define BOOST_PP_EXPAND_I(x) x
-#
-# endif
diff --git a/ndnboost/preprocessor/punctuation/paren_if.hpp b/ndnboost/preprocessor/punctuation/paren_if.hpp
deleted file mode 100644
index 1d1affd..0000000
--- a/ndnboost/preprocessor/punctuation/paren_if.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-# /* **************************************************************************
-# * *
-# * (C) Copyright Paul Mensonides 2002.
-# * 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)
-# * *
-# ************************************************************************** */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_PUNCTUATION_PAREN_IF_HPP
-# define BOOST_PREPROCESSOR_PUNCTUATION_PAREN_IF_HPP
-#
-# include <ndnboost/preprocessor/config/config.hpp>
-# include <ndnboost/preprocessor/control/if.hpp>
-# include <ndnboost/preprocessor/facilities/empty.hpp>
-# include <ndnboost/preprocessor/punctuation/paren.hpp>
-#
-# /* BOOST_PP_LPAREN_IF */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_LPAREN_IF(cond) BOOST_PP_IF(cond, BOOST_PP_LPAREN, BOOST_PP_EMPTY)()
-# else
-# define BOOST_PP_LPAREN_IF(cond) BOOST_PP_LPAREN_IF_I(cond)
-# define BOOST_PP_LPAREN_IF_I(cond) BOOST_PP_IF(cond, BOOST_PP_LPAREN, BOOST_PP_EMPTY)()
-# endif
-#
-# /* BOOST_PP_RPAREN_IF */
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_RPAREN_IF(cond) BOOST_PP_IF(cond, BOOST_PP_RPAREN, BOOST_PP_EMPTY)()
-# else
-# define BOOST_PP_RPAREN_IF(cond) BOOST_PP_RPAREN_IF_I(cond)
-# define BOOST_PP_RPAREN_IF_I(cond) BOOST_PP_IF(cond, BOOST_PP_RPAREN, BOOST_PP_EMPTY)()
-# endif
-#
-# endif
diff --git a/ndnboost/preprocessor/repeat_2nd.hpp b/ndnboost/preprocessor/repeat_2nd.hpp
new file mode 100644
index 0000000..0bd00b6
--- /dev/null
+++ b/ndnboost/preprocessor/repeat_2nd.hpp
@@ -0,0 +1,17 @@
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * 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)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_REPEAT_2ND_HPP
+# define BOOST_PREPROCESSOR_REPEAT_2ND_HPP
+#
+# include <ndnboost/preprocessor/repetition/repeat.hpp>
+#
+# endif
diff --git a/ndnboost/preprocessor/repetition/enum_shifted.hpp b/ndnboost/preprocessor/repetition/enum_shifted.hpp
deleted file mode 100644
index 6ff4218..0000000
--- a/ndnboost/preprocessor/repetition/enum_shifted.hpp
+++ /dev/null
@@ -1,68 +0,0 @@
-# /* Copyright (C) 2001
-# * Housemarque Oy
-# * http://www.housemarque.com
-# *
-# * 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)
-# */
-#
-# /* Revised by Paul Mensonides (2002) */
-#
-# /* See http://www.boost.org for most recent version. */
-#
-# ifndef BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_HPP
-# define BOOST_PREPROCESSOR_REPETITION_ENUM_SHIFTED_HPP
-#
-# include <ndnboost/preprocessor/cat.hpp>
-# include <ndnboost/preprocessor/arithmetic/dec.hpp>
-# include <ndnboost/preprocessor/arithmetic/inc.hpp>
-# include <ndnboost/preprocessor/config/config.hpp>
-# include <ndnboost/preprocessor/debug/error.hpp>
-# include <ndnboost/preprocessor/detail/auto_rec.hpp>
-# include <ndnboost/preprocessor/punctuation/comma_if.hpp>
-# include <ndnboost/preprocessor/repetition/repeat.hpp>
-# include <ndnboost/preprocessor/tuple/elem.hpp>
-# include <ndnboost/preprocessor/tuple/rem.hpp>
-#
-# /* BOOST_PP_ENUM_SHIFTED */
-#
-# if 0
-# define BOOST_PP_ENUM_SHIFTED(count, macro, data)
-# endif
-#
-# define BOOST_PP_ENUM_SHIFTED BOOST_PP_CAT(BOOST_PP_ENUM_SHIFTED_, BOOST_PP_AUTO_REC(BOOST_PP_REPEAT_P, 4))
-#
-# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
-# define BOOST_PP_ENUM_SHIFTED_1(c, m, d) BOOST_PP_REPEAT_1(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_1, (m, d))
-# define BOOST_PP_ENUM_SHIFTED_2(c, m, d) BOOST_PP_REPEAT_2(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_2, (m, d))
-# define BOOST_PP_ENUM_SHIFTED_3(c, m, d) BOOST_PP_REPEAT_3(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_3, (m, d))
-# else
-# define BOOST_PP_ENUM_SHIFTED_1(c, m, d) BOOST_PP_ENUM_SHIFTED_1_I(c, m, d)
-# define BOOST_PP_ENUM_SHIFTED_2(c, m, d) BOOST_PP_ENUM_SHIFTED_1_2(c, m, d)
-# define BOOST_PP_ENUM_SHIFTED_3(c, m, d) BOOST_PP_ENUM_SHIFTED_1_3(c, m, d)
-# define BOOST_PP_ENUM_SHIFTED_1_I(c, m, d) BOOST_PP_REPEAT_1(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_1, (m, d))
-# define BOOST_PP_ENUM_SHIFTED_2_I(c, m, d) BOOST_PP_REPEAT_2(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_2, (m, d))
-# define BOOST_PP_ENUM_SHIFTED_3_I(c, m, d) BOOST_PP_REPEAT_3(BOOST_PP_DEC(c), BOOST_PP_ENUM_SHIFTED_M_3, (m, d))
-# endif
-#
-# define BOOST_PP_ENUM_SHIFTED_4(c, m, d) BOOST_PP_ERROR(0x0003)
-#
-# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
-# define BOOST_PP_ENUM_SHIFTED_M_1(z, n, md) BOOST_PP_ENUM_SHIFTED_M_1_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
-# define BOOST_PP_ENUM_SHIFTED_M_2(z, n, md) BOOST_PP_ENUM_SHIFTED_M_2_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
-# define BOOST_PP_ENUM_SHIFTED_M_3(z, n, md) BOOST_PP_ENUM_SHIFTED_M_3_IM(z, n, BOOST_PP_TUPLE_REM_2 md)
-# define BOOST_PP_ENUM_SHIFTED_M_1_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_M_1_I(z, n, im)
-# define BOOST_PP_ENUM_SHIFTED_M_2_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_M_2_I(z, n, im)
-# define BOOST_PP_ENUM_SHIFTED_M_3_IM(z, n, im) BOOST_PP_ENUM_SHIFTED_M_3_I(z, n, im)
-# else
-# define BOOST_PP_ENUM_SHIFTED_M_1(z, n, md) BOOST_PP_ENUM_SHIFTED_M_1_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
-# define BOOST_PP_ENUM_SHIFTED_M_2(z, n, md) BOOST_PP_ENUM_SHIFTED_M_2_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
-# define BOOST_PP_ENUM_SHIFTED_M_3(z, n, md) BOOST_PP_ENUM_SHIFTED_M_3_I(z, n, BOOST_PP_TUPLE_ELEM(2, 0, md), BOOST_PP_TUPLE_ELEM(2, 1, md))
-# endif
-#
-# define BOOST_PP_ENUM_SHIFTED_M_1_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, BOOST_PP_INC(n), d)
-# define BOOST_PP_ENUM_SHIFTED_M_2_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, BOOST_PP_INC(n), d)
-# define BOOST_PP_ENUM_SHIFTED_M_3_I(z, n, m, d) BOOST_PP_COMMA_IF(n) m(z, BOOST_PP_INC(n), d)
-#
-# endif
diff --git a/ndnboost/preprocessor/seq/for_each.hpp b/ndnboost/preprocessor/seq/for_each.hpp
new file mode 100644
index 0000000..02a082a
--- /dev/null
+++ b/ndnboost/preprocessor/seq/for_each.hpp
@@ -0,0 +1,60 @@
+# /* **************************************************************************
+# * *
+# * (C) Copyright Paul Mensonides 2002.
+# * 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)
+# * *
+# ************************************************************************** */
+#
+# /* See http://www.boost.org for most recent version. */
+#
+# ifndef BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
+# define BOOST_PREPROCESSOR_SEQ_FOR_EACH_HPP
+#
+# include <ndnboost/preprocessor/arithmetic/dec.hpp>
+# include <ndnboost/preprocessor/config/config.hpp>
+# include <ndnboost/preprocessor/repetition/for.hpp>
+# include <ndnboost/preprocessor/seq/seq.hpp>
+# include <ndnboost/preprocessor/seq/size.hpp>
+# include <ndnboost/preprocessor/tuple/elem.hpp>
+# include <ndnboost/preprocessor/tuple/rem.hpp>
+#
+# /* BOOST_PP_SEQ_FOR_EACH */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
+# else
+# define BOOST_PP_SEQ_FOR_EACH(macro, data, seq) BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq)
+# define BOOST_PP_SEQ_FOR_EACH_D(macro, data, seq) BOOST_PP_FOR((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_P(r, x) BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_PP_TUPLE_ELEM(3, 2, x)))
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I x
+# else
+# define BOOST_PP_SEQ_FOR_EACH_O(r, x) BOOST_PP_SEQ_FOR_EACH_O_I(BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_O_I(macro, data, seq) (macro, data, BOOST_PP_SEQ_TAIL(seq))
+#
+# if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_STRICT()
+# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_IM(r, BOOST_PP_TUPLE_REM_3 x)
+# define BOOST_PP_SEQ_FOR_EACH_M_IM(r, im) BOOST_PP_SEQ_FOR_EACH_M_I(r, im)
+# else
+# define BOOST_PP_SEQ_FOR_EACH_M(r, x) BOOST_PP_SEQ_FOR_EACH_M_I(r, BOOST_PP_TUPLE_ELEM(3, 0, x), BOOST_PP_TUPLE_ELEM(3, 1, x), BOOST_PP_TUPLE_ELEM(3, 2, x))
+# endif
+#
+# define BOOST_PP_SEQ_FOR_EACH_M_I(r, macro, data, seq) macro(r, data, BOOST_PP_SEQ_HEAD(seq))
+#
+# /* BOOST_PP_SEQ_FOR_EACH_R */
+#
+# if ~BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_EDG()
+# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
+# else
+# define BOOST_PP_SEQ_FOR_EACH_R(r, macro, data, seq) BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq)
+# define BOOST_PP_SEQ_FOR_EACH_R_I(r, macro, data, seq) BOOST_PP_FOR_ ## r((macro, data, seq (nil)), BOOST_PP_SEQ_FOR_EACH_P, BOOST_PP_SEQ_FOR_EACH_O, BOOST_PP_SEQ_FOR_EACH_M)
+# endif
+#
+# endif
diff --git a/ndnboost/progress.hpp b/ndnboost/progress.hpp
new file mode 100644
index 0000000..6bd387f
--- /dev/null
+++ b/ndnboost/progress.hpp
@@ -0,0 +1,143 @@
+// boost progress.hpp header file ------------------------------------------//
+
+// Copyright Beman Dawes 1994-99. 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)
+
+// See http://www.boost.org/libs/timer for documentation.
+
+// Revision History
+// 1 Dec 01 Add leading progress display strings (suggested by Toon Knapen)
+// 20 May 01 Introduce several static_casts<> to eliminate warning messages
+// (Fixed by Beman, reported by Herve Bronnimann)
+// 12 Jan 01 Change to inline implementation to allow use without library
+// builds. See docs for more rationale. (Beman Dawes)
+// 22 Jul 99 Name changed to .hpp
+// 16 Jul 99 Second beta
+// 6 Jul 99 Initial boost version
+
+#ifndef BOOST_PROGRESS_HPP
+#define BOOST_PROGRESS_HPP
+
+#include <ndnboost/timer.hpp>
+#include <ndnboost/utility.hpp> // for noncopyable
+#include <ndnboost/cstdint.hpp> // for uintmax_t
+#include <iostream> // for ostream, cout, etc
+#include <string> // for string
+
+namespace ndnboost {
+
+// progress_timer ----------------------------------------------------------//
+
+// A progress_timer behaves like a timer except that the destructor displays
+// an elapsed time message at an appropriate place in an appropriate form.
+
+class progress_timer : public timer, private noncopyable
+{
+
+ public:
+ explicit progress_timer( std::ostream & os = std::cout )
+ // os is hint; implementation may ignore, particularly in embedded systems
+ : m_os(os) {}
+ ~progress_timer()
+ {
+ // A) Throwing an exception from a destructor is a Bad Thing.
+ // B) The progress_timer destructor does output which may throw.
+ // C) A progress_timer is usually not critical to the application.
+ // Therefore, wrap the I/O in a try block, catch and ignore all exceptions.
+ try
+ {
+ // use istream instead of ios_base to workaround GNU problem (Greg Chicares)
+ std::istream::fmtflags old_flags = m_os.setf( std::istream::fixed,
+ std::istream::floatfield );
+ std::streamsize old_prec = m_os.precision( 2 );
+ m_os << elapsed() << " s\n" // "s" is System International d'Unites std
+ << std::endl;
+ m_os.flags( old_flags );
+ m_os.precision( old_prec );
+ }
+
+ catch (...) {} // eat any exceptions
+ } // ~progress_timer
+
+ private:
+ std::ostream & m_os;
+};
+
+
+// progress_display --------------------------------------------------------//
+
+// progress_display displays an appropriate indication of
+// progress at an appropriate place in an appropriate form.
+
+// NOTE: (Jan 12, 2001) Tried to change unsigned long to ndnboost::uintmax_t, but
+// found some compilers couldn't handle the required conversion to double.
+// Reverted to unsigned long until the compilers catch up.
+
+class progress_display : private noncopyable
+{
+ public:
+ explicit progress_display( unsigned long expected_count,
+ std::ostream & os = std::cout,
+ const std::string & s1 = "\n", //leading strings
+ const std::string & s2 = "",
+ const std::string & s3 = "" )
+ // os is hint; implementation may ignore, particularly in embedded systems
+ : m_os(os), m_s1(s1), m_s2(s2), m_s3(s3) { restart(expected_count); }
+
+ void restart( unsigned long expected_count )
+ // Effects: display appropriate scale
+ // Postconditions: count()==0, expected_count()==expected_count
+ {
+ _count = _next_tic_count = _tic = 0;
+ _expected_count = expected_count;
+
+ m_os << m_s1 << "0% 10 20 30 40 50 60 70 80 90 100%\n"
+ << m_s2 << "|----|----|----|----|----|----|----|----|----|----|"
+ << std::endl // endl implies flush, which ensures display
+ << m_s3;
+ if ( !_expected_count ) _expected_count = 1; // prevent divide by zero
+ } // restart
+
+ unsigned long operator+=( unsigned long increment )
+ // Effects: Display appropriate progress tic if needed.
+ // Postconditions: count()== original count() + increment
+ // Returns: count().
+ {
+ if ( (_count += increment) >= _next_tic_count ) { display_tic(); }
+ return _count;
+ }
+
+ unsigned long operator++() { return operator+=( 1 ); }
+ unsigned long count() const { return _count; }
+ unsigned long expected_count() const { return _expected_count; }
+
+ private:
+ std::ostream & m_os; // may not be present in all imps
+ const std::string m_s1; // string is more general, safer than
+ const std::string m_s2; // const char *, and efficiency or size are
+ const std::string m_s3; // not issues
+
+ unsigned long _count, _expected_count, _next_tic_count;
+ unsigned int _tic;
+ void display_tic()
+ {
+ // use of floating point ensures that both large and small counts
+ // work correctly. static_cast<>() is also used several places
+ // to suppress spurious compiler warnings.
+ unsigned int tics_needed =
+ static_cast<unsigned int>(
+ (static_cast<double>(_count)/_expected_count)*50.0 );
+ do { m_os << '*' << std::flush; } while ( ++_tic < tics_needed );
+ _next_tic_count =
+ static_cast<unsigned long>((_tic/50.0)*_expected_count);
+ if ( _count == _expected_count ) {
+ if ( _tic < 51 ) m_os << '*';
+ m_os << std::endl;
+ }
+ } // display_tic
+};
+
+} // namespace ndnboost
+
+#endif // BOOST_PROGRESS_HPP
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
diff --git a/ndnboost/scoped_array.hpp b/ndnboost/scoped_array.hpp
new file mode 100644
index 0000000..260b52d
--- /dev/null
+++ b/ndnboost/scoped_array.hpp
@@ -0,0 +1,16 @@
+#ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
+#define BOOST_SCOPED_ARRAY_HPP_INCLUDED
+
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// http://www.boost.org/libs/smart_ptr/scoped_array.htm
+//
+
+#include <ndnboost/smart_ptr/scoped_array.hpp>
+
+#endif // #ifndef BOOST_SCOPED_ARRAY_HPP_INCLUDED
diff --git a/ndnboost/scoped_ptr.hpp b/ndnboost/scoped_ptr.hpp
new file mode 100644
index 0000000..c2178d1
--- /dev/null
+++ b/ndnboost/scoped_ptr.hpp
@@ -0,0 +1,16 @@
+#ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
+#define BOOST_SCOPED_PTR_HPP_INCLUDED
+
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// http://www.boost.org/libs/smart_ptr/scoped_ptr.htm
+//
+
+#include <ndnboost/smart_ptr/scoped_ptr.hpp>
+
+#endif // #ifndef BOOST_SCOPED_PTR_HPP_INCLUDED
diff --git a/ndnboost/shared_array.hpp b/ndnboost/shared_array.hpp
new file mode 100644
index 0000000..3da084d
--- /dev/null
+++ b/ndnboost/shared_array.hpp
@@ -0,0 +1,19 @@
+#ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
+#define BOOST_SHARED_ARRAY_HPP_INCLUDED
+
+//
+// shared_array.hpp
+//
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
+//
+
+#include <ndnboost/smart_ptr/shared_array.hpp>
+
+#endif // #ifndef BOOST_SHARED_ARRAY_HPP_INCLUDED
diff --git a/ndnboost/smart_ptr/detail/shared_array_nmt.hpp b/ndnboost/smart_ptr/detail/shared_array_nmt.hpp
new file mode 100644
index 0000000..4d53afa
--- /dev/null
+++ b/ndnboost/smart_ptr/detail/shared_array_nmt.hpp
@@ -0,0 +1,151 @@
+#ifndef BOOST_SMART_PTR_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED
+#define BOOST_SMART_PTR_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED
+
+//
+// detail/shared_array_nmt.hpp - shared_array.hpp without member templates
+//
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
+//
+
+#include <ndnboost/assert.hpp>
+#include <ndnboost/checked_delete.hpp>
+#include <ndnboost/throw_exception.hpp>
+#include <ndnboost/smart_ptr/detail/atomic_count.hpp>
+
+#include <cstddef> // for std::ptrdiff_t
+#include <algorithm> // for std::swap
+#include <functional> // for std::less
+#include <new> // for std::bad_alloc
+
+namespace ndnboost
+{
+
+template<class T> class shared_array
+{
+private:
+
+ typedef detail::atomic_count count_type;
+
+public:
+
+ typedef T element_type;
+
+ explicit shared_array(T * p = 0): px(p)
+ {
+#ifndef BOOST_NO_EXCEPTIONS
+
+ try // prevent leak if new throws
+ {
+ pn = new count_type(1);
+ }
+ catch(...)
+ {
+ ndnboost::checked_array_delete(p);
+ throw;
+ }
+
+#else
+
+ pn = new count_type(1);
+
+ if(pn == 0)
+ {
+ ndnboost::checked_array_delete(p);
+ ndnboost::throw_exception(std::bad_alloc());
+ }
+
+#endif
+ }
+
+ ~shared_array()
+ {
+ if(--*pn == 0)
+ {
+ ndnboost::checked_array_delete(px);
+ delete pn;
+ }
+ }
+
+ shared_array(shared_array const & r) : px(r.px) // never throws
+ {
+ pn = r.pn;
+ ++*pn;
+ }
+
+ shared_array & operator=(shared_array const & r)
+ {
+ shared_array(r).swap(*this);
+ return *this;
+ }
+
+ void reset(T * p = 0)
+ {
+ BOOST_ASSERT(p == 0 || p != px);
+ shared_array(p).swap(*this);
+ }
+
+ T * get() const // never throws
+ {
+ return px;
+ }
+
+ T & operator[](std::ptrdiff_t i) const // never throws
+ {
+ BOOST_ASSERT(px != 0);
+ BOOST_ASSERT(i >= 0);
+ return px[i];
+ }
+
+ long use_count() const // never throws
+ {
+ return *pn;
+ }
+
+ bool unique() const // never throws
+ {
+ return *pn == 1;
+ }
+
+ void swap(shared_array<T> & other) // never throws
+ {
+ std::swap(px, other.px);
+ std::swap(pn, other.pn);
+ }
+
+private:
+
+ T * px; // contained pointer
+ count_type * pn; // ptr to reference counter
+
+}; // shared_array
+
+template<class T, class U> inline bool operator==(shared_array<T> const & a, shared_array<U> const & b)
+{
+ return a.get() == b.get();
+}
+
+template<class T, class U> inline bool operator!=(shared_array<T> const & a, shared_array<U> const & b)
+{
+ return a.get() != b.get();
+}
+
+template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b)
+{
+ return std::less<T*>()(a.get(), b.get());
+}
+
+template<class T> void swap(shared_array<T> & a, shared_array<T> & b)
+{
+ a.swap(b);
+}
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_SMART_PTR_DETAIL_SHARED_ARRAY_NMT_HPP_INCLUDED
diff --git a/ndnboost/smart_ptr/scoped_array.hpp b/ndnboost/smart_ptr/scoped_array.hpp
new file mode 100644
index 0000000..7584d27
--- /dev/null
+++ b/ndnboost/smart_ptr/scoped_array.hpp
@@ -0,0 +1,132 @@
+#ifndef BOOST_SMART_PTR_SCOPED_ARRAY_HPP_INCLUDED
+#define BOOST_SMART_PTR_SCOPED_ARRAY_HPP_INCLUDED
+
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// http://www.boost.org/libs/smart_ptr/scoped_array.htm
+//
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/assert.hpp>
+#include <ndnboost/checked_delete.hpp>
+#include <ndnboost/smart_ptr/detail/sp_nullptr_t.hpp>
+
+#include <ndnboost/detail/workaround.hpp>
+
+#include <cstddef> // for std::ptrdiff_t
+
+namespace ndnboost
+{
+
+// Debug hooks
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+
+void sp_array_constructor_hook(void * p);
+void sp_array_destructor_hook(void * p);
+
+#endif
+
+// scoped_array extends scoped_ptr to arrays. Deletion of the array pointed to
+// is guaranteed, either on destruction of the scoped_array or via an explicit
+// reset(). Use shared_array or std::vector if your needs are more complex.
+
+template<class T> class scoped_array // noncopyable
+{
+private:
+
+ T * px;
+
+ scoped_array(scoped_array const &);
+ scoped_array & operator=(scoped_array const &);
+
+ typedef scoped_array<T> this_type;
+
+ void operator==( scoped_array const& ) const;
+ void operator!=( scoped_array const& ) const;
+
+public:
+
+ typedef T element_type;
+
+ explicit scoped_array( T * p = 0 ) BOOST_NOEXCEPT : px( p )
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ ndnboost::sp_array_constructor_hook( px );
+#endif
+ }
+
+ ~scoped_array() // never throws
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ ndnboost::sp_array_destructor_hook( px );
+#endif
+ ndnboost::checked_array_delete( px );
+ }
+
+ void reset(T * p = 0) // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
+ {
+ BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
+ this_type(p).swap(*this);
+ }
+
+ T & operator[](std::ptrdiff_t i) const // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
+ {
+ BOOST_ASSERT( px != 0 );
+ BOOST_ASSERT( i >= 0 );
+ return px[i];
+ }
+
+ T * get() const BOOST_NOEXCEPT
+ {
+ return px;
+ }
+
+// implicit conversion to "bool"
+#include <ndnboost/smart_ptr/detail/operator_bool.hpp>
+
+ void swap(scoped_array & b) BOOST_NOEXCEPT
+ {
+ T * tmp = b.px;
+ b.px = px;
+ px = tmp;
+ }
+};
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+template<class T> inline bool operator==( scoped_array<T> const & p, ndnboost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
+{
+ return p.get() == 0;
+}
+
+template<class T> inline bool operator==( ndnboost::detail::sp_nullptr_t, scoped_array<T> const & p ) BOOST_NOEXCEPT
+{
+ return p.get() == 0;
+}
+
+template<class T> inline bool operator!=( scoped_array<T> const & p, ndnboost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
+{
+ return p.get() != 0;
+}
+
+template<class T> inline bool operator!=( ndnboost::detail::sp_nullptr_t, scoped_array<T> const & p ) BOOST_NOEXCEPT
+{
+ return p.get() != 0;
+}
+
+#endif
+
+template<class T> inline void swap(scoped_array<T> & a, scoped_array<T> & b) BOOST_NOEXCEPT
+{
+ a.swap(b);
+}
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_SMART_PTR_SCOPED_ARRAY_HPP_INCLUDED
diff --git a/ndnboost/smart_ptr/scoped_ptr.hpp b/ndnboost/smart_ptr/scoped_ptr.hpp
new file mode 100644
index 0000000..7ee252b
--- /dev/null
+++ b/ndnboost/smart_ptr/scoped_ptr.hpp
@@ -0,0 +1,157 @@
+#ifndef BOOST_SMART_PTR_SCOPED_PTR_HPP_INCLUDED
+#define BOOST_SMART_PTR_SCOPED_PTR_HPP_INCLUDED
+
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002 Peter Dimov
+//
+// 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)
+//
+// http://www.boost.org/libs/smart_ptr/scoped_ptr.htm
+//
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/assert.hpp>
+#include <ndnboost/checked_delete.hpp>
+#include <ndnboost/smart_ptr/detail/sp_nullptr_t.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#ifndef BOOST_NO_AUTO_PTR
+# include <memory> // for std::auto_ptr
+#endif
+
+namespace ndnboost
+{
+
+// Debug hooks
+
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+
+void sp_scalar_constructor_hook(void * p);
+void sp_scalar_destructor_hook(void * p);
+
+#endif
+
+// scoped_ptr mimics a built-in pointer except that it guarantees deletion
+// of the object pointed to, either on destruction of the scoped_ptr or via
+// an explicit reset(). scoped_ptr is a simple solution for simple needs;
+// use shared_ptr or std::auto_ptr if your needs are more complex.
+
+template<class T> class scoped_ptr // noncopyable
+{
+private:
+
+ T * px;
+
+ scoped_ptr(scoped_ptr const &);
+ scoped_ptr & operator=(scoped_ptr const &);
+
+ typedef scoped_ptr<T> this_type;
+
+ void operator==( scoped_ptr const& ) const;
+ void operator!=( scoped_ptr const& ) const;
+
+public:
+
+ typedef T element_type;
+
+ explicit scoped_ptr( T * p = 0 ): px( p ) // never throws
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ ndnboost::sp_scalar_constructor_hook( px );
+#endif
+ }
+
+#ifndef BOOST_NO_AUTO_PTR
+
+ explicit scoped_ptr( std::auto_ptr<T> p ) BOOST_NOEXCEPT : px( p.release() )
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ ndnboost::sp_scalar_constructor_hook( px );
+#endif
+ }
+
+#endif
+
+ ~scoped_ptr() // never throws
+ {
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+ ndnboost::sp_scalar_destructor_hook( px );
+#endif
+ ndnboost::checked_delete( px );
+ }
+
+ void reset(T * p = 0) // never throws
+ {
+ BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
+ this_type(p).swap(*this);
+ }
+
+ T & operator*() const // never throws
+ {
+ BOOST_ASSERT( px != 0 );
+ return *px;
+ }
+
+ T * operator->() const // never throws
+ {
+ BOOST_ASSERT( px != 0 );
+ return px;
+ }
+
+ T * get() const BOOST_NOEXCEPT
+ {
+ return px;
+ }
+
+// implicit conversion to "bool"
+#include <ndnboost/smart_ptr/detail/operator_bool.hpp>
+
+ void swap(scoped_ptr & b) BOOST_NOEXCEPT
+ {
+ T * tmp = b.px;
+ b.px = px;
+ px = tmp;
+ }
+};
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+template<class T> inline bool operator==( scoped_ptr<T> const & p, ndnboost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
+{
+ return p.get() == 0;
+}
+
+template<class T> inline bool operator==( ndnboost::detail::sp_nullptr_t, scoped_ptr<T> const & p ) BOOST_NOEXCEPT
+{
+ return p.get() == 0;
+}
+
+template<class T> inline bool operator!=( scoped_ptr<T> const & p, ndnboost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
+{
+ return p.get() != 0;
+}
+
+template<class T> inline bool operator!=( ndnboost::detail::sp_nullptr_t, scoped_ptr<T> const & p ) BOOST_NOEXCEPT
+{
+ return p.get() != 0;
+}
+
+#endif
+
+template<class T> inline void swap(scoped_ptr<T> & a, scoped_ptr<T> & b) BOOST_NOEXCEPT
+{
+ a.swap(b);
+}
+
+// get_pointer(p) is a generic way to say p.get()
+
+template<class T> inline T * get_pointer(scoped_ptr<T> const & p) BOOST_NOEXCEPT
+{
+ return p.get();
+}
+
+} // namespace ndnboost
+
+#endif // #ifndef BOOST_SMART_PTR_SCOPED_PTR_HPP_INCLUDED
diff --git a/ndnboost/smart_ptr/shared_array.hpp b/ndnboost/smart_ptr/shared_array.hpp
new file mode 100644
index 0000000..e5626f7
--- /dev/null
+++ b/ndnboost/smart_ptr/shared_array.hpp
@@ -0,0 +1,290 @@
+#ifndef BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
+#define BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
+
+//
+// shared_array.hpp
+//
+// (C) Copyright Greg Colvin and Beman Dawes 1998, 1999.
+// Copyright (c) 2001, 2002, 2012 Peter Dimov
+//
+// 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)
+//
+// See http://www.boost.org/libs/smart_ptr/shared_array.htm for documentation.
+//
+
+#include <ndnboost/config.hpp> // for broken compiler workarounds
+
+#if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+#include <ndnboost/smart_ptr/detail/shared_array_nmt.hpp>
+#else
+
+#include <memory> // TR1 cyclic inclusion fix
+
+#include <ndnboost/assert.hpp>
+#include <ndnboost/checked_delete.hpp>
+
+#include <ndnboost/smart_ptr/shared_ptr.hpp>
+#include <ndnboost/smart_ptr/detail/shared_count.hpp>
+#include <ndnboost/smart_ptr/detail/sp_nullptr_t.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#include <cstddef> // for std::ptrdiff_t
+#include <algorithm> // for std::swap
+#include <functional> // for std::less
+
+namespace ndnboost
+{
+
+//
+// shared_array
+//
+// shared_array extends shared_ptr to arrays.
+// The array pointed to is deleted when the last shared_array pointing to it
+// is destroyed or reset.
+//
+
+template<class T> class shared_array
+{
+private:
+
+ // Borland 5.5.1 specific workarounds
+ typedef checked_array_deleter<T> deleter;
+ typedef shared_array<T> this_type;
+
+public:
+
+ typedef T element_type;
+
+ shared_array() BOOST_NOEXCEPT : px( 0 ), pn()
+ {
+ }
+
+ template<class Y>
+ explicit shared_array( Y * p ): px( p ), pn( p, checked_array_deleter<Y>() )
+ {
+ ndnboost::detail::sp_assert_convertible< Y[], T[] >();
+ }
+
+ //
+ // Requirements: D's copy constructor must not throw
+ //
+ // shared_array will release p by calling d(p)
+ //
+
+ template<class Y, class D> shared_array( Y * p, D d ): px( p ), pn( p, d )
+ {
+ ndnboost::detail::sp_assert_convertible< Y[], T[] >();
+ }
+
+ // As above, but with allocator. A's copy constructor shall not throw.
+
+ template<class Y, class D, class A> shared_array( Y * p, D d, A a ): px( p ), pn( p, d, a )
+ {
+ ndnboost::detail::sp_assert_convertible< Y[], T[] >();
+ }
+
+// generated copy constructor, destructor are fine...
+
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+// ... except in C++0x, move disables the implicit copy
+
+ shared_array( shared_array const & r ) BOOST_NOEXCEPT : px( r.px ), pn( r.pn )
+ {
+ }
+
+ shared_array( shared_array && r ) BOOST_NOEXCEPT : px( r.px ), pn()
+ {
+ pn.swap( r.pn );
+ r.px = 0;
+ }
+
+#endif
+
+ // conversion
+
+ template<class Y>
+#if !defined( BOOST_SP_NO_SP_CONVERTIBLE )
+
+ shared_array( shared_array<Y> const & r, typename ndnboost::detail::sp_enable_if_convertible< Y[], T[] >::type = ndnboost::detail::sp_empty() )
+
+#else
+
+ shared_array( shared_array<Y> const & r )
+
+#endif
+ BOOST_NOEXCEPT : px( r.px ), pn( r.pn ) // never throws
+ {
+ ndnboost::detail::sp_assert_convertible< Y[], T[] >();
+ }
+
+ // aliasing
+
+ template< class Y >
+ shared_array( shared_array<Y> const & r, element_type * p ) BOOST_NOEXCEPT : px( p ), pn( r.pn )
+ {
+ }
+
+ // assignment
+
+ shared_array & operator=( shared_array const & r ) BOOST_NOEXCEPT
+ {
+ this_type( r ).swap( *this );
+ return *this;
+ }
+
+#if !defined(BOOST_MSVC) || (BOOST_MSVC >= 1400)
+
+ template<class Y>
+ shared_array & operator=( shared_array<Y> const & r ) BOOST_NOEXCEPT
+ {
+ this_type( r ).swap( *this );
+ return *this;
+ }
+
+#endif
+
+#if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
+
+ shared_array & operator=( shared_array && r ) BOOST_NOEXCEPT
+ {
+ this_type( static_cast< shared_array && >( r ) ).swap( *this );
+ return *this;
+ }
+
+ template<class Y>
+ shared_array & operator=( shared_array<Y> && r ) BOOST_NOEXCEPT
+ {
+ this_type( static_cast< shared_array<Y> && >( r ) ).swap( *this );
+ return *this;
+ }
+
+#endif
+
+ void reset() BOOST_NOEXCEPT
+ {
+ this_type().swap( *this );
+ }
+
+ template<class Y> void reset( Y * p ) // Y must be complete
+ {
+ BOOST_ASSERT( p == 0 || p != px ); // catch self-reset errors
+ this_type( p ).swap( *this );
+ }
+
+ template<class Y, class D> void reset( Y * p, D d )
+ {
+ this_type( p, d ).swap( *this );
+ }
+
+ template<class Y, class D, class A> void reset( Y * p, D d, A a )
+ {
+ this_type( p, d, a ).swap( *this );
+ }
+
+ template<class Y> void reset( shared_array<Y> const & r, element_type * p )
+ {
+ this_type( r, p ).swap( *this );
+ }
+
+ T & operator[] (std::ptrdiff_t i) const // never throws (but has a BOOST_ASSERT in it, so not marked with BOOST_NOEXCEPT)
+ {
+ BOOST_ASSERT(px != 0);
+ BOOST_ASSERT(i >= 0);
+ return px[i];
+ }
+
+ T * get() const BOOST_NOEXCEPT
+ {
+ return px;
+ }
+
+// implicit conversion to "bool"
+#include <ndnboost/smart_ptr/detail/operator_bool.hpp>
+
+ bool unique() const BOOST_NOEXCEPT
+ {
+ return pn.unique();
+ }
+
+ long use_count() const BOOST_NOEXCEPT
+ {
+ return pn.use_count();
+ }
+
+ void swap(shared_array<T> & other) BOOST_NOEXCEPT
+ {
+ std::swap(px, other.px);
+ pn.swap(other.pn);
+ }
+
+ void * _internal_get_deleter( ndnboost::detail::sp_typeinfo const & ti ) const
+ {
+ return pn.get_deleter( ti );
+ }
+
+private:
+
+ template<class Y> friend class shared_array;
+
+ T * px; // contained pointer
+ detail::shared_count pn; // reference counter
+
+}; // shared_array
+
+template<class T> inline bool operator==(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
+{
+ return a.get() == b.get();
+}
+
+template<class T> inline bool operator!=(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
+{
+ return a.get() != b.get();
+}
+
+#if !defined( BOOST_NO_CXX11_NULLPTR )
+
+template<class T> inline bool operator==( shared_array<T> const & p, ndnboost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
+{
+ return p.get() == 0;
+}
+
+template<class T> inline bool operator==( ndnboost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
+{
+ return p.get() == 0;
+}
+
+template<class T> inline bool operator!=( shared_array<T> const & p, ndnboost::detail::sp_nullptr_t ) BOOST_NOEXCEPT
+{
+ return p.get() != 0;
+}
+
+template<class T> inline bool operator!=( ndnboost::detail::sp_nullptr_t, shared_array<T> const & p ) BOOST_NOEXCEPT
+{
+ return p.get() != 0;
+}
+
+#endif
+
+template<class T> inline bool operator<(shared_array<T> const & a, shared_array<T> const & b) BOOST_NOEXCEPT
+{
+ return std::less<T*>()(a.get(), b.get());
+}
+
+template<class T> void swap(shared_array<T> & a, shared_array<T> & b) BOOST_NOEXCEPT
+{
+ a.swap(b);
+}
+
+template< class D, class T > D * get_deleter( shared_array<T> const & p )
+{
+ return static_cast< D * >( p._internal_get_deleter( BOOST_SP_TYPEID(D) ) );
+}
+
+} // namespace ndnboost
+
+#endif // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
+
+#endif // #ifndef BOOST_SMART_PTR_SHARED_ARRAY_HPP_INCLUDED
diff --git a/ndnboost/test/debug.hpp b/ndnboost/test/debug.hpp
new file mode 100644
index 0000000..30d5d30
--- /dev/null
+++ b/ndnboost/test/debug.hpp
@@ -0,0 +1,101 @@
+// (C) Copyright Gennadiy Rozental 2006-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines portable debug interfaces
+// ***************************************************************************
+
+#ifndef BOOST_TEST_DEBUG_API_HPP_112006GER
+#define BOOST_TEST_DEBUG_API_HPP_112006GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/utils/callback.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+
+// STL
+#include <string>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace debug {
+
+// ************************************************************************** //
+// ************** check if program is running under debugger ************** //
+// ************************************************************************** //
+
+bool BOOST_TEST_DECL under_debugger();
+
+// ************************************************************************** //
+// ************** cause program to break execution ************** //
+// ************** in debugger at call point ************** //
+// ************************************************************************** //
+
+void BOOST_TEST_DECL debugger_break();
+
+// ************************************************************************** //
+// ************** gui debugger setup ************** //
+// ************************************************************************** //
+
+struct dbg_startup_info {
+ long pid;
+ bool break_or_continue;
+ unit_test::const_string binary_path;
+ unit_test::const_string display;
+ unit_test::const_string init_done_lock;
+};
+
+typedef unit_test::callback1<dbg_startup_info const&> dbg_starter;
+
+// ************************************************************************** //
+// ************** debugger setup ************** //
+// ************************************************************************** //
+
+#if BOOST_WORKAROUND( BOOST_MSVC, <1300)
+
+std::string BOOST_TEST_DECL set_debugger( unit_test::const_string dbg_id );
+
+#else
+
+std::string BOOST_TEST_DECL set_debugger( unit_test::const_string dbg_id, dbg_starter s = dbg_starter() );
+
+#endif
+
+
+// ************************************************************************** //
+// ************** attach debugger to the current process ************** //
+// ************************************************************************** //
+
+bool BOOST_TEST_DECL attach_debugger( bool break_or_continue = true );
+
+// ************************************************************************** //
+// ************** switch on/off detect memory leaks feature ************** //
+// ************************************************************************** //
+
+void BOOST_TEST_DECL detect_memory_leaks( bool on_off );
+
+// ************************************************************************** //
+// ************** cause program to break execution in ************** //
+// ************** debugger at specific allocation point ************** //
+// ************************************************************************** //
+
+void BOOST_TEST_DECL break_memory_alloc( long mem_alloc_order_num );
+
+} // namespace debug
+
+} // namespace ndnboost
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif
diff --git a/ndnboost/test/debug_config.hpp b/ndnboost/test/debug_config.hpp
new file mode 100644
index 0000000..54c21e9
--- /dev/null
+++ b/ndnboost/test/debug_config.hpp
@@ -0,0 +1,24 @@
+// (C) Copyright Gennadiy Rozental 2006-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : user's config for Boost.Test debugging support
+// ***************************************************************************
+
+#ifndef BOOST_TEST_DEBUG_CONFIG_HPP_112006GER
+#define BOOST_TEST_DEBUG_CONFIG_HPP_112006GER
+
+// ';' separated list of supported debuggers
+// #define BOOST_TEST_DBG_LIST gdb;dbx
+
+// maximum size of /proc/pid/stat file
+// #define BOOST_TEST_STAT_LINE_MAX
+
+#endif
diff --git a/ndnboost/test/detail/config.hpp b/ndnboost/test/detail/config.hpp
new file mode 100644
index 0000000..1b6ae68
--- /dev/null
+++ b/ndnboost/test/detail/config.hpp
@@ -0,0 +1,104 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 63441 $
+//
+// Description : as a central place for global configuration switches
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CONFIG_HPP_071894GER
+#define BOOST_TEST_CONFIG_HPP_071894GER
+
+// Boost
+#include <ndnboost/config.hpp> // compilers workarounds
+#include <ndnboost/detail/workaround.hpp>
+
+//____________________________________________________________________________//
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) || \
+ BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \
+ (defined __sgi && BOOST_WORKAROUND(_COMPILER_VERSION, BOOST_TESTED_AT(730)))
+# define BOOST_TEST_SHIFTED_LINE
+#endif
+
+//____________________________________________________________________________//
+
+#if defined(BOOST_MSVC) || (defined(__BORLANDC__) && !defined(BOOST_DISABLE_WIN32))
+# define BOOST_TEST_CALL_DECL __cdecl
+#else
+# define BOOST_TEST_CALL_DECL /**/
+#endif
+
+//____________________________________________________________________________//
+
+#if !defined(BOOST_NO_STD_LOCALE) && \
+ !BOOST_WORKAROUND(BOOST_MSVC, < 1310) && \
+ !defined(__MWERKS__)
+# define BOOST_TEST_USE_STD_LOCALE 1
+#endif
+
+//____________________________________________________________________________//
+
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x570) || \
+ BOOST_WORKAROUND( __COMO__, <= 0x433 ) || \
+ BOOST_WORKAROUND( __INTEL_COMPILER, <= 800 ) || \
+ defined(__sgi) && _COMPILER_VERSION <= 730 || \
+ BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) || \
+ defined(__DECCXX) || \
+ defined(__DMC__)
+# define BOOST_TEST_NO_PROTECTED_USING
+#endif
+
+//____________________________________________________________________________//
+
+#if defined(__GNUC__) || BOOST_WORKAROUND(BOOST_MSVC, == 1400)
+#define BOOST_TEST_PROTECTED_VIRTUAL virtual
+#else
+#define BOOST_TEST_PROTECTED_VIRTUAL
+#endif
+
+//____________________________________________________________________________//
+
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) && \
+ !BOOST_WORKAROUND(BOOST_MSVC, <1310) && \
+ !BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x530))
+# define BOOST_TEST_SUPPORT_INTERACTION_TESTING 1
+#endif
+
+//____________________________________________________________________________//
+
+#if defined(BOOST_ALL_DYN_LINK) && !defined(BOOST_TEST_DYN_LINK)
+# define BOOST_TEST_DYN_LINK
+#endif
+
+#if defined(BOOST_TEST_INCLUDED)
+# undef BOOST_TEST_DYN_LINK
+#endif
+
+#if defined(BOOST_TEST_DYN_LINK)
+# define BOOST_TEST_ALTERNATIVE_INIT_API
+
+# ifdef BOOST_TEST_SOURCE
+# define BOOST_TEST_DECL BOOST_SYMBOL_EXPORT
+# else
+# define BOOST_TEST_DECL BOOST_SYMBOL_IMPORT
+# endif // BOOST_TEST_SOURCE
+#else
+# define BOOST_TEST_DECL
+#endif
+
+#if !defined(BOOST_TEST_MAIN) && defined(BOOST_AUTO_TEST_MAIN)
+#define BOOST_TEST_MAIN BOOST_AUTO_TEST_MAIN
+#endif
+
+#if !defined(BOOST_TEST_MAIN) && defined(BOOST_TEST_MODULE)
+#define BOOST_TEST_MAIN BOOST_TEST_MODULE
+#endif
+
+#endif // BOOST_TEST_CONFIG_HPP_071894GER
diff --git a/ndnboost/test/detail/enable_warnings.hpp b/ndnboost/test/detail/enable_warnings.hpp
new file mode 100644
index 0000000..2d67fb0
--- /dev/null
+++ b/ndnboost/test/detail/enable_warnings.hpp
@@ -0,0 +1,30 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : enable previosly suppressed warnings
+// ***************************************************************************
+
+#ifdef BOOST_MSVC
+# pragma warning(default: 4511) // copy constructor can't not be generated
+# pragma warning(default: 4512) // assignment operator can't not be generated
+# pragma warning(default: 4100) // unreferenced formal parameter
+# pragma warning(default: 4996) // <symbol> was declared deprecated
+# pragma warning(default: 4355) // 'this' : used in base member initializer list
+# pragma warning(default: 4706) // assignment within conditional expression
+# pragma warning(default: 4251) // class 'A<T>' needs to have dll-interface to be used by clients of class 'B'
+# pragma warning(default: 4127) // conditional expression is constant
+# pragma warning(default: 4290) // C++ exception specification ignored except to ...
+# pragma warning(default: 4180) // qualifier applied to function type has no meaning; ignored
+# pragma warning(default: 4275) // non dll-interface class ... used as base for dll-interface class ...
+# pragma warning(default: 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data
+# pragma warning(default: 4511) // 'class' : copy constructor could not be generated
+# pragma warning(pop)
+#endif
diff --git a/ndnboost/test/detail/fwd_decl.hpp b/ndnboost/test/detail/fwd_decl.hpp
new file mode 100644
index 0000000..b8d2a87
--- /dev/null
+++ b/ndnboost/test/detail/fwd_decl.hpp
@@ -0,0 +1,48 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : contains forward eclarations for Boost.Test data types
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FWD_DECL_HPP_011605GER
+#define BOOST_TEST_FWD_DECL_HPP_011605GER
+
+namespace ndnboost {
+
+class execution_monitor;
+class execution_exception;
+
+namespace unit_test {
+
+class test_unit;
+class test_case;
+class test_suite;
+class master_test_suite_t;
+
+class test_tree_visitor;
+class test_observer;
+
+// singletons
+class unit_test_monitor_t;
+class unit_test_log_t;
+
+class unit_test_log_formatter;
+struct log_entry_data;
+struct log_checkpoint_data;
+
+class lazy_ostream;
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#endif // BOOST_TEST_FWD_DECL_HPP_011605GER
+
diff --git a/ndnboost/test/detail/global_typedef.hpp b/ndnboost/test/detail/global_typedef.hpp
new file mode 100644
index 0000000..e87327a
--- /dev/null
+++ b/ndnboost/test/detail/global_typedef.hpp
@@ -0,0 +1,88 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : some trivial global typedefs
+// ***************************************************************************
+
+#ifndef BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER
+#define BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER
+
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#define BOOST_TEST_L( s ) ndnboost::unit_test::const_string( s, sizeof( s ) - 1 )
+#define BOOST_TEST_STRINGIZE( s ) BOOST_TEST_L( BOOST_STRINGIZE( s ) )
+#define BOOST_TEST_EMPTY_STRING BOOST_TEST_L( "" )
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+typedef unsigned long counter_t;
+
+//____________________________________________________________________________//
+
+enum report_level { INV_REPORT_LEVEL, CONFIRMATION_REPORT, SHORT_REPORT, DETAILED_REPORT, NO_REPORT };
+
+//____________________________________________________________________________//
+
+enum output_format { INV_OF, CLF /* compiler log format */, XML /* XML */ };
+
+//____________________________________________________________________________//
+
+enum test_unit_type { tut_case = 0x01, tut_suite = 0x10, tut_any = 0x11 };
+
+//____________________________________________________________________________//
+
+typedef unsigned long test_unit_id;
+
+const test_unit_id INV_TEST_UNIT_ID = 0xFFFFFFFF;
+const test_unit_id MAX_TEST_CASE_ID = 0xFFFFFFFE;
+const test_unit_id MIN_TEST_CASE_ID = 0x00010000;
+const test_unit_id MAX_TEST_SUITE_ID = 0x0000FF00;
+const test_unit_id MIN_TEST_SUITE_ID = 0x00000001;
+
+//____________________________________________________________________________//
+
+namespace ut_detail {
+
+inline test_unit_type
+test_id_2_unit_type( test_unit_id id )
+{
+ return (id & 0xFFFF0000) != 0 ? tut_case : tut_suite;
+}
+
+//____________________________________________________________________________//
+
+// helper templates to prevent ODR violations
+template<class T>
+struct static_constant {
+ static T value;
+};
+
+template<class T>
+T static_constant<T>::value;
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_GLOBAL_TYPEDEF_HPP_021005GER
diff --git a/ndnboost/test/detail/log_level.hpp b/ndnboost/test/detail/log_level.hpp
new file mode 100644
index 0000000..14e69f4
--- /dev/null
+++ b/ndnboost/test/detail/log_level.hpp
@@ -0,0 +1,43 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : shared definition for unit test log levels
+// ***************************************************************************
+
+#ifndef BOOST_TEST_LOG_LEVEL_HPP_011605GER
+#define BOOST_TEST_LOG_LEVEL_HPP_011605GER
+
+namespace ndnboost {
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** log levels ************** //
+// ************************************************************************** //
+
+// each log level includes all subsequent higher loging levels
+enum log_level {
+ invalid_log_level = -1,
+ log_successful_tests = 0,
+ log_test_units = 1,
+ log_messages = 2,
+ log_warnings = 3,
+ log_all_errors = 4, // reported by unit test macros
+ log_cpp_exception_errors = 5, // uncaught C++ exceptions
+ log_system_errors = 6, // including timeouts, signals, traps
+ log_fatal_errors = 7, // including unit test macros or
+ // fatal system errors
+ log_nothing = 8
+};
+
+} // namespace unit_test
+} // namespace ndnboost
+
+#endif // BOOST_TEST_LOG_LEVEL_HPP_011605GER
diff --git a/ndnboost/test/detail/suppress_warnings.hpp b/ndnboost/test/detail/suppress_warnings.hpp
new file mode 100644
index 0000000..2471226
--- /dev/null
+++ b/ndnboost/test/detail/suppress_warnings.hpp
@@ -0,0 +1,31 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : suppress some warnings
+// ***************************************************************************
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable: 4511) // copy constructor can't not be generated
+# pragma warning(disable: 4512) // assignment operator can't not be generated
+# pragma warning(disable: 4100) // unreferenced formal parameter
+# pragma warning(disable: 4996) // <symbol> was declared deprecated
+# pragma warning(disable: 4355) // 'this' : used in base member initializer list
+# pragma warning(disable: 4706) // assignment within conditional expression
+# pragma warning(disable: 4251) // class 'A<T>' needs to have dll-interface to be used by clients of class 'B'
+# pragma warning(disable: 4127) // conditional expression is constant
+# pragma warning(disable: 4290) // C++ exception specification ignored except to ...
+# pragma warning(disable: 4180) // qualifier applied to function type has no meaning; ignored
+# pragma warning(disable: 4275) // non dll-interface class ... used as base for dll-interface class ...
+# pragma warning(disable: 4267) // 'var' : conversion from 'size_t' to 'type', possible loss of data
+# pragma warning(disable: 4511) // 'class' : copy constructor could not be generated
+#endif
+
diff --git a/ndnboost/test/detail/unit_test_parameters.hpp b/ndnboost/test/detail/unit_test_parameters.hpp
new file mode 100644
index 0000000..364692b
--- /dev/null
+++ b/ndnboost/test/detail/unit_test_parameters.hpp
@@ -0,0 +1,69 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : storage for unit test framework parameters information
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_PARAMETERS_HPP_071894GER
+#define BOOST_TEST_UNIT_TEST_PARAMETERS_HPP_071894GER
+
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/log_level.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+// STL
+#include <iosfwd>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** runtime_config ************** //
+// ************************************************************************** //
+
+namespace runtime_config {
+
+BOOST_TEST_DECL void init( int& argc, char** argv );
+
+BOOST_TEST_DECL unit_test::log_level log_level();
+BOOST_TEST_DECL bool no_result_code();
+BOOST_TEST_DECL unit_test::report_level report_level();
+BOOST_TEST_DECL const_string test_to_run();
+BOOST_TEST_DECL const_string break_exec_path();
+BOOST_TEST_DECL bool save_pattern();
+BOOST_TEST_DECL bool show_build_info();
+BOOST_TEST_DECL bool show_progress();
+BOOST_TEST_DECL bool catch_sys_errors();
+BOOST_TEST_DECL bool auto_start_dbg();
+BOOST_TEST_DECL bool use_alt_stack();
+BOOST_TEST_DECL bool detect_fp_exceptions();
+BOOST_TEST_DECL output_format report_format();
+BOOST_TEST_DECL output_format log_format();
+BOOST_TEST_DECL std::ostream* report_sink();
+BOOST_TEST_DECL std::ostream* log_sink();
+BOOST_TEST_DECL long detect_memory_leaks();
+BOOST_TEST_DECL int random_seed();
+
+} // namespace runtime_config
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_PARAMETERS_HPP_071894GER
diff --git a/ndnboost/test/detail/workaround.hpp b/ndnboost/test/detail/workaround.hpp
new file mode 100644
index 0000000..654972b
--- /dev/null
+++ b/ndnboost/test/detail/workaround.hpp
@@ -0,0 +1,65 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : contains mics. workarounds
+// ***************************************************************************
+
+#ifndef BOOST_TEST_WORKAROUND_HPP_021005GER
+#define BOOST_TEST_WORKAROUND_HPP_021005GER
+
+// Boost
+#include <ndnboost/config.hpp> // compilers workarounds and std::ptrdiff_t
+
+// STL
+#include <iterator> // for std::distance
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace ut_detail {
+
+#ifdef BOOST_NO_STD_DISTANCE
+template <class T>
+std::ptrdiff_t distance( T const& x_, T const& y_ )
+{
+ std::ptrdiff_t res = 0;
+
+ std::distance( x_, y_, res );
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+#else
+using std::distance;
+#endif
+
+template <class T> inline void ignore_unused_variable_warning(const T&) {}
+
+} // namespace ut_detail
+
+} // namespace unit_test
+
+namespace unit_test_framework = unit_test;
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_WORKAROUND_HPP_021005GER
diff --git a/ndnboost/test/execution_monitor.hpp b/ndnboost/test/execution_monitor.hpp
new file mode 100644
index 0000000..8475686
--- /dev/null
+++ b/ndnboost/test/execution_monitor.hpp
@@ -0,0 +1,263 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// (C) Copyright Beman Dawes 2001.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : defines abstract monitor interfaces and implements execution exception
+// The original Boost Test Library included an implementation detail function
+// named catch_exceptions() which caught otherwise uncaught C++ exceptions.
+// It was derived from an existing test framework by Beman Dawes. The
+// intent was to expand later to catch other detectable but platform dependent
+// error events like Unix signals or Windows structured C exceptions.
+//
+// Requests from early adopters of the Boost Test Library included
+// configurable levels of error message detail, elimination of templates,
+// separation of error reporting, and making the catch_exceptions() facilities
+// available as a public interface. Support for unit testing also stretched
+// the function based design. Implementation within the header became less
+// attractive due to the need to include many huge system dependent headers,
+// although still preferable in certain cases.
+//
+// All those issues have been addressed by introducing the class-based
+// design presented here.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_EXECUTION_MONITOR_HPP_071894GER
+#define BOOST_TEST_EXECUTION_MONITOR_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+#include <ndnboost/test/utils/callback.hpp>
+#include <ndnboost/test/utils/class_properties.hpp>
+
+// Boost
+#include <ndnboost/scoped_ptr.hpp>
+#include <ndnboost/scoped_array.hpp>
+#include <ndnboost/type.hpp>
+#include <ndnboost/cstdlib.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace detail {
+
+// ************************************************************************** //
+// ************** detail::translate_exception_base ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL translate_exception_base {
+public:
+ // Constructor
+ explicit translate_exception_base( ndnboost::scoped_ptr<translate_exception_base>& next )
+ {
+ next.swap( m_next );
+ }
+
+ // Destructor
+ virtual ~translate_exception_base() {}
+
+ virtual int operator()( unit_test::callback0<int> const& F ) = 0;
+
+protected:
+ // Data members
+ ndnboost::scoped_ptr<translate_exception_base> m_next;
+};
+
+} // namespace detail
+
+// ************************************************************************** //
+// ************** execution_exception ************** //
+// ************************************************************************** //
+
+// design rationale: fear of being out (or nearly out) of memory.
+
+class BOOST_TEST_DECL execution_exception {
+ typedef ndnboost::unit_test::const_string const_string;
+public:
+ enum error_code {
+ // These values are sometimes used as program return codes.
+ // The particular values have been chosen to avoid conflicts with
+ // commonly used program return codes: values < 100 are often user
+ // assigned, values > 255 are sometimes used to report system errors.
+ // Gaps in values allow for orderly expansion.
+
+ no_error = 0, // for completeness only; never returned
+ user_error = 200, // user reported non-fatal error
+ cpp_exception_error = 205, // see note (1) below
+ system_error = 210, // see note (2) below
+ timeout_error = 215, // only detectable on certain platforms
+ user_fatal_error = 220, // user reported fatal error
+ system_fatal_error = 225 // see note (2) below
+
+ // Note 1: Only uncaught C++ exceptions are treated as errors.
+ // If the application catches a C++ exception, it will never reach
+ // the execution_monitor.
+
+ // Note 2: These errors include Unix signals and Windows structured
+ // exceptions. They are often initiated by hardware traps.
+ //
+ // The implementation decides what is a fatal_system_exception and what is
+ // just a system_exception. Fatal errors are so likely to have corrupted
+ // machine state (like a stack overflow or addressing exception) that it
+ // is unreasonable to continue execution.
+ };
+
+ struct BOOST_TEST_DECL location {
+ explicit location( char const* file_name = 0, size_t line_num = 0, char const* func = 0 );
+
+ const_string m_file_name;
+ size_t m_line_num;
+ const_string m_function;
+ };
+
+ // Constructor
+ execution_exception( error_code ec_, const_string what_msg_, location const& location_ ); // max length 256 inc '\0'
+
+ // Access methods
+ error_code code() const { return m_error_code; }
+ const_string what() const { return m_what; }
+ location const& where() const { return m_location; }
+
+private:
+ // Data members
+ error_code m_error_code;
+ const_string m_what;
+ location m_location;
+}; // execution_exception
+
+// ************************************************************************** //
+// ************** execution_monitor ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL execution_monitor {
+public:
+ // Constructor
+ execution_monitor()
+ : p_catch_system_errors( true )
+ , p_auto_start_dbg( false )
+ , p_timeout( 0 )
+ , p_use_alt_stack( true )
+ , p_detect_fp_exceptions( false )
+ {}
+
+ // Public properties
+
+ // The p_catch_system_errors parameter specifies whether the monitor should
+ // try to catch system errors/exceptions that would cause program to crash
+ // in regular case
+ unit_test::readwrite_property<bool> p_catch_system_errors;
+ // The p_auto_start_dbg parameter specifies whether the monitor should
+ // try to attach debugger in case of caught system error
+ unit_test::readwrite_property<bool> p_auto_start_dbg;
+ // The p_timeout parameter specifies the seconds that elapse before
+ // a timer_error occurs. May be ignored on some platforms.
+ unit_test::readwrite_property<int> p_timeout;
+ // The p_use_alt_stack parameter specifies whether the monitor should
+ // use alternative stack for the signal catching
+ unit_test::readwrite_property<bool> p_use_alt_stack;
+ // The p_detect_fp_exceptions parameter specifies whether the monitor should
+ // try to detect hardware floating point exceptions
+ unit_test::readwrite_property<bool> p_detect_fp_exceptions;
+
+ int execute( unit_test::callback0<int> const& F );
+ // Returns: Value returned by function call F().
+ //
+ // Effects: Calls executes supplied function F inside a try/catch block which also may
+ // include other unspecified platform dependent error detection code.
+ //
+ // Throws: execution_exception on an uncaught C++ exception,
+ // a hardware or software signal, trap, or other exception.
+ //
+ // Note: execute() doesn't consider it an error for F to return a non-zero value.
+
+ // register custom (user supplied) exception translator
+ template<typename Exception, typename ExceptionTranslator>
+ void register_exception_translator( ExceptionTranslator const& tr, ndnboost::type<Exception>* = 0 );
+
+private:
+ // implementation helpers
+ int catch_signals( unit_test::callback0<int> const& F );
+
+ // Data members
+ ndnboost::scoped_ptr<detail::translate_exception_base> m_custom_translators;
+ ndnboost::scoped_array<char> m_alt_stack;
+}; // execution_monitor
+
+namespace detail {
+
+// ************************************************************************** //
+// ************** detail::translate_exception ************** //
+// ************************************************************************** //
+
+template<typename Exception, typename ExceptionTranslator>
+class translate_exception : public translate_exception_base
+{
+ typedef ndnboost::scoped_ptr<translate_exception_base> base_ptr;
+public:
+ explicit translate_exception( ExceptionTranslator const& tr, base_ptr& next )
+ : translate_exception_base( next ), m_translator( tr ) {}
+
+ int operator()( unit_test::callback0<int> const& F )
+ {
+ try {
+ return m_next ? (*m_next)( F ) : F();
+ } catch( Exception const& e ) {
+ m_translator( e );
+ return ndnboost::exit_exception_failure;
+ }
+ }
+
+private:
+ // Data members
+ ExceptionTranslator m_translator;
+};
+
+} // namespace detail
+
+template<typename Exception, typename ExceptionTranslator>
+void
+execution_monitor::register_exception_translator( ExceptionTranslator const& tr, ndnboost::type<Exception>* )
+{
+ m_custom_translators.reset(
+ new detail::translate_exception<Exception,ExceptionTranslator>( tr,m_custom_translators ) );
+}
+
+// ************************************************************************** //
+// ************** execution_aborted ************** //
+// ************************************************************************** //
+
+struct execution_aborted {};
+
+// ************************************************************************** //
+// ************** system_error ************** //
+// ************************************************************************** //
+
+class system_error {
+public:
+ // Constructor
+ explicit system_error( char const* exp );
+
+ unit_test::readonly_property<long> p_errno;
+ unit_test::readonly_property<char const*> p_failed_exp;
+};
+
+#define BOOST_TEST_SYS_ASSERT( exp ) if( (exp) ) ; else throw ::ndnboost::system_error( BOOST_STRINGIZE( exp ) )
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif
diff --git a/ndnboost/test/floating_point_comparison.hpp b/ndnboost/test/floating_point_comparison.hpp
new file mode 100644
index 0000000..211f29b
--- /dev/null
+++ b/ndnboost/test/floating_point_comparison.hpp
@@ -0,0 +1,286 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : defines algoirthms for comparing 2 floating point values
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FLOATING_POINT_COMPARISON_HPP_071894GER
+#define BOOST_TEST_FLOATING_POINT_COMPARISON_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/predicate_result.hpp>
+
+// Boost
+#include <ndnboost/limits.hpp> // for std::numeric_limits
+#include <ndnboost/numeric/conversion/conversion_traits.hpp> // for numeric::conversion_traits
+#include <ndnboost/static_assert.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace test_tools {
+
+using unit_test::readonly_property;
+
+// ************************************************************************** //
+// ************** floating_point_comparison_type ************** //
+// ************************************************************************** //
+
+enum floating_point_comparison_type {
+ FPC_STRONG, // "Very close" - equation 1' in docs, the default
+ FPC_WEAK // "Close enough" - equation 2' in docs.
+
+};
+
+// ************************************************************************** //
+// ************** details ************** //
+// ************************************************************************** //
+
+namespace tt_detail {
+
+// FPT is Floating-Point Type: float, double, long double or User-Defined.
+template<typename FPT>
+inline FPT
+fpt_abs( FPT fpv )
+{
+ return fpv < static_cast<FPT>(0) ? -fpv : fpv;
+}
+
+//____________________________________________________________________________//
+
+template<typename FPT>
+struct fpt_limits {
+ static FPT min_value()
+ {
+ return std::numeric_limits<FPT>::is_specialized
+ ? (std::numeric_limits<FPT>::min)()
+ : 0;
+ }
+ static FPT max_value()
+ {
+ return std::numeric_limits<FPT>::is_specialized
+ ? (std::numeric_limits<FPT>::max)()
+ : static_cast<FPT>(1000000); // for the our purpuses it doesn't really matter what value is returned here
+ }
+};
+
+//____________________________________________________________________________//
+
+// both f1 and f2 are unsigned here
+template<typename FPT>
+inline FPT
+safe_fpt_division( FPT f1, FPT f2 )
+{
+ // Avoid overflow.
+ if( (f2 < static_cast<FPT>(1)) && (f1 > f2*fpt_limits<FPT>::max_value()) )
+ return fpt_limits<FPT>::max_value();
+
+ // Avoid underflow.
+ if( (f1 == static_cast<FPT>(0)) ||
+ ((f2 > static_cast<FPT>(1)) && (f1 < f2*fpt_limits<FPT>::min_value())) )
+ return static_cast<FPT>(0);
+
+ return f1/f2;
+}
+
+//____________________________________________________________________________//
+
+} // namespace tt_detail
+
+// ************************************************************************** //
+// ************** tolerance presentation types ************** //
+// ************************************************************************** //
+
+template<typename FPT>
+struct percent_tolerance_t {
+ explicit percent_tolerance_t( FPT v ) : m_value( v ) {}
+
+ FPT m_value;
+};
+
+//____________________________________________________________________________//
+
+template<typename Out,typename FPT>
+Out& operator<<( Out& out, percent_tolerance_t<FPT> t )
+{
+ return out << t.m_value;
+}
+
+//____________________________________________________________________________//
+
+template<typename FPT>
+inline percent_tolerance_t<FPT>
+percent_tolerance( FPT v )
+{
+ return percent_tolerance_t<FPT>( v );
+}
+
+//____________________________________________________________________________//
+
+template<typename FPT>
+struct fraction_tolerance_t {
+ explicit fraction_tolerance_t( FPT v ) : m_value( v ) {}
+
+ FPT m_value;
+};
+
+//____________________________________________________________________________//
+
+template<typename Out,typename FPT>
+Out& operator<<( Out& out, fraction_tolerance_t<FPT> t )
+{
+ return out << t.m_value;
+}
+
+//____________________________________________________________________________//
+
+template<typename FPT>
+inline fraction_tolerance_t<FPT>
+fraction_tolerance( FPT v )
+{
+ return fraction_tolerance_t<FPT>( v );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** close_at_tolerance ************** //
+// ************************************************************************** //
+
+template<typename FPT>
+class close_at_tolerance {
+public:
+ // Public typedefs
+ typedef bool result_type;
+
+ // Constructor
+ template<typename ToleranceBaseType>
+ explicit close_at_tolerance( percent_tolerance_t<ToleranceBaseType> tolerance,
+ floating_point_comparison_type fpc_type = FPC_STRONG )
+ : p_fraction_tolerance( tt_detail::fpt_abs( static_cast<FPT>(0.01)*tolerance.m_value ) )
+ , p_strong_or_weak( fpc_type == FPC_STRONG )
+ , m_report_modifier( 100. )
+ {}
+ template<typename ToleranceBaseType>
+ explicit close_at_tolerance( fraction_tolerance_t<ToleranceBaseType> tolerance,
+ floating_point_comparison_type fpc_type = FPC_STRONG )
+ : p_fraction_tolerance( tt_detail::fpt_abs( tolerance.m_value ) )
+ , p_strong_or_weak( fpc_type == FPC_STRONG )
+ , m_report_modifier( 1. )
+ {}
+
+ predicate_result operator()( FPT left, FPT right ) const
+ {
+ FPT diff = tt_detail::fpt_abs( left - right );
+ FPT d1 = tt_detail::safe_fpt_division( diff, tt_detail::fpt_abs( right ) );
+ FPT d2 = tt_detail::safe_fpt_division( diff, tt_detail::fpt_abs( left ) );
+
+ predicate_result res( p_strong_or_weak
+ ? (d1 <= p_fraction_tolerance.get() && d2 <= p_fraction_tolerance.get())
+ : (d1 <= p_fraction_tolerance.get() || d2 <= p_fraction_tolerance.get()) );
+
+ if( !res )
+ res.message() << (( d1 <= p_fraction_tolerance.get() ? d2 : d1 ) * m_report_modifier);
+
+ return res;
+ }
+
+ // Public properties
+ readonly_property<FPT> p_fraction_tolerance;
+ readonly_property<bool> p_strong_or_weak;
+private:
+ // Data members
+ FPT m_report_modifier;
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** check_is_close ************** //
+// ************************************************************************** //
+
+struct BOOST_TEST_DECL check_is_close_t {
+ // Public typedefs
+ typedef bool result_type;
+
+ template<typename FPT1, typename FPT2, typename ToleranceBaseType>
+ predicate_result
+ operator()( FPT1 left, FPT2 right, percent_tolerance_t<ToleranceBaseType> tolerance,
+ floating_point_comparison_type fpc_type = FPC_STRONG ) const
+ {
+ // deduce "better" type from types of arguments being compared
+ // if one type is floating and the second integral we use floating type and
+ // value of integral type is promoted to the floating. The same for float and double
+ // But we don't want to compare two values of integral types using this tool.
+ typedef typename numeric::conversion_traits<FPT1,FPT2>::supertype FPT;
+ BOOST_STATIC_ASSERT( !is_integral<FPT>::value );
+
+ close_at_tolerance<FPT> pred( tolerance, fpc_type );
+
+ return pred( left, right );
+ }
+ template<typename FPT1, typename FPT2, typename ToleranceBaseType>
+ predicate_result
+ operator()( FPT1 left, FPT2 right, fraction_tolerance_t<ToleranceBaseType> tolerance,
+ floating_point_comparison_type fpc_type = FPC_STRONG ) const
+ {
+ // same as in a comment above
+ typedef typename numeric::conversion_traits<FPT1,FPT2>::supertype FPT;
+ BOOST_STATIC_ASSERT( !is_integral<FPT>::value );
+
+ close_at_tolerance<FPT> pred( tolerance, fpc_type );
+
+ return pred( left, right );
+ }
+};
+
+namespace {
+check_is_close_t const& check_is_close = unit_test::ut_detail::static_constant<check_is_close_t>::value;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** check_is_small ************** //
+// ************************************************************************** //
+
+struct BOOST_TEST_DECL check_is_small_t {
+ // Public typedefs
+ typedef bool result_type;
+
+ template<typename FPT>
+ bool
+ operator()( FPT fpv, FPT tolerance ) const
+ {
+ return tt_detail::fpt_abs( fpv ) < tt_detail::fpt_abs( tolerance );
+ }
+};
+
+namespace {
+check_is_small_t const& check_is_small = unit_test::ut_detail::static_constant<check_is_small_t>::value;
+}
+
+//____________________________________________________________________________//
+
+} // namespace test_tools
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_FLOATING_POINT_COMAPARISON_HPP_071894GER
diff --git a/ndnboost/test/framework.hpp b/ndnboost/test/framework.hpp
new file mode 100644
index 0000000..43d249d
--- /dev/null
+++ b/ndnboost/test/framework.hpp
@@ -0,0 +1,112 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines framework interface
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FRAMEWORK_HPP_020805GER
+#define BOOST_TEST_FRAMEWORK_HPP_020805GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+#include <ndnboost/test/utils/trivial_singleton.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+// STL
+#include <stdexcept>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** init_unit_test_func ************** //
+// ************************************************************************** //
+
+#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
+typedef bool (*init_unit_test_func)();
+#else
+typedef test_suite* (*init_unit_test_func)( int, char* [] );
+#endif
+
+// ************************************************************************** //
+// ************** framework ************** //
+// ************************************************************************** //
+
+namespace framework {
+
+// initialization
+BOOST_TEST_DECL void init( init_unit_test_func init_func, int argc, char* argv[] );
+BOOST_TEST_DECL bool is_initialized();
+
+// mutation access methods
+BOOST_TEST_DECL void register_test_unit( test_case* tc );
+BOOST_TEST_DECL void register_test_unit( test_suite* ts );
+BOOST_TEST_DECL void deregister_test_unit( test_unit* tu );
+BOOST_TEST_DECL void clear();
+
+BOOST_TEST_DECL void register_observer( test_observer& );
+BOOST_TEST_DECL void deregister_observer( test_observer& );
+BOOST_TEST_DECL void reset_observers();
+
+BOOST_TEST_DECL master_test_suite_t& master_test_suite();
+
+// constant access methods
+BOOST_TEST_DECL test_case const& current_test_case();
+
+BOOST_TEST_DECL test_unit& get( test_unit_id, test_unit_type );
+template<typename UnitType>
+UnitType& get( test_unit_id id )
+{
+ return static_cast<UnitType&>( get( id, static_cast<test_unit_type>(UnitType::type) ) );
+}
+
+// test initiation
+BOOST_TEST_DECL void run( test_unit_id = INV_TEST_UNIT_ID, bool continue_test = true );
+BOOST_TEST_DECL void run( test_unit const*, bool continue_test = true );
+
+// public test events dispatchers
+BOOST_TEST_DECL void assertion_result( bool passed );
+BOOST_TEST_DECL void exception_caught( execution_exception const& );
+BOOST_TEST_DECL void test_unit_aborted( test_unit const& );
+
+// ************************************************************************** //
+// ************** framework errors ************** //
+// ************************************************************************** //
+
+struct internal_error : std::runtime_error {
+ internal_error( const_string m ) : std::runtime_error( std::string( m.begin(), m.size() ) ) {}
+};
+
+struct setup_error : std::runtime_error {
+ setup_error( const_string m ) : std::runtime_error( std::string( m.begin(), m.size() ) ) {}
+};
+
+#define BOOST_TEST_SETUP_ASSERT( cond, msg ) if( cond ) {} else throw unit_test::framework::setup_error( msg )
+
+struct nothing_to_test {}; // not really an error
+
+} // namespace framework
+
+} // unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_FRAMEWORK_HPP_020805GER
+
diff --git a/ndnboost/test/impl/compiler_log_formatter.ipp b/ndnboost/test/impl/compiler_log_formatter.ipp
new file mode 100644
index 0000000..e153920
--- /dev/null
+++ b/ndnboost/test/impl/compiler_log_formatter.ipp
@@ -0,0 +1,222 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : implements compiler like Log formatter
+// ***************************************************************************
+
+#ifndef BOOST_TEST_COMPILER_LOG_FORMATTER_IPP_020105GER
+#define BOOST_TEST_COMPILER_LOG_FORMATTER_IPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/output/compiler_log_formatter.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/lazy_ostream.hpp>
+
+// Boost
+#include <ndnboost/version.hpp>
+
+// STL
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+// ************************************************************************** //
+// ************** compiler_log_formatter ************** //
+// ************************************************************************** //
+
+namespace {
+
+const_string
+test_phase_identifier()
+{
+ return framework::is_initialized()
+ ? const_string( framework::current_test_case().p_name.get() )
+ : BOOST_TEST_L( "Test setup" );
+}
+
+} // local namespace
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_start( std::ostream& output, counter_t test_cases_amount )
+{
+ if( test_cases_amount > 0 )
+ output << "Running " << test_cases_amount << " test "
+ << (test_cases_amount > 1 ? "cases" : "case") << "...\n";
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_finish( std::ostream& ostr )
+{
+ ostr.flush();
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_build_info( std::ostream& output )
+{
+ output << "Platform: " << BOOST_PLATFORM << '\n'
+ << "Compiler: " << BOOST_COMPILER << '\n'
+ << "STL : " << BOOST_STDLIB << '\n'
+ << "Boost : " << BOOST_VERSION/100000 << "."
+ << BOOST_VERSION/100 % 1000 << "."
+ << BOOST_VERSION % 100 << std::endl;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::test_unit_start( std::ostream& output, test_unit const& tu )
+{
+ output << "Entering test " << tu.p_type_name << " \"" << tu.p_name << "\"" << std::endl;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::test_unit_finish( std::ostream& output, test_unit const& tu, unsigned long elapsed )
+{
+ output << "Leaving test " << tu.p_type_name << " \"" << tu.p_name << "\"";
+
+ if( elapsed > 0 ) {
+ output << "; testing time: ";
+ if( elapsed % 1000 == 0 )
+ output << elapsed/1000 << "ms";
+ else
+ output << elapsed << "mks";
+ }
+
+ output << std::endl;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::test_unit_skipped( std::ostream& output, test_unit const& tu )
+{
+ output << "Test " << tu.p_type_name << " \"" << tu.p_name << "\"" << "is skipped" << std::endl;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_exception( std::ostream& output, log_checkpoint_data const& checkpoint_data, execution_exception const& ex )
+{
+ execution_exception::location const& loc = ex.where();
+ print_prefix( output, loc.m_file_name, loc.m_line_num );
+
+ output << "fatal error in \"" << (loc.m_function.is_empty() ? test_phase_identifier() : loc.m_function ) << "\": ";
+
+ output << ex.what();
+
+ if( !checkpoint_data.m_file_name.is_empty() ) {
+ output << '\n';
+ print_prefix( output, checkpoint_data.m_file_name, checkpoint_data.m_line_num );
+ output << "last checkpoint";
+ if( !checkpoint_data.m_message.empty() )
+ output << ": " << checkpoint_data.m_message;
+ }
+
+ output << std::endl;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_entry_start( std::ostream& output, log_entry_data const& entry_data, log_entry_types let )
+{
+ switch( let ) {
+ case BOOST_UTL_ET_INFO:
+ print_prefix( output, entry_data.m_file_name, entry_data.m_line_num );
+ output << "info: ";
+ break;
+ case BOOST_UTL_ET_MESSAGE:
+ break;
+ case BOOST_UTL_ET_WARNING:
+ print_prefix( output, entry_data.m_file_name, entry_data.m_line_num );
+ output << "warning in \"" << test_phase_identifier() << "\": ";
+ break;
+ case BOOST_UTL_ET_ERROR:
+ print_prefix( output, entry_data.m_file_name, entry_data.m_line_num );
+ output << "error in \"" << test_phase_identifier() << "\": ";
+ break;
+ case BOOST_UTL_ET_FATAL_ERROR:
+ print_prefix( output, entry_data.m_file_name, entry_data.m_line_num );
+ output << "fatal error in \"" << test_phase_identifier() << "\": ";
+ break;
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_entry_value( std::ostream& output, const_string value )
+{
+ output << value;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_entry_value( std::ostream& output, lazy_ostream const& value )
+{
+ output << value;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::log_entry_finish( std::ostream& output )
+{
+ output << std::endl;
+}
+
+//____________________________________________________________________________//
+
+void
+compiler_log_formatter::print_prefix( std::ostream& output, const_string file, std::size_t line )
+{
+#ifdef __APPLE_CC__
+ // Xcode-compatible logging format, idea by Richard Dingwall at
+ // <http://richarddingwall.name/2008/06/01/using-the-boost-unit-test-framework-with-xcode-3/>.
+ output << file << ':' << line << ": ";
+#else
+ output << file << '(' << line << "): ";
+#endif
+}
+
+//____________________________________________________________________________//
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_COMPILER_LOG_FORMATTER_IPP_020105GER
diff --git a/ndnboost/test/impl/cpp_main.ipp b/ndnboost/test/impl/cpp_main.ipp
new file mode 100644
index 0000000..3bacee1
--- /dev/null
+++ b/ndnboost/test/impl/cpp_main.ipp
@@ -0,0 +1,139 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// (C) Copyright Beman Dawes 1995-2001.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : main function implementation for Program Executon Monitor
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CPP_MAIN_IPP_012205GER
+#define BOOST_TEST_CPP_MAIN_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/execution_monitor.hpp>
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// Boost
+#include <ndnboost/cstdlib.hpp> // for exit codes
+#include <ndnboost/config.hpp> // for workarounds
+
+// STL
+#include <iostream>
+#include <cstdlib> // std::getenv
+#include <cstring> // std::strerror
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::getenv; using ::strerror; }
+#endif
+
+namespace {
+
+struct cpp_main_caller {
+ cpp_main_caller( int (*cpp_main_func)( int argc, char* argv[] ), int argc, char** argv )
+ : m_cpp_main_func( cpp_main_func )
+ , m_argc( argc )
+ , m_argv( argv ) {}
+
+ int operator()() { return (*m_cpp_main_func)( m_argc, m_argv ); }
+
+private:
+ // Data members
+ int (*m_cpp_main_func)( int argc, char* argv[] );
+ int m_argc;
+ char** m_argv;
+};
+
+} // local namespace
+
+// ************************************************************************** //
+// ************** prg_exec_monitor_main ************** //
+// ************************************************************************** //
+
+namespace ndnboost {
+
+int BOOST_TEST_DECL
+prg_exec_monitor_main( int (*cpp_main)( int argc, char* argv[] ), int argc, char* argv[] )
+{
+ int result = 0;
+
+ try {
+ ndnboost::unit_test::const_string p( std::getenv( "BOOST_TEST_CATCH_SYSTEM_ERRORS" ) );
+ ::ndnboost::execution_monitor ex_mon;
+
+ ex_mon.p_catch_system_errors.value = p != "no";
+
+ result = ex_mon.execute(
+ ::ndnboost::unit_test::callback0<int>( cpp_main_caller( cpp_main, argc, argv ) ) );
+
+ if( result == 0 )
+ result = ::ndnboost::exit_success;
+ else if( result != ::ndnboost::exit_success ) {
+ std::cout << "\n**** error return code: " << result << std::endl;
+ result = ::ndnboost::exit_failure;
+ }
+ }
+ catch( ::ndnboost::execution_exception const& exex ) {
+ std::cout << "\n**** exception(" << exex.code() << "): " << exex.what() << std::endl;
+ result = ::ndnboost::exit_exception_failure;
+ }
+ catch( ::ndnboost::system_error const& ex ) {
+ std::cout << "\n**** failed to initialize execution monitor."
+ << "\n**** expression at fault: " << ex.p_failed_exp
+ << "\n**** error(" << ex.p_errno << "): " << std::strerror( ex.p_errno ) << std::endl;
+ result = ::ndnboost::exit_exception_failure;
+ }
+
+ if( result != ::ndnboost::exit_success ) {
+ std::cerr << "******** errors detected; see standard output for details ********" << std::endl;
+ }
+ else {
+ // Some prefer a confirming message when all is well, while others don't
+ // like the clutter. Use an environment variable to avoid command
+ // line argument modifications; for use in production programs
+ // that's a no-no in some organizations.
+ ::ndnboost::unit_test::const_string p( std::getenv( "BOOST_PRG_MON_CONFIRM" ) );
+ if( p != "no" ) {
+ std::cerr << std::flush << "no errors detected" << std::endl;
+ }
+ }
+
+ return result;
+}
+
+} // namespace ndnboost
+
+#if !defined(BOOST_TEST_DYN_LINK) && !defined(BOOST_TEST_NO_MAIN)
+
+// ************************************************************************** //
+// ************** main function for tests using lib ************** //
+// ************************************************************************** //
+
+int cpp_main( int argc, char* argv[] ); // prototype for user's cpp_main()
+
+int BOOST_TEST_CALL_DECL
+main( int argc, char* argv[] )
+{
+ return ::ndnboost::prg_exec_monitor_main( &cpp_main, argc, argv );
+}
+
+//____________________________________________________________________________//
+
+#endif // !BOOST_TEST_DYN_LINK && !BOOST_TEST_NO_MAIN
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_CPP_MAIN_IPP_012205GER
diff --git a/ndnboost/test/impl/debug.ipp b/ndnboost/test/impl/debug.ipp
new file mode 100644
index 0000000..bf23f2e
--- /dev/null
+++ b/ndnboost/test/impl/debug.ipp
@@ -0,0 +1,970 @@
+// (C) Copyright Gennadiy Rozental 2006-2008.
+// Use, modification, and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : debug interfaces implementation
+// ***************************************************************************
+
+#ifndef BOOST_TEST_DEBUG_API_IPP_112006GER
+#define BOOST_TEST_DEBUG_API_IPP_112006GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/detail/workaround.hpp>
+#include <ndnboost/test/detail/global_typedef.hpp>
+
+#include <ndnboost/test/debug.hpp>
+#include <ndnboost/test/debug_config.hpp>
+
+// Implementation on Windows
+#if defined(_WIN32) && !defined(UNDER_CE) && !defined(BOOST_DISABLE_WIN32) // ******* WIN32
+
+# define BOOST_WIN32_BASED_DEBUG
+
+// SYSTEM API
+# include <windows.h>
+# include <winreg.h>
+# include <cstdio>
+# include <cstring>
+
+# if !defined(NDEBUG) && defined(_MSC_VER)
+# define BOOST_MS_CRT_BASED_DEBUG
+# include <crtdbg.h>
+# endif
+
+
+# if BOOST_WORKAROUND( BOOST_MSVC, <1300)
+# define snprintf _snprintf
+# endif
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::memset; using ::sprintf; }
+# endif
+
+#elif defined(unix) || defined(__unix) // ********************* UNIX
+
+# define BOOST_UNIX_BASED_DEBUG
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/algorithm.hpp>
+
+// STL
+#include <cstring> // std::memcpy
+#include <map>
+#include <cstdio>
+#include <stdarg.h> // !! ?? cstdarg
+
+// SYSTEM API
+# include <unistd.h>
+# include <signal.h>
+# include <fcntl.h>
+
+# include <sys/types.h>
+# include <sys/stat.h>
+# include <sys/wait.h>
+# include <sys/time.h>
+# include <stdio.h>
+# include <stdlib.h>
+
+# if defined(sun) || defined(__sun)
+
+# define BOOST_SUN_BASED_DEBUG
+
+# ifndef BOOST_TEST_DBG_LIST
+# define BOOST_TEST_DBG_LIST dbx;gdb
+# endif
+
+# define BOOST_TEST_CNL_DBG dbx
+# define BOOST_TEST_GUI_DBG dbx-ddd
+
+# include <procfs.h>
+
+# elif defined(linux) || defined(__linux)
+
+# define BOOST_LINUX_BASED_DEBUG
+
+# include <sys/ptrace.h>
+
+# ifndef BOOST_TEST_STAT_LINE_MAX
+# define BOOST_TEST_STAT_LINE_MAX 500
+# endif
+
+# ifndef BOOST_TEST_DBG_LIST
+# define BOOST_TEST_DBG_LIST gdb
+# endif
+
+# define BOOST_TEST_CNL_DBG gdb
+# define BOOST_TEST_GUI_DBG gdb-xterm
+
+# endif
+
+#endif
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace debug {
+
+using unit_test::const_string;
+
+// ************************************************************************** //
+// ************** debug::info_t ************** //
+// ************************************************************************** //
+
+namespace {
+
+#if defined(BOOST_WIN32_BASED_DEBUG) // *********************** WIN32
+
+template<typename T>
+inline void
+dyn_symbol( T& res, char const* module_name, char const* symbol_name )
+{
+ HMODULE m = ::GetModuleHandleA( module_name );
+
+ if( !m )
+ m = ::LoadLibraryA( module_name );
+
+ res = reinterpret_cast<T>( ::GetProcAddress( m, symbol_name ) );
+}
+
+//____________________________________________________________________________//
+
+static struct info_t {
+ typedef BOOL (WINAPI* IsDebuggerPresentT)();
+ typedef LONG (WINAPI* RegQueryValueExT)( HKEY, char const* /*LPTSTR*/, LPDWORD, LPDWORD, LPBYTE, LPDWORD );
+ typedef LONG (WINAPI* RegOpenKeyT)( HKEY, char const* /*LPCTSTR*/, PHKEY );
+ typedef LONG (WINAPI* RegCloseKeyT)( HKEY );
+
+ info_t();
+
+ IsDebuggerPresentT m_is_debugger_present;
+ RegOpenKeyT m_reg_open_key;
+ RegQueryValueExT m_reg_query_value;
+ RegCloseKeyT m_reg_close_key;
+
+} s_info;
+
+//____________________________________________________________________________//
+
+info_t::info_t()
+{
+ dyn_symbol( m_is_debugger_present, "kernel32", "IsDebuggerPresent" );
+ dyn_symbol( m_reg_open_key, "advapi32", "RegOpenKeyA" );
+ dyn_symbol( m_reg_query_value, "advapi32", "RegQueryValueExA" );
+ dyn_symbol( m_reg_close_key, "advapi32", "RegCloseKey" );
+}
+
+//____________________________________________________________________________//
+
+#elif defined(BOOST_UNIX_BASED_DEBUG)
+
+// ************************************************************************** //
+// ************** fd_holder ************** //
+// ************************************************************************** //
+
+struct fd_holder {
+ explicit fd_holder( int fd ) : m_fd( fd ) {}
+ ~fd_holder()
+ {
+ if( m_fd != -1 )
+ ::close( m_fd );
+ }
+
+ operator int() { return m_fd; }
+
+private:
+ // Data members
+ int m_fd;
+};
+
+
+// ************************************************************************** //
+// ************** process_info ************** //
+// ************************************************************************** //
+
+struct process_info {
+ // Constructor
+ explicit process_info( int pid );
+
+ // access methods
+ int parent_pid() const { return m_parent_pid; }
+ const_string binary_name() const { return m_binary_name; }
+ const_string binary_path() const { return m_binary_path; }
+
+private:
+ // Data members
+ int m_parent_pid;
+ const_string m_binary_name;
+ const_string m_binary_path;
+
+#if defined(BOOST_SUN_BASED_DEBUG)
+ struct psinfo m_psi;
+#elif defined(BOOST_LINUX_BASED_DEBUG)
+ char m_stat_line[BOOST_TEST_STAT_LINE_MAX+1];
+#endif
+ char m_binary_path_buff[500+1]; // !! ??
+};
+
+//____________________________________________________________________________//
+
+process_info::process_info( int pid )
+: m_parent_pid( 0 )
+{
+#if defined(BOOST_SUN_BASED_DEBUG)
+ char fname_buff[30];
+
+ ::snprintf( fname_buff, sizeof(fname_buff), "/proc/%d/psinfo", pid );
+
+ fd_holder psinfo_fd( ::open( fname_buff, O_RDONLY ) );
+
+ if( psinfo_fd == -1 )
+ return;
+
+ if( ::read( psinfo_fd, &m_psi, sizeof(m_psi) ) == -1 )
+ return;
+
+ m_parent_pid = m_psi.pr_ppid;
+
+ m_binary_name.assign( m_psi.pr_fname );
+
+ //-------------------------- //
+
+ ::snprintf( fname_buff, sizeof(fname_buff), "/proc/%d/as", pid );
+
+ fd_holder as_fd( ::open( fname_buff, O_RDONLY ) );
+ uintptr_t binary_name_pos;
+
+ // !! ?? could we avoid reading whole m_binary_path_buff?
+ if( as_fd == -1 ||
+ ::lseek( as_fd, m_psi.pr_argv, SEEK_SET ) == -1 ||
+ ::read ( as_fd, &binary_name_pos, sizeof(binary_name_pos) ) == -1 ||
+ ::lseek( as_fd, binary_name_pos, SEEK_SET ) == -1 ||
+ ::read ( as_fd, m_binary_path_buff, sizeof(m_binary_path_buff) ) == -1 )
+ return;
+
+ m_binary_path.assign( m_binary_path_buff );
+
+#elif defined(BOOST_LINUX_BASED_DEBUG)
+ char fname_buff[30];
+
+ ::snprintf( fname_buff, sizeof(fname_buff), "/proc/%d/stat", pid );
+
+ fd_holder psinfo_fd( ::open( fname_buff, O_RDONLY ) );
+
+ if( psinfo_fd == -1 )
+ return;
+
+ ssize_t num_read = ::read( psinfo_fd, m_stat_line, sizeof(m_stat_line)-1 );
+ if( num_read == -1 )
+ return;
+
+ m_stat_line[num_read] = 0;
+
+ char const* name_beg = m_stat_line;
+ while( *name_beg && *name_beg != '(' )
+ ++name_beg;
+
+ char const* name_end = name_beg+1;
+ while( *name_end && *name_end != ')' )
+ ++name_end;
+
+ std::sscanf( name_end+1, "%*s%d", &m_parent_pid );
+
+ m_binary_name.assign( name_beg+1, name_end );
+
+ ::snprintf( fname_buff, sizeof(fname_buff), "/proc/%d/exe", pid );
+ num_read = ::readlink( fname_buff, m_binary_path_buff, sizeof(m_binary_path_buff)-1 );
+
+ if( num_read == -1 )
+ return;
+
+ m_binary_path_buff[num_read] = 0;
+ m_binary_path.assign( m_binary_path_buff, num_read );
+#endif
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** prepare_window_title ************** //
+// ************************************************************************** //
+
+static char*
+prepare_window_title( dbg_startup_info const& dsi )
+{
+ typedef unit_test::const_string str_t;
+
+ static char title_str[50];
+
+ str_t path_sep( "\\/" );
+
+ str_t::iterator it = unit_test::find_last_of( dsi.binary_path.begin(), dsi.binary_path.end(),
+ path_sep.begin(), path_sep.end() );
+
+ if( it == dsi.binary_path.end() )
+ it = dsi.binary_path.begin();
+ else
+ ++it;
+
+ ::snprintf( title_str, sizeof(title_str), "%*s %ld", (int)(dsi.binary_path.end()-it), it, dsi.pid );
+
+ return title_str;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** save_execlp ************** //
+// ************************************************************************** //
+
+typedef unit_test::basic_cstring<char> mbuffer;
+
+inline char*
+copy_arg( mbuffer& dest, const_string arg )
+{
+ if( dest.size() < arg.size()+1 )
+ return 0;
+
+ char* res = dest.begin();
+
+ std::memcpy( res, arg.begin(), arg.size()+1 );
+
+ dest.trim_left( arg.size()+1 );
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+bool
+safe_execlp( char const* file, ... )
+{
+ static char* argv_buff[200];
+
+ va_list args;
+ char const* arg;
+
+ // first calculate actual number of arguments
+ int num_args = 2; // file name and 0 at least
+
+ va_start( args, file );
+ while( !!(arg = va_arg( args, char const* )) )
+ num_args++;
+ va_end( args );
+
+ // reserve space for the argument pointers array
+ char** argv_it = argv_buff;
+ mbuffer work_buff( reinterpret_cast<char*>(argv_buff), sizeof(argv_buff) );
+ work_buff.trim_left( num_args * sizeof(char*) );
+
+ // copy all the argument values into local storage
+ if( !(*argv_it++ = copy_arg( work_buff, file )) )
+ return false;
+
+ printf( "!! %s\n", file );
+
+ va_start( args, file );
+ while( !!(arg = va_arg( args, char const* )) ) {
+ printf( "!! %s\n", arg );
+ if( !(*argv_it++ = copy_arg( work_buff, arg )) )
+ return false;
+ }
+ va_end( args );
+
+ *argv_it = 0;
+
+ return ::execvp( file, argv_buff ) != -1;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** start_debugger_in_emacs ************** //
+// ************************************************************************** //
+
+static void
+start_debugger_in_emacs( dbg_startup_info const& dsi, char const* emacs_name, char const* dbg_command )
+{
+ char const* title = prepare_window_title( dsi );
+
+ if( !title )
+ return;
+
+ dsi.display.is_empty()
+ ? safe_execlp( emacs_name, "-title", title, "--eval", dbg_command, 0 )
+ : safe_execlp( emacs_name, "-title", title, "-display", dsi.display.begin(), "--eval", dbg_command, 0 );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** gdb starters ************** //
+// ************************************************************************** //
+
+static char const*
+prepare_gdb_cmnd_file( dbg_startup_info const& dsi )
+{
+ // prepare pid value
+ char pid_buff[16];
+ ::snprintf( pid_buff, sizeof(pid_buff), "%ld", dsi.pid );
+ unit_test::const_string pid_str( pid_buff );
+
+ static char cmd_file_name[] = "/tmp/btl_gdb_cmd_XXXXXX"; // !! ??
+
+ // prepare commands
+ fd_holder cmd_fd( ::mkstemp( cmd_file_name ) );
+
+ if( cmd_fd == -1 )
+ return 0;
+
+#define WRITE_STR( str ) if( ::write( cmd_fd, str.begin(), str.size() ) == -1 ) return 0;
+#define WRITE_CSTR( str ) if( ::write( cmd_fd, str, sizeof( str )-1 ) == -1 ) return 0;
+
+ WRITE_CSTR( "file " );
+ WRITE_STR( dsi.binary_path );
+ WRITE_CSTR( "\nattach " );
+ WRITE_STR( pid_str );
+ WRITE_CSTR( "\nshell unlink " );
+ WRITE_STR( dsi.init_done_lock );
+ WRITE_CSTR( "\ncont" );
+ if( dsi.break_or_continue )
+ WRITE_CSTR( "\nup 4" );
+
+ WRITE_CSTR( "\necho \\n" ); // !! ??
+ WRITE_CSTR( "\nlist -" );
+ WRITE_CSTR( "\nlist" );
+ WRITE_CSTR( "\nshell unlink " );
+ WRITE_CSTR( cmd_file_name );
+
+ return cmd_file_name;
+}
+
+//____________________________________________________________________________//
+
+static void
+start_gdb_in_console( dbg_startup_info const& dsi )
+{
+ char const* cmnd_file_name = prepare_gdb_cmnd_file( dsi );
+
+ if( !cmnd_file_name )
+ return;
+
+ safe_execlp( "gdb", "-q", "-x", cmnd_file_name, 0 );
+}
+
+//____________________________________________________________________________//
+
+static void
+start_gdb_in_xterm( dbg_startup_info const& dsi )
+{
+ char const* title = prepare_window_title( dsi );
+ char const* cmnd_file_name = prepare_gdb_cmnd_file( dsi );
+
+ if( !title || !cmnd_file_name )
+ return;
+
+ safe_execlp( "xterm", "-T", title, "-display", dsi.display.begin(),
+ "-bg", "black", "-fg", "white", "-geometry", "88x30+10+10", "-fn", "9x15", "-e",
+ "gdb", "-q", "-x", cmnd_file_name, 0 );
+}
+
+//____________________________________________________________________________//
+
+static void
+start_gdb_in_emacs( dbg_startup_info const& dsi )
+{
+ char const* cmnd_file_name = prepare_gdb_cmnd_file( dsi );
+ if( !cmnd_file_name )
+ return;
+
+ char dbg_cmd_buff[500]; // !! ??
+ ::snprintf( dbg_cmd_buff, sizeof(dbg_cmd_buff), "(progn (gdb \"gdb -q -x %s\"))", cmnd_file_name );
+
+ start_debugger_in_emacs( dsi, "emacs", dbg_cmd_buff );
+}
+
+//____________________________________________________________________________//
+
+static void
+start_gdb_in_xemacs( dbg_startup_info const& )
+{
+ // !! ??
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** dbx starters ************** //
+// ************************************************************************** //
+
+static char const*
+prepare_dbx_cmd_line( dbg_startup_info const& dsi, bool list_source = true )
+{
+ static char cmd_line_buff[500]; // !! ??
+
+ ::snprintf( cmd_line_buff, sizeof(cmd_line_buff), "unlink %s;cont;%s%s",
+ dsi.init_done_lock.begin(),
+ dsi.break_or_continue ? "up 2;": "",
+ list_source ? "echo \" \";list -w3;" : "" );
+
+ return cmd_line_buff;
+}
+
+//____________________________________________________________________________//
+
+static void
+start_dbx_in_console( dbg_startup_info const& dsi )
+{
+ char pid_buff[16];
+ ::snprintf( pid_buff, sizeof(pid_buff), "%ld", dsi.pid );
+
+ safe_execlp( "dbx", "-q", "-c", prepare_dbx_cmd_line( dsi ), dsi.binary_path.begin(), pid_buff, 0 );
+}
+
+//____________________________________________________________________________//
+
+static void
+start_dbx_in_xterm( dbg_startup_info const& dsi )
+{
+ char const* title = prepare_window_title( dsi );
+ if( !title )
+ return;
+
+ char pid_buff[16]; // !! ??
+ ::snprintf( pid_buff, sizeof(pid_buff), "%ld", dsi.pid );
+
+ safe_execlp( "xterm", "-T", title, "-display", dsi.display.begin(),
+ "-bg", "black", "-fg", "white", "-geometry", "88x30+10+10", "-fn", "9x15", "-e",
+ "dbx", "-q", "-c", prepare_dbx_cmd_line( dsi ), dsi.binary_path.begin(), pid_buff, 0 );
+}
+
+//____________________________________________________________________________//
+
+static void
+start_dbx_in_emacs( dbg_startup_info const& /*dsi*/ )
+{
+// char dbg_cmd_buff[500]; // !! ??
+//
+// ::snprintf( dbg_cmd_buff, sizeof(dbg_cmd_buff), "(progn (dbx \"dbx -q -c cont %s %ld\"))", dsi.binary_path.begin(), dsi.pid );
+
+// start_debugger_in_emacs( dsi, "emacs", dbg_cmd_buff );
+}
+
+//____________________________________________________________________________//
+
+static void
+start_dbx_in_xemacs( dbg_startup_info const& )
+{
+ // !! ??
+}
+
+//____________________________________________________________________________//
+
+static void
+start_dbx_in_ddd( dbg_startup_info const& dsi )
+{
+ char const* title = prepare_window_title( dsi );
+ if( !title )
+ return;
+
+ char pid_buff[16]; // !! ??
+ ::snprintf( pid_buff, sizeof(pid_buff), "%ld", dsi.pid );
+
+ safe_execlp( "ddd", "-display", dsi.display.begin(),
+ "--dbx", "-q", "-c", prepare_dbx_cmd_line( dsi, false ), dsi.binary_path.begin(), pid_buff, 0 );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** debug::info_t ************** //
+// ************************************************************************** //
+
+static struct info_t {
+ // Constructor
+ info_t();
+
+ // Public properties
+ unit_test::readwrite_property<std::string> p_dbg;
+
+ // Data members
+ std::map<std::string,dbg_starter> m_dbg_starter_reg;
+} s_info;
+
+//____________________________________________________________________________//
+
+info_t::info_t()
+{
+ p_dbg.value = ::getenv( "DISPLAY" )
+ ? std::string( BOOST_STRINGIZE( BOOST_TEST_GUI_DBG ) )
+ : std::string( BOOST_STRINGIZE( BOOST_TEST_CNL_DBG ) );
+
+ m_dbg_starter_reg[std::string("gdb")] = &start_gdb_in_console;
+ m_dbg_starter_reg[std::string("gdb-emacs")] = &start_gdb_in_emacs;
+ m_dbg_starter_reg[std::string("gdb-xterm")] = &start_gdb_in_xterm;
+ m_dbg_starter_reg[std::string("gdb-xemacs")] = &start_gdb_in_xemacs;
+
+ m_dbg_starter_reg[std::string("dbx")] = &start_dbx_in_console;
+ m_dbg_starter_reg[std::string("dbx-emacs")] = &start_dbx_in_emacs;
+ m_dbg_starter_reg[std::string("dbx-xterm")] = &start_dbx_in_xterm;
+ m_dbg_starter_reg[std::string("dbx-xemacs")] = &start_dbx_in_xemacs;
+ m_dbg_starter_reg[std::string("dbx-ddd")] = &start_dbx_in_ddd;
+}
+
+//____________________________________________________________________________//
+
+#endif
+
+} // local namespace
+
+// ************************************************************************** //
+// ************** check if program is running under debugger ************** //
+// ************************************************************************** //
+
+bool
+under_debugger()
+{
+#if defined(BOOST_WIN32_BASED_DEBUG) // *********************** WIN32
+
+ return !!s_info.m_is_debugger_present && s_info.m_is_debugger_present();
+
+#elif defined(BOOST_UNIX_BASED_DEBUG) // ********************** UNIX
+
+ // !! ?? could/should we cache the result somehow?
+ const_string dbg_list = BOOST_TEST_STRINGIZE( BOOST_TEST_DBG_LIST );
+
+ pid_t pid = ::getpid();
+
+ while( pid != 0 ) {
+ process_info pi( pid );
+
+ // !! ?? should we use tokenizer here instead?
+ if( dbg_list.find( pi.binary_name() ) != const_string::npos )
+ return true;
+
+ pid = (pi.parent_pid() == pid ? 0 : pi.parent_pid());
+ }
+
+ return false;
+
+#else // ****************************************************** default
+
+ return false;
+
+#endif
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** cause program to break execution ************** //
+// ************** in debugger at call point ************** //
+// ************************************************************************** //
+
+void
+debugger_break()
+{
+ // !! ?? auto-start debugger?
+
+#if defined(BOOST_WIN32_BASED_DEBUG) // *********************** WIN32
+
+#if BOOST_WORKAROUND(BOOST_MSVC, >= 1300) || \
+ BOOST_WORKAROUND(__GNUC__, >= 3) && !defined(__MINGW32__) || \
+ defined(__INTEL_COMPILER)
+# define BOOST_DEBUG_BREAK __debugbreak
+#else
+# define BOOST_DEBUG_BREAK DebugBreak
+#endif
+
+#ifndef __MINGW32__
+ if( !under_debugger() ) {
+ __try {
+ __try {
+ BOOST_DEBUG_BREAK();
+ }
+ __except( UnhandledExceptionFilter(GetExceptionInformation()) )
+ {
+ // User opted to ignore the breakpoint
+ return;
+ }
+ }
+ __except (EXCEPTION_EXECUTE_HANDLER)
+ {
+ // If we got here, the user has pushed Debug. Debugger is already attached to our process and we
+ // continue to let the another BOOST_DEBUG_BREAK to be called.
+ }
+ }
+#endif
+
+ BOOST_DEBUG_BREAK();
+
+#elif defined(BOOST_UNIX_BASED_DEBUG) // ********************** UNIX
+
+ ::kill( ::getpid(), SIGTRAP );
+
+#else // ****************************************************** default
+
+#endif
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** console debugger setup ************** //
+// ************************************************************************** //
+
+#if defined(BOOST_UNIX_BASED_DEBUG) // ************************ UNIX
+
+std::string
+set_debugger( unit_test::const_string dbg_id, dbg_starter s )
+{
+ std::string old = s_info.p_dbg;
+
+ assign_op( s_info.p_dbg.value, dbg_id, 0 );
+
+ if( !!s )
+ s_info.m_dbg_starter_reg[s_info.p_dbg] = s;
+
+ return old;
+}
+
+#else // ***************************************************** default
+
+std::string
+set_debugger( unit_test::const_string, dbg_starter )
+{
+ return std::string();
+}
+
+#endif
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** attach debugger to the current process ************** //
+// ************************************************************************** //
+
+bool
+attach_debugger( bool break_or_continue )
+{
+ if( under_debugger() )
+ return false;
+
+#if defined(BOOST_WIN32_BASED_DEBUG) // *********************** WIN32
+
+ const int MAX_CMD_LINE = 200;
+
+ // *************************************************** //
+ // Debugger "ready" event
+
+ SECURITY_ATTRIBUTES attr;
+ attr.nLength = sizeof(attr);
+ attr.lpSecurityDescriptor = NULL;
+ attr.bInheritHandle = true;
+
+ // manual resettable, initially non signaled, unnamed event,
+ // that will signal me that debugger initialization is done
+ HANDLE dbg_init_done_ev = ::CreateEvent(
+ &attr, // pointer to security attributes
+ true, // flag for manual-reset event
+ false, // flag for initial state
+ NULL // pointer to event-object name
+ );
+
+ if( !dbg_init_done_ev )
+ return false;
+
+ // *************************************************** //
+ // Debugger command line format
+
+ HKEY reg_key;
+
+ if( !s_info.m_reg_open_key || (*s_info.m_reg_open_key)(
+ HKEY_LOCAL_MACHINE, // handle of open key
+ "Software\\Microsoft\\Windows NT\\CurrentVersion\\AeDebug", // name of subkey to open
+ ®_key ) != ERROR_SUCCESS ) // address of handle of open key
+ return false;
+
+ char format[MAX_CMD_LINE];
+ DWORD format_size = MAX_CMD_LINE;
+ DWORD type = REG_SZ;
+
+ if( !s_info.m_reg_query_value || (*s_info.m_reg_query_value)(
+ reg_key, // handle of open key
+ "Debugger", // name of subkey to query
+ 0, // reserved
+ &type, // value type
+ (LPBYTE)format, // buffer for returned string
+ &format_size ) != ERROR_SUCCESS ) // in: buffer size; out: actual size of returned string
+ return false;
+
+ if( !s_info.m_reg_close_key || (*s_info.m_reg_close_key)( reg_key ) != ERROR_SUCCESS )
+ return false;
+
+ // *************************************************** //
+ // Debugger command line
+
+ char cmd_line[MAX_CMD_LINE];
+ std::sprintf( cmd_line, format, ::GetCurrentProcessId(), dbg_init_done_ev );
+
+ // *************************************************** //
+ // Debugger window parameters
+
+ STARTUPINFOA startup_info;
+ std::memset( &startup_info, 0, sizeof(startup_info) );
+
+ startup_info.cb = sizeof(startup_info);
+ startup_info.dwFlags = STARTF_USESHOWWINDOW;
+ startup_info.wShowWindow = SW_SHOWNORMAL;
+
+ // debugger process s_info
+ PROCESS_INFORMATION debugger_info;
+
+ bool created = !!::CreateProcessA(
+ NULL, // pointer to name of executable module; NULL - use the one in command line
+ cmd_line, // pointer to command line string
+ NULL, // pointer to process security attributes; NULL - debugger's handle can't be inherited
+ NULL, // pointer to thread security attributes; NULL - debugger's handle can't be inherited
+ true, // debugger inherit opened handles
+ 0, // priority flags; 0 - normal priority
+ NULL, // pointer to new environment block; NULL - use this process environment
+ NULL, // pointer to current directory name; NULL - use this process correct directory
+ &startup_info, // pointer to STARTUPINFO that specifies main window appearance
+ &debugger_info // pointer to PROCESS_INFORMATION that will contain the new process identification
+ );
+
+ if( created )
+ ::WaitForSingleObject( dbg_init_done_ev, INFINITE );
+
+ ::CloseHandle( dbg_init_done_ev );
+
+ if( !created )
+ return false;
+
+ if( break_or_continue )
+ debugger_break();
+
+ return true;
+
+#elif defined(BOOST_UNIX_BASED_DEBUG) // ********************** UNIX
+
+ char init_done_lock_fn[] = "/tmp/btl_dbg_init_done_XXXXXX";
+ fd_holder init_done_lock_fd( ::mkstemp( init_done_lock_fn ) );
+
+ if( init_done_lock_fd == -1 )
+ return false;
+
+ pid_t child_pid = fork();
+
+ if( child_pid == -1 )
+ return false;
+
+ if( child_pid != 0 ) { // parent process - here we will start the debugger
+ dbg_startup_info dsi;
+
+ process_info pi( child_pid );
+ if( pi.binary_path().is_empty() )
+ ::exit( -1 );
+
+ dsi.pid = child_pid;
+ dsi.break_or_continue = break_or_continue;
+ dsi.binary_path = pi.binary_path();
+ dsi.display = ::getenv( "DISPLAY" );
+ dsi.init_done_lock = init_done_lock_fn;
+
+ dbg_starter starter = s_info.m_dbg_starter_reg[s_info.p_dbg];
+ if( !!starter )
+ starter( dsi );
+
+ ::perror( "Boost.Test execution monitor failed to start a debugger:" );
+
+ ::exit( -1 );
+ }
+
+ // child process - here we will continue our test module execution ; // !! ?? should it be vice versa
+
+ while( ::access( init_done_lock_fn, F_OK ) == 0 ) {
+ struct timeval to = { 0, 100 };
+
+ ::select( 0, 0, 0, 0, &to );
+ }
+
+// char dummy;
+// while( ::read( init_done_lock_fd, &dummy, sizeof(char) ) == 0 );
+
+ if( break_or_continue )
+ debugger_break();
+
+ return true;
+
+#else // ****************************************************** default
+
+ return false;
+
+#endif
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** switch on/off detect memory leaks feature ************** //
+// ************************************************************************** //
+
+void
+detect_memory_leaks( bool on_off )
+{
+ unit_test::ut_detail::ignore_unused_variable_warning( on_off );
+
+#ifdef BOOST_MS_CRT_BASED_DEBUG
+ int flags = _CrtSetDbgFlag( _CRTDBG_REPORT_FLAG );
+
+ if( !on_off )
+ flags &= ~_CRTDBG_LEAK_CHECK_DF;
+ else {
+ flags |= _CRTDBG_LEAK_CHECK_DF;
+ _CrtSetReportMode(_CRT_WARN, _CRTDBG_MODE_FILE);
+ _CrtSetReportFile(_CRT_WARN, _CRTDBG_FILE_STDOUT);
+ }
+
+ _CrtSetDbgFlag ( flags );
+#endif // BOOST_MS_CRT_BASED_DEBUG
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** cause program to break execution in ************** //
+// ************** debugger at specific allocation point ************** //
+// ************************************************************************** //
+
+void
+break_memory_alloc( long mem_alloc_order_num )
+{
+ unit_test::ut_detail::ignore_unused_variable_warning( mem_alloc_order_num );
+
+#ifdef BOOST_MS_CRT_BASED_DEBUG
+ _CrtSetBreakAlloc( mem_alloc_order_num );
+#endif // BOOST_MS_CRT_BASED_DEBUG
+}
+
+} // namespace debug
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_DEBUG_API_IPP_112006GER
+
diff --git a/ndnboost/test/impl/exception_safety.ipp b/ndnboost/test/impl/exception_safety.ipp
new file mode 100644
index 0000000..c3680a9
--- /dev/null
+++ b/ndnboost/test/impl/exception_safety.ipp
@@ -0,0 +1,537 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// Use, modification, and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : Facilities to perform exception safety tests
+// ***************************************************************************
+
+#ifndef BOOST_TEST_EXECUTION_SAFETY_IPP_112005GER
+#define BOOST_TEST_EXECUTION_SAFETY_IPP_112005GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+#if BOOST_TEST_SUPPORT_INTERACTION_TESTING
+
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+#include <ndnboost/test/utils/callback.hpp>
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/utils/iterator/token_iterator.hpp>
+
+#include <ndnboost/test/interaction_based.hpp>
+#include <ndnboost/test/test_tools.hpp>
+#include <ndnboost/test/unit_test_log.hpp>
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/test_observer.hpp>
+#include <ndnboost/test/debug.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+// Boost
+#include <ndnboost/lexical_cast.hpp>
+
+// STL
+#include <vector>
+#include <cstdlib>
+#include <map>
+#include <iomanip>
+#include <cctype>
+#include <ndnboost/limits.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+using namespace ::ndnboost::unit_test;
+
+namespace itest {
+
+// ************************************************************************** //
+// ************** execution_path_point ************** //
+// ************************************************************************** //
+
+enum exec_path_point_type { EPP_SCOPE, EPP_EXCEPT, EPP_DECISION, EPP_ALLOC };
+
+struct execution_path_point {
+ execution_path_point( exec_path_point_type t, const_string file, std::size_t line_num )
+ : m_type( t )
+ , m_file_name( file )
+ , m_line_num( line_num )
+ {}
+
+ exec_path_point_type m_type;
+ const_string m_file_name;
+ std::size_t m_line_num;
+
+ // Execution path point specific
+ struct decision_data {
+ bool value;
+ unsigned forced_exception_point;
+ };
+ struct scope_data {
+ unsigned size;
+ char const* name;
+ };
+ struct except_data {
+ char const* description;
+ };
+ struct alloc_data {
+ void* ptr;
+ std::size_t size;
+ };
+
+ union {
+ struct decision_data m_decision;
+ struct scope_data m_scope;
+ struct except_data m_except;
+ struct alloc_data m_alloc;
+ };
+};
+
+// ************************************************************************** //
+// ************** exception safety test implementation ************** //
+// ************************************************************************** //
+
+struct exception_safety_tester : itest::manager, test_observer {
+ // helpers types
+ struct unique_exception {};
+
+ // Constructor
+ explicit exception_safety_tester( const_string test_name );
+ ~exception_safety_tester();
+
+ // check last run and prepare for next
+ bool next_execution_path();
+
+ // memory tracking
+
+ // manager interface implementation
+ virtual void exception_point( const_string file, std::size_t line_num, const_string description );
+ virtual bool decision_point( const_string file, std::size_t line_num );
+ virtual unsigned enter_scope( const_string file, std::size_t line_num, const_string scope_name );
+ virtual void leave_scope( unsigned enter_scope_point );
+ virtual void allocated( const_string file, std::size_t line_num, void* p, std::size_t s );
+ virtual void freed( void* p );
+
+ // test observer interface
+ virtual void assertion_result( bool passed );
+ virtual int priority() { return (std::numeric_limits<int>::max)(); } // we want this observer to run the last
+
+private:
+ void failure_point();
+ void report_error();
+
+ typedef std::vector<execution_path_point> exec_path;
+ typedef std::map<void*,unsigned> registry;
+
+ // Data members
+ bool m_internal_activity;
+
+ unsigned m_exception_point_counter;
+ unsigned m_forced_exception_point;
+
+ unsigned m_exec_path_point;
+ exec_path m_execution_path;
+
+ unsigned m_exec_path_counter;
+ unsigned m_break_exec_path;
+
+ bool m_invairant_failed;
+ registry m_memory_in_use;
+};
+
+//____________________________________________________________________________//
+
+struct activity_guard {
+ bool& m_v;
+
+ activity_guard( bool& v ) : m_v( v ) { m_v = true; }
+ ~activity_guard() { m_v = false; }
+};
+
+//____________________________________________________________________________//
+
+exception_safety_tester::exception_safety_tester( const_string test_name )
+: m_internal_activity( true )
+, m_exception_point_counter( 0 )
+, m_forced_exception_point( 1 )
+, m_exec_path_point( 0 )
+, m_exec_path_counter( 1 )
+, m_break_exec_path( static_cast<unsigned>(-1) )
+, m_invairant_failed( false )
+{
+ framework::register_observer( *this );
+
+ if( !runtime_config::break_exec_path().is_empty() ) {
+ using namespace unit_test;
+
+ string_token_iterator tit( runtime_config::break_exec_path(),
+ (dropped_delimeters = ":",kept_delimeters = " ") );
+
+ const_string test_to_break = *tit;
+
+ if( test_to_break == test_name ) {
+ ++tit;
+
+ m_break_exec_path = lexical_cast<unsigned>( *tit );
+ }
+ }
+
+ m_internal_activity = false;
+}
+
+//____________________________________________________________________________//
+
+exception_safety_tester::~exception_safety_tester()
+{
+ m_internal_activity = true;
+
+ framework::deregister_observer( *this );
+}
+
+//____________________________________________________________________________//
+
+bool
+exception_safety_tester::next_execution_path()
+{
+ activity_guard ag( m_internal_activity );
+
+ // check memory usage
+ if( m_execution_path.size() > 0 ) {
+ bool errors_detected = m_invairant_failed || (m_memory_in_use.size() != 0);
+ framework::assertion_result( !errors_detected );
+
+ if( errors_detected )
+ report_error();
+
+ m_memory_in_use.clear();
+ }
+
+ m_exec_path_point = 0;
+ m_exception_point_counter = 0;
+ m_invairant_failed = false;
+ ++m_exec_path_counter;
+
+ while( m_execution_path.size() > 0 ) {
+ switch( m_execution_path.back().m_type ) {
+ case EPP_SCOPE:
+ case EPP_ALLOC:
+ m_execution_path.pop_back();
+ break;
+
+ case EPP_DECISION:
+ if( !m_execution_path.back().m_decision.value ) {
+ m_execution_path.pop_back();
+ break;
+ }
+
+ m_execution_path.back().m_decision.value = false;
+ m_forced_exception_point = m_execution_path.back().m_decision.forced_exception_point;
+ return true;
+
+ case EPP_EXCEPT:
+ m_execution_path.pop_back();
+ ++m_forced_exception_point;
+ return true;
+ }
+ }
+
+ BOOST_TEST_MESSAGE( "Total tested " << --m_exec_path_counter << " execution path" );
+
+ return false;
+}
+
+//____________________________________________________________________________//
+
+void
+exception_safety_tester::exception_point( const_string file, std::size_t line_num, const_string description )
+{
+ activity_guard ag( m_internal_activity );
+
+ if( ++m_exception_point_counter == m_forced_exception_point ) {
+ m_execution_path.push_back(
+ execution_path_point( EPP_EXCEPT, file, line_num ) );
+
+ m_execution_path.back().m_except.description = description.begin();
+
+ ++m_exec_path_point;
+
+ failure_point();
+ }
+}
+
+//____________________________________________________________________________//
+
+bool
+exception_safety_tester::decision_point( const_string file, std::size_t line_num )
+{
+ activity_guard ag( m_internal_activity );
+
+ if( m_exec_path_point < m_execution_path.size() ) {
+ BOOST_REQUIRE_MESSAGE( m_execution_path[m_exec_path_point].m_type == EPP_DECISION &&
+ m_execution_path[m_exec_path_point].m_file_name == file &&
+ m_execution_path[m_exec_path_point].m_line_num == line_num,
+ "Function under test exibit non-deterministic behavior" );
+ }
+ else {
+ m_execution_path.push_back(
+ execution_path_point( EPP_DECISION, file, line_num ) );
+
+ m_execution_path.back().m_decision.value = true;
+ m_execution_path.back().m_decision.forced_exception_point = m_forced_exception_point;
+ }
+
+ return m_execution_path[m_exec_path_point++].m_decision.value;
+}
+
+//____________________________________________________________________________//
+
+unsigned
+exception_safety_tester::enter_scope( const_string file, std::size_t line_num, const_string scope_name )
+{
+ activity_guard ag( m_internal_activity );
+
+ if( m_exec_path_point < m_execution_path.size() ) {
+ BOOST_REQUIRE_MESSAGE( m_execution_path[m_exec_path_point].m_type == EPP_SCOPE &&
+ m_execution_path[m_exec_path_point].m_file_name == file &&
+ m_execution_path[m_exec_path_point].m_line_num == line_num,
+ "Function under test exibit non-deterministic behavior" );
+ }
+ else {
+ m_execution_path.push_back(
+ execution_path_point( EPP_SCOPE, file, line_num ) );
+ }
+
+ m_execution_path[m_exec_path_point].m_scope.size = 0;
+ m_execution_path[m_exec_path_point].m_scope.name = scope_name.begin();
+
+ return m_exec_path_point++;
+}
+
+//____________________________________________________________________________//
+
+void
+exception_safety_tester::leave_scope( unsigned enter_scope_point )
+{
+ activity_guard ag( m_internal_activity );
+
+ BOOST_REQUIRE_MESSAGE( m_execution_path[enter_scope_point].m_type == EPP_SCOPE,
+ "Function under test exibit non-deterministic behavior" );
+
+ m_execution_path[enter_scope_point].m_scope.size = m_exec_path_point - enter_scope_point;
+}
+
+//____________________________________________________________________________//
+
+void
+exception_safety_tester::allocated( const_string file, std::size_t line_num, void* p, std::size_t s )
+{
+ if( m_internal_activity )
+ return;
+
+ activity_guard ag( m_internal_activity );
+
+ if( m_exec_path_point < m_execution_path.size() )
+ BOOST_REQUIRE_MESSAGE( m_execution_path[m_exec_path_point].m_type == EPP_ALLOC,
+ "Function under test exibit non-deterministic behavior" );
+ else
+ m_execution_path.push_back(
+ execution_path_point( EPP_ALLOC, file, line_num ) );
+
+ m_execution_path[m_exec_path_point].m_alloc.ptr = p;
+ m_execution_path[m_exec_path_point].m_alloc.size = s;
+
+ m_memory_in_use.insert( std::make_pair( p, m_exec_path_point++ ) );
+}
+
+//____________________________________________________________________________//
+
+void
+exception_safety_tester::freed( void* p )
+{
+ if( m_internal_activity )
+ return;
+
+ activity_guard ag( m_internal_activity );
+
+ registry::iterator it = m_memory_in_use.find( p );
+ if( it != m_memory_in_use.end() ) {
+ m_execution_path[it->second].m_alloc.ptr = 0;
+ m_memory_in_use.erase( it );
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+exception_safety_tester::assertion_result( bool passed )
+{
+ if( !m_internal_activity && !passed ) {
+ m_invairant_failed = true;
+
+ failure_point();
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+exception_safety_tester::failure_point()
+{
+ if( m_exec_path_counter == m_break_exec_path )
+ debug::debugger_break();
+
+ throw unique_exception();
+}
+
+//____________________________________________________________________________//
+
+namespace {
+
+inline void
+format_location( wrap_stringstream& formatter, execution_path_point const& /*p*/, unsigned indent )
+{
+ if( indent )
+ formatter << std::left << std::setw( indent ) << "";
+
+// !! ?? optional if( p.m_file_name )
+// formatter << p.m_file_name << '(' << p.m_line_num << "): ";
+}
+
+//____________________________________________________________________________//
+
+template<typename ExecPathIt>
+inline void
+format_execution_path( wrap_stringstream& formatter, ExecPathIt it, ExecPathIt end, unsigned indent = 0 )
+{
+ while( it != end ) {
+ switch( it->m_type ) {
+ case EPP_SCOPE:
+ format_location( formatter, *it, indent );
+ formatter << "> \"" << it->m_scope.name << "\"\n";
+ format_execution_path( formatter, it+1, it + it->m_scope.size, indent + 2 );
+ format_location( formatter, *it, indent );
+ formatter << "< \"" << it->m_scope.name << "\"\n";
+ it += it->m_scope.size;
+ break;
+
+ case EPP_DECISION:
+ format_location( formatter, *it, indent );
+ formatter << "Decision made as " << std::boolalpha << it->m_decision.value << '\n';
+ ++it;
+ break;
+
+ case EPP_EXCEPT:
+ format_location( formatter, *it, indent );
+ formatter << "Forced failure";
+ if( it->m_except.description )
+ formatter << ": " << it->m_except.description;
+ formatter << "\n";
+ ++it;
+ break;
+
+ case EPP_ALLOC:
+ if( it->m_alloc.ptr ) {
+ format_location( formatter, *it, indent );
+ formatter << "Allocated memory block 0x" << std::uppercase << it->m_alloc.ptr
+ << ", " << it->m_alloc.size << " bytes long: <";
+
+ unsigned i;
+ for( i = 0; i < std::min<std::size_t>( it->m_alloc.size, 8 ); i++ ) {
+ unsigned char c = static_cast<unsigned char*>(it->m_alloc.ptr)[i];
+ if( (std::isprint)( c ) )
+ formatter << c;
+ else
+ formatter << '.';
+ }
+
+ formatter << "> ";
+
+ for( i = 0; i < std::min<std::size_t>( it->m_alloc.size, 8 ); i++ ) {
+ unsigned c = static_cast<unsigned char*>(it->m_alloc.ptr)[i];
+ formatter << std::hex << std::uppercase << c << ' ';
+ }
+
+ formatter << "\n";
+ }
+ ++it;
+ break;
+ }
+ }
+}
+
+//____________________________________________________________________________//
+
+} // local namespace
+
+void
+exception_safety_tester::report_error()
+{
+ activity_guard ag( m_internal_activity );
+
+ unit_test_log << unit_test::log::begin( m_execution_path.back().m_file_name,
+ m_execution_path.back().m_line_num )
+ << log_all_errors;
+
+ wrap_stringstream formatter;
+
+ if( m_invairant_failed )
+ formatter << "Failed invariant";
+
+ if( m_memory_in_use.size() != 0 ) {
+ if( m_invairant_failed )
+ formatter << " and ";
+
+ formatter << static_cast<unsigned int>(m_memory_in_use.size()) << " memory leak";
+ if( m_memory_in_use.size() > 1 )
+ formatter << 's';
+ }
+ formatter << " detected in the execution path " << m_exec_path_counter << ":\n";
+
+ format_execution_path( formatter, m_execution_path.begin(), m_execution_path.end() );
+
+ unit_test_log << const_string( formatter.str() ) << unit_test::log::end();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** exception safety test ************** //
+// ************************************************************************** //
+
+void BOOST_TEST_DECL
+exception_safety( callback0<> const& F, const_string test_name )
+{
+ exception_safety_tester est( test_name );
+
+ do {
+ try {
+ F();
+ }
+ catch( exception_safety_tester::unique_exception const& ) {}
+
+ } while( est.next_execution_path() );
+}
+
+//____________________________________________________________________________//
+
+} // namespace itest
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // non-ancient compiler
+
+#endif // BOOST_TEST_EXECUTION_SAFETY_IPP_112005GER
diff --git a/ndnboost/test/impl/execution_monitor.ipp b/ndnboost/test/impl/execution_monitor.ipp
new file mode 100644
index 0000000..5337347
--- /dev/null
+++ b/ndnboost/test/impl/execution_monitor.ipp
@@ -0,0 +1,1367 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// (C) Copyright Beman Dawes and Ullrich Koethe 1995-2001.
+// Use, modification, and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : provides execution monitor implementation for all supported
+// configurations, including Microsoft structured exception based, unix signals
+// based and special workarounds for borland
+//
+// Note that when testing requirements or user wishes preclude use of this
+// file as a separate compilation unit, it may be included as a header file.
+//
+// Header dependencies are deliberately restricted to reduce coupling to other
+// boost libraries.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_EXECUTION_MONITOR_IPP_012205GER
+#define BOOST_TEST_EXECUTION_MONITOR_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/detail/workaround.hpp>
+#include <ndnboost/test/execution_monitor.hpp>
+#include <ndnboost/test/debug.hpp>
+
+// Boost
+#include <ndnboost/cstdlib.hpp> // for exit codes
+#include <ndnboost/config.hpp> // for workarounds
+#include <ndnboost/exception/get_error_info.hpp> // for get_error_info
+#include <ndnboost/exception/current_exception_cast.hpp> // for current_exception_cast
+
+// STL
+#include <string> // for std::string
+#include <new> // for std::bad_alloc
+#include <typeinfo> // for std::bad_cast, std::bad_typeid
+#include <exception> // for std::exception, std::bad_exception
+#include <stdexcept> // for std exception hierarchy
+#include <cstring> // for C string API
+#include <cassert> // for assert
+#include <cstddef> // for NULL
+#include <cstdio> // for vsnprintf
+#include <cstdarg> // for varargs
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::strerror; using ::strlen; using ::strncat; }
+#endif
+
+// to use vsnprintf
+#if defined(__SUNPRO_CC) || defined(__SunOS)
+# include <stdio.h>
+# include <stdarg.h>
+using std::va_list;
+#endif
+
+// to use vsnprintf
+#if defined(__QNXNTO__)
+# include <stdio.h>
+#endif
+
+#if defined(_WIN32) && !defined(BOOST_DISABLE_WIN32) && \
+ (!defined(__COMO__) && !defined(__MWERKS__) && !defined(__GNUC__) || \
+ BOOST_WORKAROUND(__MWERKS__, >= 0x3000))
+
+# define BOOST_SEH_BASED_SIGNAL_HANDLING
+
+# include <windows.h>
+
+# if defined(__MWERKS__) || (defined(_MSC_VER) && !defined(UNDER_CE))
+# include <eh.h>
+# endif
+
+# if defined(__BORLANDC__) && __BORLANDC__ >= 0x560 || defined(__MWERKS__)
+# include <stdint.h>
+# endif
+
+# if defined(__BORLANDC__) && __BORLANDC__ < 0x560
+ typedef unsigned uintptr_t;
+# endif
+
+# if BOOST_WORKAROUND(_MSC_VER, < 1300 ) || defined(UNDER_CE)
+typedef void* uintptr_t;
+# endif
+
+// for the FP control routines
+#include <float.h>
+
+#ifndef EM_INVALID
+#define EM_INVALID _EM_INVALID
+#endif
+
+#ifndef EM_DENORMAL
+#define EM_DENORMAL _EM_DENORMAL
+#endif
+
+#ifndef EM_ZERODIVIDE
+#define EM_ZERODIVIDE _EM_ZERODIVIDE
+#endif
+
+#ifndef EM_OVERFLOW
+#define EM_OVERFLOW _EM_OVERFLOW
+#endif
+
+#ifndef EM_UNDERFLOW
+#define EM_UNDERFLOW _EM_UNDERFLOW
+#endif
+
+#ifndef MCW_EM
+#define MCW_EM _MCW_EM
+#endif
+
+# if !defined(NDEBUG) && defined(_MSC_VER) && !defined(UNDER_CE)
+# include <crtdbg.h>
+# define BOOST_TEST_CRT_HOOK_TYPE _CRT_REPORT_HOOK
+# define BOOST_TEST_CRT_ASSERT _CRT_ASSERT
+# define BOOST_TEST_CRT_ERROR _CRT_ERROR
+# define BOOST_TEST_CRT_SET_HOOK(H) _CrtSetReportHook(H)
+# else
+# define BOOST_TEST_CRT_HOOK_TYPE void*
+# define BOOST_TEST_CRT_ASSERT 2
+# define BOOST_TEST_CRT_ERROR 1
+# define BOOST_TEST_CRT_SET_HOOK(H) (void*)(H)
+# endif
+
+# if !BOOST_WORKAROUND(_MSC_VER, >= 1400 ) || defined(UNDER_CE)
+
+typedef void* _invalid_parameter_handler;
+
+inline _invalid_parameter_handler
+_set_invalid_parameter_handler( _invalid_parameter_handler arg )
+{
+ return arg;
+}
+
+# endif
+
+# if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0564)) || defined(UNDER_CE)
+
+namespace { void _set_se_translator( void* ) {} }
+
+# endif
+
+#elif defined(BOOST_HAS_SIGACTION)
+
+# define BOOST_SIGACTION_BASED_SIGNAL_HANDLING
+
+# include <unistd.h>
+# include <signal.h>
+# include <setjmp.h>
+
+# if defined(__FreeBSD__)
+
+# ifndef SIGPOLL
+# define SIGPOLL SIGIO
+# endif
+
+# if (__FreeBSD_version < 70100)
+
+# define ILL_ILLADR 0 // ILL_RESAD_FAULT
+# define ILL_PRVOPC ILL_PRIVIN_FAULT
+# define ILL_ILLOPN 2 // ILL_RESOP_FAULT
+# define ILL_COPROC ILL_FPOP_FAULT
+
+# define BOOST_TEST_LIMITED_SIGNAL_DETAILS
+# define BOOST_TEST_IGNORE_SIGCHLD
+
+# endif
+# endif
+
+# if !defined(__CYGWIN__) && !defined(__QNXNTO__)
+# define BOOST_TEST_USE_ALT_STACK
+# endif
+
+# if defined(SIGPOLL) && !defined(__CYGWIN__) && \
+ !(defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && \
+ !defined(__NetBSD__) && \
+ !defined(__QNXNTO__)
+# define BOOST_TEST_CATCH_SIGPOLL
+# endif
+
+# ifdef BOOST_TEST_USE_ALT_STACK
+# define BOOST_TEST_ALT_STACK_SIZE SIGSTKSZ
+# endif
+
+#else
+
+# define BOOST_NO_SIGNAL_HANDLING
+
+#endif
+
+#ifndef UNDER_CE
+#include <errno.h>
+#endif
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+// ************************************************************************** //
+// ************** report_error ************** //
+// ************************************************************************** //
+
+namespace detail {
+
+#ifdef __BORLANDC__
+# define BOOST_TEST_VSNPRINTF( a1, a2, a3, a4 ) std::vsnprintf( (a1), (a2), (a3), (a4) )
+#elif BOOST_WORKAROUND(_MSC_VER, <= 1310) || \
+ BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3000)) || \
+ defined(UNDER_CE)
+# define BOOST_TEST_VSNPRINTF( a1, a2, a3, a4 ) _vsnprintf( (a1), (a2), (a3), (a4) )
+#else
+# define BOOST_TEST_VSNPRINTF( a1, a2, a3, a4 ) vsnprintf( (a1), (a2), (a3), (a4) )
+#endif
+
+template <typename ErrorInfo>
+typename ErrorInfo::value_type
+extract( ndnboost::exception const* ex )
+{
+ if( !ex )
+ return 0;
+
+ typename ErrorInfo::value_type const * val = ndnboost::get_error_info<ErrorInfo>( *ex );
+
+ return val ? *val : 0;
+}
+
+//____________________________________________________________________________//
+
+static void
+report_error( execution_exception::error_code ec, ndnboost::exception const* be, char const* format, va_list* args )
+{
+ static const int REPORT_ERROR_BUFFER_SIZE = 512;
+ static char buf[REPORT_ERROR_BUFFER_SIZE];
+
+ BOOST_TEST_VSNPRINTF( buf, sizeof(buf)-1, format, *args );
+ buf[sizeof(buf)-1] = 0;
+
+ va_end( *args );
+
+ throw execution_exception( ec, buf, execution_exception::location( extract<throw_file>( be ),
+ extract<throw_line>( be ),
+ extract<throw_function>( be ) ) );
+}
+
+//____________________________________________________________________________//
+
+static void
+report_error( execution_exception::error_code ec, char const* format, ... )
+{
+ va_list args;
+ va_start( args, format );
+
+ report_error( ec, 0, format, &args );
+}
+
+//____________________________________________________________________________//
+
+static void
+report_error( execution_exception::error_code ec, ndnboost::exception const* be, char const* format, ... )
+{
+ va_list args;
+ va_start( args, format );
+
+ report_error( ec, be, format, &args );
+}
+
+//____________________________________________________________________________//
+
+template<typename Tr,typename Functor>
+inline int
+do_invoke( Tr const& tr, Functor const& F )
+{
+ return tr ? (*tr)( F ) : F();
+}
+
+//____________________________________________________________________________//
+
+} // namespace detail
+
+#if defined(BOOST_SIGACTION_BASED_SIGNAL_HANDLING)
+
+// ************************************************************************** //
+// ************** Sigaction based signal handling ************** //
+// ************************************************************************** //
+
+namespace detail {
+
+// ************************************************************************** //
+// ************** ndnboost::detail::system_signal_exception ************** //
+// ************************************************************************** //
+
+class system_signal_exception {
+public:
+ // Constructor
+ system_signal_exception()
+ : m_sig_info( 0 )
+ , m_context( 0 )
+ {}
+
+ // Access methods
+ void operator()( siginfo_t* i, void* c )
+ {
+ m_sig_info = i;
+ m_context = c;
+ }
+ void report() const;
+
+private:
+ // Data members
+ siginfo_t* m_sig_info; // system signal detailed info
+ void* m_context; // signal context
+};
+
+//____________________________________________________________________________//
+
+void
+system_signal_exception::report() const
+{
+ if( !m_sig_info )
+ return; // no error actually occur?
+
+ switch( m_sig_info->si_code ) {
+ case SI_USER:
+ report_error( execution_exception::system_error,
+ "signal: generated by kill() (or family); uid=%d; pid=%d",
+ (int)m_sig_info->si_uid, (int)m_sig_info->si_pid );
+ break;
+ case SI_QUEUE:
+ report_error( execution_exception::system_error,
+ "signal: sent by sigqueue()" );
+ break;
+ case SI_TIMER:
+ report_error( execution_exception::system_error,
+ "signal: the expiration of a timer set by timer_settimer()" );
+ break;
+ case SI_ASYNCIO:
+ report_error( execution_exception::system_error,
+ "signal: generated by the completion of an asynchronous I/O request" );
+ break;
+ case SI_MESGQ:
+ report_error( execution_exception::system_error,
+ "signal: generated by the the arrival of a message on an empty message queue" );
+ break;
+ default:
+ break;
+ }
+
+ switch( m_sig_info->si_signo ) {
+ case SIGILL:
+ switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+ case ILL_ILLOPC:
+ report_error( execution_exception::system_fatal_error,
+ "signal: illegal opcode; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case ILL_ILLTRP:
+ report_error( execution_exception::system_fatal_error,
+ "signal: illegal trap; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case ILL_PRVREG:
+ report_error( execution_exception::system_fatal_error,
+ "signal: privileged register; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case ILL_BADSTK:
+ report_error( execution_exception::system_fatal_error,
+ "signal: internal stack error; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+#endif
+ case ILL_ILLOPN:
+ report_error( execution_exception::system_fatal_error,
+ "signal: illegal operand; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case ILL_ILLADR:
+ report_error( execution_exception::system_fatal_error,
+ "signal: illegal addressing mode; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case ILL_PRVOPC:
+ report_error( execution_exception::system_fatal_error,
+ "signal: privileged opcode; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case ILL_COPROC:
+ report_error( execution_exception::system_fatal_error,
+ "signal: co-processor error; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ default:
+ report_error( execution_exception::system_fatal_error,
+ "signal: SIGILL, si_code: %d (illegal instruction; address of failing instruction: 0x%08lx)",
+ m_sig_info->si_addr, m_sig_info->si_code );
+ break;
+ }
+ break;
+
+ case SIGFPE:
+ switch( m_sig_info->si_code ) {
+ case FPE_INTDIV:
+ report_error( execution_exception::system_error,
+ "signal: integer divide by zero; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_INTOVF:
+ report_error( execution_exception::system_error,
+ "signal: integer overflow; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_FLTDIV:
+ report_error( execution_exception::system_error,
+ "signal: floating point divide by zero; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_FLTOVF:
+ report_error( execution_exception::system_error,
+ "signal: floating point overflow; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_FLTUND:
+ report_error( execution_exception::system_error,
+ "signal: floating point underflow; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_FLTRES:
+ report_error( execution_exception::system_error,
+ "signal: floating point inexact result; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_FLTINV:
+ report_error( execution_exception::system_error,
+ "signal: invalid floating point operation; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ case FPE_FLTSUB:
+ report_error( execution_exception::system_error,
+ "signal: subscript out of range; address of failing instruction: 0x%08lx",
+ m_sig_info->si_addr );
+ break;
+ default:
+ report_error( execution_exception::system_error,
+ "signal: SIGFPE, si_code: %d (errnoneous arithmetic operations; address of failing instruction: 0x%08lx)",
+ m_sig_info->si_addr, m_sig_info->si_code );
+ break;
+ }
+ break;
+
+ case SIGSEGV:
+ switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+ case SEGV_MAPERR:
+ report_error( execution_exception::system_fatal_error,
+ "memory access violation at address: 0x%08lx: no mapping at fault address",
+ m_sig_info->si_addr );
+ break;
+ case SEGV_ACCERR:
+ report_error( execution_exception::system_fatal_error,
+ "memory access violation at address: 0x%08lx: invalid permissions",
+ m_sig_info->si_addr );
+ break;
+#endif
+ default:
+ report_error( execution_exception::system_fatal_error,
+ "signal: SIGSEGV, si_code: %d (memory access violation at address: 0x%08lx)",
+ m_sig_info->si_addr, m_sig_info->si_code );
+ break;
+ }
+ break;
+
+ case SIGBUS:
+ switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+ case BUS_ADRALN:
+ report_error( execution_exception::system_fatal_error,
+ "memory access violation at address: 0x%08lx: invalid address alignment",
+ m_sig_info->si_addr );
+ break;
+ case BUS_ADRERR:
+ report_error( execution_exception::system_fatal_error,
+ "memory access violation at address: 0x%08lx: non-existent physical address",
+ m_sig_info->si_addr );
+ break;
+ case BUS_OBJERR:
+ report_error( execution_exception::system_fatal_error,
+ "memory access violation at address: 0x%08lx: object specific hardware error",
+ m_sig_info->si_addr );
+ break;
+#endif
+ default:
+ report_error( execution_exception::system_fatal_error,
+ "signal: SIGSEGV, si_code: %d (memory access violation at address: 0x%08lx)",
+ m_sig_info->si_addr, m_sig_info->si_code );
+ break;
+ }
+ break;
+
+ case SIGCHLD:
+ switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+ case CLD_EXITED:
+ report_error( execution_exception::system_error,
+ "child has exited; pid: %d; uid: %d; exit value: %d",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
+ break;
+ case CLD_KILLED:
+ report_error( execution_exception::system_error,
+ "child was killed; pid: %d; uid: %d; exit value: %d",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
+ break;
+ case CLD_DUMPED:
+ report_error( execution_exception::system_error,
+ "child terminated abnormally; pid: %d; uid: %d; exit value: %d",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
+ break;
+ case CLD_TRAPPED:
+ report_error( execution_exception::system_error,
+ "traced child has trapped; pid: %d; uid: %d; exit value: %d",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
+ break;
+ case CLD_STOPPED:
+ report_error( execution_exception::system_error,
+ "child has stopped; pid: %d; uid: %d; exit value: %d",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
+ break;
+ case CLD_CONTINUED:
+ report_error( execution_exception::system_error,
+ "stopped child had continued; pid: %d; uid: %d; exit value: %d",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status );
+ break;
+#endif
+ default:
+ report_error( execution_exception::system_error,
+ "signal: SIGCHLD, si_code: %d (child process has terminated; pid: %d; uid: %d; exit value: %d)",
+ (int)m_sig_info->si_pid, (int)m_sig_info->si_uid, (int)m_sig_info->si_status, m_sig_info->si_code );
+ break;
+ }
+ break;
+
+#if defined(BOOST_TEST_CATCH_SIGPOLL)
+
+ case SIGPOLL:
+ switch( m_sig_info->si_code ) {
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+ case POLL_IN:
+ report_error( execution_exception::system_error,
+ "data input available; band event %d",
+ (int)m_sig_info->si_band );
+ break;
+ case POLL_OUT:
+ report_error( execution_exception::system_error,
+ "output buffers available; band event %d",
+ (int)m_sig_info->si_band );
+ break;
+ case POLL_MSG:
+ report_error( execution_exception::system_error,
+ "input message available; band event %d",
+ (int)m_sig_info->si_band );
+ break;
+ case POLL_ERR:
+ report_error( execution_exception::system_error,
+ "i/o error; band event %d",
+ (int)m_sig_info->si_band );
+ break;
+ case POLL_PRI:
+ report_error( execution_exception::system_error,
+ "high priority input available; band event %d",
+ (int)m_sig_info->si_band );
+ break;
+#if defined(POLL_ERR) && defined(POLL_HUP) && (POLL_ERR - POLL_HUP)
+ case POLL_HUP:
+ report_error( execution_exception::system_error,
+ "device disconnected; band event %d",
+ (int)m_sig_info->si_band );
+ break;
+#endif
+#endif
+ default:
+ report_error( execution_exception::system_error,
+ "signal: SIGPOLL, si_code: %d (asynchronous I/O event occured; band event %d)",
+ (int)m_sig_info->si_band, m_sig_info->si_code );
+ break;
+ }
+ break;
+
+#endif
+
+ case SIGABRT:
+ report_error( execution_exception::system_error,
+ "signal: SIGABRT (application abort requested)" );
+ break;
+
+ case SIGALRM:
+ report_error( execution_exception::timeout_error,
+ "signal: SIGALRM (timeout while executing function)" );
+ break;
+
+ default:
+ report_error( execution_exception::system_error, "unrecognized signal" );
+ }
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** ndnboost::detail::signal_action ************** //
+// ************************************************************************** //
+
+// Forward declaration
+extern "C" {
+static void execution_monitor_jumping_signal_handler( int sig, siginfo_t* info, void* context );
+static void execution_monitor_attaching_signal_handler( int sig, siginfo_t* info, void* context );
+}
+
+class signal_action {
+ typedef struct sigaction* sigaction_ptr;
+public:
+ //Constructor
+ signal_action();
+ signal_action( int sig, bool install, bool attach_dbg, char* alt_stack );
+ ~signal_action();
+
+private:
+ // Data members
+ int m_sig;
+ bool m_installed;
+ struct sigaction m_new_action;
+ struct sigaction m_old_action;
+};
+
+//____________________________________________________________________________//
+
+signal_action::signal_action()
+: m_installed( false )
+{}
+
+//____________________________________________________________________________//
+
+signal_action::signal_action( int sig, bool install, bool attach_dbg, char* alt_stack )
+: m_sig( sig )
+, m_installed( install )
+{
+ if( !install )
+ return;
+
+ std::memset( &m_new_action, 0, sizeof(struct sigaction) );
+
+ BOOST_TEST_SYS_ASSERT( ::sigaction( m_sig , sigaction_ptr(), &m_new_action ) != -1 );
+
+ if( m_new_action.sa_sigaction || m_new_action.sa_handler ) {
+ m_installed = false;
+ return;
+ }
+
+ m_new_action.sa_flags |= SA_SIGINFO;
+ m_new_action.sa_sigaction = attach_dbg ? &execution_monitor_attaching_signal_handler
+ : &execution_monitor_jumping_signal_handler;
+ BOOST_TEST_SYS_ASSERT( sigemptyset( &m_new_action.sa_mask ) != -1 );
+
+#ifdef BOOST_TEST_USE_ALT_STACK
+ if( alt_stack )
+ m_new_action.sa_flags |= SA_ONSTACK;
+#endif
+
+ BOOST_TEST_SYS_ASSERT( ::sigaction( m_sig, &m_new_action, &m_old_action ) != -1 );
+}
+
+//____________________________________________________________________________//
+
+signal_action::~signal_action()
+{
+ if( m_installed )
+ ::sigaction( m_sig, &m_old_action , sigaction_ptr() );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** ndnboost::detail::signal_handler ************** //
+// ************************************************************************** //
+
+class signal_handler {
+public:
+ // Constructor
+ explicit signal_handler( bool catch_system_errors, int timeout, bool attach_dbg, char* alt_stack );
+
+ // Destructor
+ ~signal_handler();
+
+ // access methods
+ static sigjmp_buf& jump_buffer()
+ {
+ assert( !!s_active_handler );
+
+ return s_active_handler->m_sigjmp_buf;
+ }
+
+ static system_signal_exception& sys_sig()
+ {
+ assert( !!s_active_handler );
+
+ return s_active_handler->m_sys_sig;
+ }
+
+private:
+ // Data members
+ signal_handler* m_prev_handler;
+ int m_timeout;
+
+ signal_action m_ILL_action;
+ signal_action m_FPE_action;
+ signal_action m_SEGV_action;
+ signal_action m_BUS_action;
+ signal_action m_CHLD_action;
+ signal_action m_POLL_action;
+ signal_action m_ABRT_action;
+ signal_action m_ALRM_action;
+
+ sigjmp_buf m_sigjmp_buf;
+ system_signal_exception m_sys_sig;
+
+ static signal_handler* s_active_handler;
+};
+
+// !! need to be placed in thread specific storage
+typedef signal_handler* signal_handler_ptr;
+signal_handler* signal_handler::s_active_handler = signal_handler_ptr();
+
+//____________________________________________________________________________//
+
+signal_handler::signal_handler( bool catch_system_errors, int timeout, bool attach_dbg, char* alt_stack )
+: m_prev_handler( s_active_handler )
+, m_timeout( timeout )
+, m_ILL_action ( SIGILL , catch_system_errors, attach_dbg, alt_stack )
+, m_FPE_action ( SIGFPE , catch_system_errors, attach_dbg, alt_stack )
+, m_SEGV_action( SIGSEGV, catch_system_errors, attach_dbg, alt_stack )
+, m_BUS_action ( SIGBUS , catch_system_errors, attach_dbg, alt_stack )
+#ifndef BOOST_TEST_IGNORE_SIGCHLD
+, m_CHLD_action( SIGCHLD, catch_system_errors, attach_dbg, alt_stack )
+#endif
+#ifdef BOOST_TEST_CATCH_SIGPOLL
+, m_POLL_action( SIGPOLL, catch_system_errors, attach_dbg, alt_stack )
+#endif
+, m_ABRT_action( SIGABRT, catch_system_errors, attach_dbg, alt_stack )
+, m_ALRM_action( SIGALRM, timeout > 0 , attach_dbg, alt_stack )
+{
+ s_active_handler = this;
+
+ if( m_timeout > 0 ) {
+ ::alarm( 0 );
+ ::alarm( timeout );
+ }
+
+#ifdef BOOST_TEST_USE_ALT_STACK
+ if( alt_stack ) {
+ stack_t sigstk;
+ std::memset( &sigstk, 0, sizeof(stack_t) );
+
+ BOOST_TEST_SYS_ASSERT( ::sigaltstack( 0, &sigstk ) != -1 );
+
+ if( sigstk.ss_flags & SS_DISABLE ) {
+ sigstk.ss_sp = alt_stack;
+ sigstk.ss_size = BOOST_TEST_ALT_STACK_SIZE;
+ sigstk.ss_flags = 0;
+ BOOST_TEST_SYS_ASSERT( ::sigaltstack( &sigstk, 0 ) != -1 );
+ }
+ }
+#endif
+}
+
+//____________________________________________________________________________//
+
+signal_handler::~signal_handler()
+{
+ assert( s_active_handler == this );
+
+ if( m_timeout > 0 )
+ ::alarm( 0 );
+
+#ifdef BOOST_TEST_USE_ALT_STACK
+#ifdef __GNUC__
+ // We shouldn't need to explicitly initialize all the members here,
+ // but gcc warns if we don't, so add initializers for each of the
+ // members specified in the POSIX std:
+ stack_t sigstk = { 0, 0, 0 };
+#else
+ stack_t sigstk = { };
+#endif
+
+ sigstk.ss_size = MINSIGSTKSZ;
+ sigstk.ss_flags = SS_DISABLE;
+ BOOST_TEST_SYS_ASSERT( ::sigaltstack( &sigstk, 0 ) != -1 );
+#endif
+
+ s_active_handler = m_prev_handler;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** execution_monitor_signal_handler ************** //
+// ************************************************************************** //
+
+extern "C" {
+
+static bool ignore_sigchild( siginfo_t* info )
+{
+ return info->si_signo == SIGCHLD
+#ifndef BOOST_TEST_LIMITED_SIGNAL_DETAILS
+ && info->si_code == CLD_EXITED
+#endif
+#ifdef BOOST_TEST_IGNORE_NON_ZERO_CHILD_CODE
+ ;
+#else
+ && (int)info->si_status == 0;
+#endif
+}
+
+//____________________________________________________________________________//
+
+static void execution_monitor_jumping_signal_handler( int sig, siginfo_t* info, void* context )
+{
+ if( ignore_sigchild( info ) )
+ return;
+
+ signal_handler::sys_sig()( info, context );
+
+ siglongjmp( signal_handler::jump_buffer(), sig );
+}
+
+//____________________________________________________________________________//
+
+static void execution_monitor_attaching_signal_handler( int sig, siginfo_t* info, void* context )
+{
+ if( ignore_sigchild( info ) )
+ return;
+
+ if( !debug::attach_debugger( false ) )
+ execution_monitor_jumping_signal_handler( sig, info, context );
+
+ // debugger attached; it will handle the signal
+ BOOST_TEST_SYS_ASSERT( ::signal( sig, SIG_DFL ) != SIG_ERR );
+}
+
+//____________________________________________________________________________//
+
+}
+
+} // namespace detail
+
+// ************************************************************************** //
+// ************** execution_monitor::catch_signals ************** //
+// ************************************************************************** //
+
+int
+execution_monitor::catch_signals( unit_test::callback0<int> const& F )
+{
+ using namespace detail;
+
+#if defined(__CYGWIN__)
+ p_catch_system_errors.value = false;
+#endif
+
+#ifdef BOOST_TEST_USE_ALT_STACK
+ if( !!p_use_alt_stack && !m_alt_stack )
+ m_alt_stack.reset( new char[BOOST_TEST_ALT_STACK_SIZE] );
+#else
+ p_use_alt_stack.value = false;
+#endif
+
+ signal_handler local_signal_handler( p_catch_system_errors, p_timeout, p_auto_start_dbg,
+ !p_use_alt_stack ? 0 : m_alt_stack.get() );
+
+ if( !sigsetjmp( signal_handler::jump_buffer(), 1 ) )
+ return detail::do_invoke( m_custom_translators , F );
+ else
+ throw local_signal_handler.sys_sig();
+}
+
+//____________________________________________________________________________//
+
+#elif defined(BOOST_SEH_BASED_SIGNAL_HANDLING)
+
+// ************************************************************************** //
+// ************** Microsoft structured exception handling ************** //
+// ************************************************************************** //
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0564))
+namespace { void _set_se_translator( void* ) {} }
+#endif
+
+namespace detail {
+
+// ************************************************************************** //
+// ************** ndnboost::detail::system_signal_exception ************** //
+// ************************************************************************** //
+
+class system_signal_exception {
+public:
+ // Constructor
+ explicit system_signal_exception( execution_monitor* em )
+ : m_em( em )
+ , m_se_id( 0 )
+ , m_fault_address( 0 )
+ , m_dir( false )
+ {}
+
+ void report() const;
+ int operator()( unsigned int id, _EXCEPTION_POINTERS* exps );
+
+private:
+ // Data members
+ execution_monitor* m_em;
+
+ unsigned int m_se_id;
+ void* m_fault_address;
+ bool m_dir;
+};
+
+static void
+seh_catch_preventer( unsigned int /* id */, _EXCEPTION_POINTERS* /* exps */ )
+{
+ throw;
+}
+
+//____________________________________________________________________________//
+
+int
+system_signal_exception::operator()( unsigned int id, _EXCEPTION_POINTERS* exps )
+{
+ const unsigned int MSFT_CPP_EXCEPT = 0xE06d7363; // EMSC
+
+ if( !m_em->p_catch_system_errors || (id == MSFT_CPP_EXCEPT) )
+ return EXCEPTION_CONTINUE_SEARCH;
+
+ if( !!m_em->p_auto_start_dbg && debug::attach_debugger( false ) ) {
+ m_em->p_catch_system_errors.value = false;
+ _set_se_translator( &seh_catch_preventer );
+
+ return EXCEPTION_CONTINUE_EXECUTION;
+ }
+
+ m_se_id = id;
+ if( m_se_id == EXCEPTION_ACCESS_VIOLATION && exps->ExceptionRecord->NumberParameters == 2 ) {
+ m_fault_address = (void*)exps->ExceptionRecord->ExceptionInformation[1];
+ m_dir = exps->ExceptionRecord->ExceptionInformation[0] == 0;
+ }
+
+ return EXCEPTION_EXECUTE_HANDLER;
+}
+
+//____________________________________________________________________________//
+
+void
+system_signal_exception::report() const
+{
+ switch( m_se_id ) {
+ // cases classified as system_fatal_error
+ case EXCEPTION_ACCESS_VIOLATION: {
+ if( !m_fault_address )
+ detail::report_error( execution_exception::system_fatal_error, "memory access violation" );
+ else
+ detail::report_error(
+ execution_exception::system_fatal_error,
+ "memory access violation occurred at address 0x%08lx, while attempting to %s",
+ m_fault_address,
+ m_dir ? " read inaccessible data"
+ : " write to an inaccessible (or protected) address"
+ );
+ break;
+ }
+
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ detail::report_error( execution_exception::system_fatal_error, "illegal instruction" );
+ break;
+
+ case EXCEPTION_PRIV_INSTRUCTION:
+ detail::report_error( execution_exception::system_fatal_error, "tried to execute an instruction whose operation is not allowed in the current machine mode" );
+ break;
+
+ case EXCEPTION_IN_PAGE_ERROR:
+ detail::report_error( execution_exception::system_fatal_error, "access to a memory page that is not present" );
+ break;
+
+ case EXCEPTION_STACK_OVERFLOW:
+ detail::report_error( execution_exception::system_fatal_error, "stack overflow" );
+ break;
+
+ case EXCEPTION_NONCONTINUABLE_EXCEPTION:
+ detail::report_error( execution_exception::system_fatal_error, "tried to continue execution after a non continuable exception occurred" );
+ break;
+
+ // cases classified as (non-fatal) system_trap
+ case EXCEPTION_DATATYPE_MISALIGNMENT:
+ detail::report_error( execution_exception::system_error, "data misalignment" );
+ break;
+
+ case EXCEPTION_INT_DIVIDE_BY_ZERO:
+ detail::report_error( execution_exception::system_error, "integer divide by zero" );
+ break;
+
+ case EXCEPTION_INT_OVERFLOW:
+ detail::report_error( execution_exception::system_error, "integer overflow" );
+ break;
+
+ case EXCEPTION_ARRAY_BOUNDS_EXCEEDED:
+ detail::report_error( execution_exception::system_error, "array bounds exceeded" );
+ break;
+
+ case EXCEPTION_FLT_DIVIDE_BY_ZERO:
+ detail::report_error( execution_exception::system_error, "floating point divide by zero" );
+ break;
+
+ case EXCEPTION_FLT_STACK_CHECK:
+ detail::report_error( execution_exception::system_error,
+ "stack overflowed or underflowed as the result of a floating-point operation" );
+ break;
+
+ case EXCEPTION_FLT_DENORMAL_OPERAND:
+ detail::report_error( execution_exception::system_error,
+ "operand of floating point operation is denormal" );
+ break;
+
+# if 0 // !! ??
+ case EXCEPTION_FLT_INEXACT_RESULT:
+ detail::report_error( execution_exception::system_error,
+ "result of a floating-point operation cannot be represented exactly" );
+ break;
+#endif
+
+ case EXCEPTION_FLT_OVERFLOW:
+ detail::report_error( execution_exception::system_error,
+ "exponent of a floating-point operation is greater than the magnitude allowed by the corresponding type" );
+ break;
+
+ case EXCEPTION_FLT_UNDERFLOW:
+ detail::report_error( execution_exception::system_error,
+ "exponent of a floating-point operation is less than the magnitude allowed by the corresponding type" );
+ break;
+
+ case EXCEPTION_FLT_INVALID_OPERATION:
+ detail::report_error( execution_exception::system_error, "floating point error" );
+ break;
+
+ case EXCEPTION_BREAKPOINT:
+ detail::report_error( execution_exception::system_error, "breakpoint encountered" );
+ break;
+
+ default:
+ detail::report_error( execution_exception::system_error, "unrecognized exception. Id: 0x%08lx", m_se_id );
+ break;
+ }
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** assert_reporting_function ************** //
+// ************************************************************************** //
+
+int BOOST_TEST_CALL_DECL
+assert_reporting_function( int reportType, char* userMessage, int* )
+{
+ switch( reportType ) {
+ case BOOST_TEST_CRT_ASSERT:
+ detail::report_error( execution_exception::user_error, userMessage );
+
+ return 1; // return value and retVal are not important since we never reach this line
+ case BOOST_TEST_CRT_ERROR:
+ detail::report_error( execution_exception::system_error, userMessage );
+
+ return 1; // return value and retVal are not important since we never reach this line
+ default:
+ return 0; // use usual reporting method
+ }
+} // assert_reporting_function
+
+//____________________________________________________________________________//
+
+void BOOST_TEST_CALL_DECL
+invalid_param_handler( wchar_t const* /* expr */,
+ wchar_t const* /* func */,
+ wchar_t const* /* file */,
+ unsigned int /* line */,
+ uintptr_t /* reserved */)
+{
+ detail::report_error( execution_exception::user_error,
+ "Invalid parameter detected by C runtime library" );
+}
+
+//____________________________________________________________________________//
+
+void BOOST_TEST_CALL_DECL
+switch_fp_exceptions( bool on_off )
+{
+ if( !on_off )
+ _clearfp();
+
+ int cw = ::_controlfp( 0, 0 );
+
+ int exceptions_mask = EM_INVALID|EM_DENORMAL|EM_ZERODIVIDE|EM_OVERFLOW|EM_UNDERFLOW;
+
+ if( on_off )
+ cw &= ~exceptions_mask; // Set the exception masks on, turn exceptions off
+ else
+ cw |= exceptions_mask; // Set the exception masks off, turn exceptions on
+
+ if( on_off )
+ _clearfp();
+
+ // Set the control word
+ ::_controlfp( cw, MCW_EM );
+}
+
+//____________________________________________________________________________//
+
+} // namespace detail
+
+// ************************************************************************** //
+// ************** execution_monitor::catch_signals ************** //
+// ************************************************************************** //
+
+int
+execution_monitor::catch_signals( unit_test::callback0<int> const& F )
+{
+ _invalid_parameter_handler old_iph = _invalid_parameter_handler();
+ BOOST_TEST_CRT_HOOK_TYPE old_crt_hook = 0;
+
+ if( !p_catch_system_errors )
+ _set_se_translator( &detail::seh_catch_preventer );
+ else {
+ if( !!p_detect_fp_exceptions )
+ detail::switch_fp_exceptions( true );
+
+ old_crt_hook = BOOST_TEST_CRT_SET_HOOK( &detail::assert_reporting_function );
+
+ old_iph = _set_invalid_parameter_handler(
+ reinterpret_cast<_invalid_parameter_handler>( &detail::invalid_param_handler ) );
+ }
+
+ detail::system_signal_exception SSE( this );
+
+ int ret_val = 0;
+
+ __try {
+ __try {
+ ret_val = detail::do_invoke( m_custom_translators, F );
+ }
+ __except( SSE( GetExceptionCode(), GetExceptionInformation() ) ) {
+ throw SSE;
+ }
+ }
+ __finally {
+ if( !!p_catch_system_errors ) {
+ if( !!p_detect_fp_exceptions )
+ detail::switch_fp_exceptions( false );
+
+ BOOST_TEST_CRT_SET_HOOK( old_crt_hook );
+
+ _set_invalid_parameter_handler( old_iph );
+ }
+ }
+
+ return ret_val;
+}
+
+//____________________________________________________________________________//
+
+#else // default signal handler
+
+namespace detail {
+
+class system_signal_exception {
+public:
+ void report() const {}
+};
+
+} // namespace detail
+
+int
+execution_monitor::catch_signals( unit_test::callback0<int> const& F )
+{
+ return detail::do_invoke( m_custom_translators , F );
+}
+
+//____________________________________________________________________________//
+
+#endif // choose signal handler
+
+// ************************************************************************** //
+// ************** execution_monitor::execute ************** //
+// ************************************************************************** //
+
+int
+execution_monitor::execute( unit_test::callback0<int> const& F )
+{
+ if( debug::under_debugger() )
+ p_catch_system_errors.value = false;
+
+ try {
+ return catch_signals( F );
+ }
+
+ // Catch-clause reference arguments are a bit different from function
+ // arguments (ISO 15.3 paragraphs 18 & 19). Apparently const isn't
+ // required. Programmers ask for const anyhow, so we supply it. That's
+ // easier than answering questions about non-const usage.
+
+ catch( char const* ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ "C string: %s", ex ); }
+ catch( std::string const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ "std::string: %s", ex.c_str() ); }
+
+ // std:: exceptions
+
+ catch( std::bad_alloc const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::bad_alloc: %s", ex.what() ); }
+
+#if BOOST_WORKAROUND(__BORLANDC__, <= 0x0551)
+ catch( std::bad_cast const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::bad_cast" ); }
+ catch( std::bad_typeid const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::bad_typeid" ); }
+#else
+ catch( std::bad_cast const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::bad_cast: %s", ex.what() ); }
+ catch( std::bad_typeid const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::bad_typeid: %s", ex.what() ); }
+#endif
+
+ catch( std::bad_exception const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::bad_exception: %s", ex.what() ); }
+ catch( std::domain_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::domain_error: %s", ex.what() ); }
+ catch( std::invalid_argument const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::invalid_argument: %s", ex.what() ); }
+ catch( std::length_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::length_error: %s", ex.what() ); }
+ catch( std::out_of_range const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::out_of_range: %s", ex.what() ); }
+ catch( std::range_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::range_error: %s", ex.what() ); }
+ catch( std::overflow_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::overflow_error: %s", ex.what() ); }
+ catch( std::underflow_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::underflow_error: %s", ex.what() ); }
+ catch( std::logic_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::logic_error: %s", ex.what() ); }
+ catch( std::runtime_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::runtime_error: %s", ex.what() ); }
+ catch( std::exception const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ current_exception_cast<ndnboost::exception const>(),
+ "std::exception: %s", ex.what() ); }
+
+ catch( ndnboost::exception const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ &ex,
+ "unknown ndnboost::exception" ); }
+
+ // system errors
+ catch( system_error const& ex )
+ { detail::report_error( execution_exception::cpp_exception_error,
+ "system_error produced by: %s: %s", ex.p_failed_exp.get(), std::strerror( ex.p_errno ) ); }
+ catch( detail::system_signal_exception const& ex )
+ { ex.report(); }
+
+ // not an error
+ catch( execution_aborted const& )
+ { return 0; }
+
+ // just forward
+ catch( execution_exception const& )
+ { throw; }
+
+ // unknown error
+ catch( ... )
+ { detail::report_error( execution_exception::cpp_exception_error, "unknown type" ); }
+
+ return 0; // never reached; supplied to quiet compiler warnings
+} // execute
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** system_error ************** //
+// ************************************************************************** //
+
+system_error::system_error( char const* exp )
+#ifdef UNDER_CE
+: p_errno( GetLastError() )
+#else
+: p_errno( errno )
+#endif
+, p_failed_exp( exp )
+{}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** execution_exception ************** //
+// ************************************************************************** //
+
+execution_exception::execution_exception( error_code ec_, const_string what_msg_, location const& location_ )
+: m_error_code( ec_ )
+, m_what( what_msg_.empty() ? BOOST_TEST_L( "uncaught exception, system error or abort requested" ) : what_msg_ )
+, m_location( location_ )
+{}
+
+//____________________________________________________________________________//
+
+execution_exception::location::location( char const* file_name, size_t line_num, char const* func )
+: m_file_name( file_name ? file_name : "unknown location" )
+, m_line_num( line_num )
+, m_function( func )
+{}
+
+//____________________________________________________________________________//
+
+} // namespace ndnboost
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_EXECUTION_MONITOR_IPP_012205GER
+
diff --git a/ndnboost/test/impl/framework.ipp b/ndnboost/test/impl/framework.ipp
new file mode 100644
index 0000000..cdbce24
--- /dev/null
+++ b/ndnboost/test/impl/framework.ipp
@@ -0,0 +1,503 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57991 $
+//
+// Description : implements framework API - main driver for the test
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FRAMEWORK_IPP_021005GER
+#define BOOST_TEST_FRAMEWORK_IPP_021005GER
+
+// Boost.Test
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/execution_monitor.hpp>
+#include <ndnboost/test/debug.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/unit_test_log.hpp>
+#include <ndnboost/test/unit_test_monitor.hpp>
+#include <ndnboost/test/test_observer.hpp>
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/progress_monitor.hpp>
+#include <ndnboost/test/results_reporter.hpp>
+#include <ndnboost/test/test_tools.hpp>
+
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+#include <ndnboost/test/detail/global_typedef.hpp>
+
+#include <ndnboost/test/utils/foreach.hpp>
+
+// Boost
+#include <ndnboost/timer.hpp>
+
+// STL
+#include <map>
+#include <set>
+#include <cstdlib>
+#include <ctime>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::time; using ::srand; }
+#endif
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** test_start calls wrapper ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+struct test_start_caller {
+ test_start_caller( test_observer* to, counter_t tc_amount )
+ : m_to( to )
+ , m_tc_amount( tc_amount )
+ {}
+
+ int operator()()
+ {
+ m_to->test_start( m_tc_amount );
+ return 0;
+ }
+
+private:
+ // Data members
+ test_observer* m_to;
+ counter_t m_tc_amount;
+};
+
+//____________________________________________________________________________//
+
+struct test_init_caller {
+ explicit test_init_caller( init_unit_test_func init_func )
+ : m_init_func( init_func )
+ {}
+ int operator()()
+ {
+#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
+ if( !(*m_init_func)() )
+ throw std::runtime_error( "test module initialization failed" );
+#else
+ test_suite* manual_test_units = (*m_init_func)( framework::master_test_suite().argc, framework::master_test_suite().argv );
+
+ if( manual_test_units )
+ framework::master_test_suite().add( manual_test_units );
+#endif
+ return 0;
+ }
+
+ // Data members
+ init_unit_test_func m_init_func;
+};
+
+}
+
+// ************************************************************************** //
+// ************** framework ************** //
+// ************************************************************************** //
+
+class framework_impl : public test_tree_visitor {
+public:
+ framework_impl()
+ : m_master_test_suite( 0 )
+ , m_curr_test_case( INV_TEST_UNIT_ID )
+ , m_next_test_case_id( MIN_TEST_CASE_ID )
+ , m_next_test_suite_id( MIN_TEST_SUITE_ID )
+ , m_is_initialized( false )
+ , m_test_in_progress( false )
+ {}
+
+ ~framework_impl() { clear(); }
+
+ void clear()
+ {
+ while( !m_test_units.empty() ) {
+ test_unit_store::value_type const& tu = *m_test_units.begin();
+ test_unit* tu_ptr = tu.second;
+
+ // the delete will erase this element from map
+ if( ut_detail::test_id_2_unit_type( tu.second->p_id ) == tut_suite )
+ delete (test_suite const*)tu_ptr;
+ else
+ delete (test_case const*)tu_ptr;
+ }
+ }
+
+ void set_tu_id( test_unit& tu, test_unit_id id ) { tu.p_id.value = id; }
+
+ // test_tree_visitor interface implementation
+ void visit( test_case const& tc )
+ {
+ if( !tc.check_dependencies() ) {
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_unit_skipped( tc );
+
+ return;
+ }
+
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_unit_start( tc );
+
+ ndnboost::timer tc_timer;
+ test_unit_id bkup = m_curr_test_case;
+ m_curr_test_case = tc.p_id;
+ unit_test_monitor_t::error_level run_result = unit_test_monitor.execute_and_translate( tc );
+
+ unsigned long elapsed = static_cast<unsigned long>( tc_timer.elapsed() * 1e6 );
+
+ if( unit_test_monitor.is_critical_error( run_result ) ) {
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_aborted();
+ }
+
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_unit_finish( tc, elapsed );
+
+ m_curr_test_case = bkup;
+
+ if( unit_test_monitor.is_critical_error( run_result ) )
+ throw test_being_aborted();
+ }
+
+ bool test_suite_start( test_suite const& ts )
+ {
+ if( !ts.check_dependencies() ) {
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_unit_skipped( ts );
+
+ return false;
+ }
+
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_unit_start( ts );
+
+ return true;
+ }
+
+ void test_suite_finish( test_suite const& ts )
+ {
+ BOOST_TEST_FOREACH( test_observer*, to, m_observers )
+ to->test_unit_finish( ts, 0 );
+ }
+
+ //////////////////////////////////////////////////////////////////
+ struct priority_order {
+ bool operator()( test_observer* lhs, test_observer* rhs ) const
+ {
+ return (lhs->priority() < rhs->priority()) || ((lhs->priority() == rhs->priority()) && (lhs < rhs));
+ }
+ };
+
+ typedef std::map<test_unit_id,test_unit*> test_unit_store;
+ typedef std::set<test_observer*,priority_order> observer_store;
+
+ master_test_suite_t* m_master_test_suite;
+ test_unit_id m_curr_test_case;
+ test_unit_store m_test_units;
+
+ test_unit_id m_next_test_case_id;
+ test_unit_id m_next_test_suite_id;
+
+ bool m_is_initialized;
+ bool m_test_in_progress;
+
+ observer_store m_observers;
+};
+
+//____________________________________________________________________________//
+
+namespace {
+
+#if defined(__CYGWIN__)
+framework_impl& s_frk_impl() { static framework_impl* the_inst = 0; if(!the_inst) the_inst = new framework_impl; return *the_inst; }
+#else
+framework_impl& s_frk_impl() { static framework_impl the_inst; return the_inst; }
+#endif
+
+} // local namespace
+
+//____________________________________________________________________________//
+
+namespace framework {
+
+void
+init( init_unit_test_func init_func, int argc, char* argv[] )
+{
+ runtime_config::init( argc, argv );
+
+ // set the log level and format
+ unit_test_log.set_threshold_level( runtime_config::log_level() );
+ unit_test_log.set_format( runtime_config::log_format() );
+
+ // set the report level and format
+ results_reporter::set_level( runtime_config::report_level() );
+ results_reporter::set_format( runtime_config::report_format() );
+
+ register_observer( results_collector );
+ register_observer( unit_test_log );
+
+ if( runtime_config::show_progress() )
+ register_observer( progress_monitor );
+
+ if( runtime_config::detect_memory_leaks() > 0 ) {
+ debug::detect_memory_leaks( true );
+ debug::break_memory_alloc( runtime_config::detect_memory_leaks() );
+ }
+
+ // init master unit test suite
+ master_test_suite().argc = argc;
+ master_test_suite().argv = argv;
+
+ try {
+ ndnboost::execution_monitor em;
+
+ ut_detail::test_init_caller tic( init_func );
+
+ em.execute( tic );
+ }
+ catch( execution_exception const& ex ) {
+ throw setup_error( ex.what() );
+ }
+
+ s_frk_impl().m_is_initialized = true;
+}
+
+//____________________________________________________________________________//
+
+bool
+is_initialized()
+{
+ return s_frk_impl().m_is_initialized;
+}
+
+//____________________________________________________________________________//
+
+void
+register_test_unit( test_case* tc )
+{
+ BOOST_TEST_SETUP_ASSERT( tc->p_id == INV_TEST_UNIT_ID, BOOST_TEST_L( "test case already registered" ) );
+
+ test_unit_id new_id = s_frk_impl().m_next_test_case_id;
+
+ BOOST_TEST_SETUP_ASSERT( new_id != MAX_TEST_CASE_ID, BOOST_TEST_L( "too many test cases" ) );
+
+ typedef framework_impl::test_unit_store::value_type map_value_type;
+
+ s_frk_impl().m_test_units.insert( map_value_type( new_id, tc ) );
+ s_frk_impl().m_next_test_case_id++;
+
+ s_frk_impl().set_tu_id( *tc, new_id );
+}
+
+//____________________________________________________________________________//
+
+void
+register_test_unit( test_suite* ts )
+{
+ BOOST_TEST_SETUP_ASSERT( ts->p_id == INV_TEST_UNIT_ID, BOOST_TEST_L( "test suite already registered" ) );
+
+ test_unit_id new_id = s_frk_impl().m_next_test_suite_id;
+
+ BOOST_TEST_SETUP_ASSERT( new_id != MAX_TEST_SUITE_ID, BOOST_TEST_L( "too many test suites" ) );
+
+ typedef framework_impl::test_unit_store::value_type map_value_type;
+ s_frk_impl().m_test_units.insert( map_value_type( new_id, ts ) );
+ s_frk_impl().m_next_test_suite_id++;
+
+ s_frk_impl().set_tu_id( *ts, new_id );
+}
+
+//____________________________________________________________________________//
+
+void
+deregister_test_unit( test_unit* tu )
+{
+ s_frk_impl().m_test_units.erase( tu->p_id );
+}
+
+//____________________________________________________________________________//
+
+void
+clear()
+{
+ s_frk_impl().clear();
+}
+
+//____________________________________________________________________________//
+
+void
+register_observer( test_observer& to )
+{
+ s_frk_impl().m_observers.insert( &to );
+}
+
+//____________________________________________________________________________//
+
+void
+deregister_observer( test_observer& to )
+{
+ s_frk_impl().m_observers.erase( &to );
+}
+
+//____________________________________________________________________________//
+
+void
+reset_observers()
+{
+ s_frk_impl().m_observers.clear();
+}
+
+//____________________________________________________________________________//
+
+master_test_suite_t&
+master_test_suite()
+{
+ if( !s_frk_impl().m_master_test_suite )
+ s_frk_impl().m_master_test_suite = new master_test_suite_t;
+
+ return *s_frk_impl().m_master_test_suite;
+}
+
+//____________________________________________________________________________//
+
+test_case const&
+current_test_case()
+{
+ return get<test_case>( s_frk_impl().m_curr_test_case );
+}
+
+//____________________________________________________________________________//
+
+test_unit&
+get( test_unit_id id, test_unit_type t )
+{
+ test_unit* res = s_frk_impl().m_test_units[id];
+
+ if( (res->p_type & t) == 0 )
+ throw internal_error( "Invalid test unit type" );
+
+ return *res;
+}
+
+//____________________________________________________________________________//
+
+void
+run( test_unit_id id, bool continue_test )
+{
+ if( id == INV_TEST_UNIT_ID )
+ id = master_test_suite().p_id;
+
+ test_case_counter tcc;
+ traverse_test_tree( id, tcc );
+
+ BOOST_TEST_SETUP_ASSERT( tcc.p_count != 0 , runtime_config::test_to_run().is_empty()
+ ? BOOST_TEST_L( "test tree is empty" )
+ : BOOST_TEST_L( "no test cases matching filter" ) );
+
+ bool call_start_finish = !continue_test || !s_frk_impl().m_test_in_progress;
+ bool was_in_progress = s_frk_impl().m_test_in_progress;
+
+ s_frk_impl().m_test_in_progress = true;
+
+ if( call_start_finish ) {
+ BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers ) {
+ ndnboost::execution_monitor em;
+
+ try {
+ em.execute( ut_detail::test_start_caller( to, tcc.p_count ) );
+ }
+ catch( execution_exception const& ex ) {
+ throw setup_error( ex.what() );
+ }
+ }
+ }
+
+ switch( runtime_config::random_seed() ) {
+ case 0:
+ break;
+ case 1: {
+ unsigned int seed = static_cast<unsigned int>( std::time( 0 ) );
+ BOOST_TEST_MESSAGE( "Test cases order is shuffled using seed: " << seed );
+ std::srand( seed );
+ break;
+ }
+ default:
+ BOOST_TEST_MESSAGE( "Test cases order is shuffled using seed: " << runtime_config::random_seed() );
+ std::srand( runtime_config::random_seed() );
+ }
+
+ try {
+ traverse_test_tree( id, s_frk_impl() );
+ }
+ catch( test_being_aborted const& ) {
+ // abort already reported
+ }
+
+ if( call_start_finish ) {
+ BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers )
+ to->test_finish();
+ }
+
+ s_frk_impl().m_test_in_progress = was_in_progress;
+}
+
+//____________________________________________________________________________//
+
+void
+run( test_unit const* tu, bool continue_test )
+{
+ run( tu->p_id, continue_test );
+}
+
+//____________________________________________________________________________//
+
+void
+assertion_result( bool passed )
+{
+ BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers )
+ to->assertion_result( passed );
+}
+
+//____________________________________________________________________________//
+
+void
+exception_caught( execution_exception const& ex )
+{
+ BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers )
+ to->exception_caught( ex );
+}
+
+//____________________________________________________________________________//
+
+void
+test_unit_aborted( test_unit const& tu )
+{
+ BOOST_TEST_FOREACH( test_observer*, to, s_frk_impl().m_observers )
+ to->test_unit_aborted( tu );
+}
+
+//____________________________________________________________________________//
+
+} // namespace framework
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_FRAMEWORK_IPP_021005GER
diff --git a/ndnboost/test/impl/interaction_based.ipp b/ndnboost/test/impl/interaction_based.ipp
new file mode 100644
index 0000000..03ee9be
--- /dev/null
+++ b/ndnboost/test/impl/interaction_based.ipp
@@ -0,0 +1,90 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// Use, modification, and distribution are subject to the
+// Boost Software License, Version 1.0. (See accompanying file
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : Facilities to perform interaction-based testing
+// ***************************************************************************
+
+#ifndef BOOST_TEST_INTERACTION_BASED_IPP_112105GER
+#define BOOST_TEST_INTERACTION_BASED_IPP_112105GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+#if BOOST_TEST_SUPPORT_INTERACTION_TESTING
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/utils/callback.hpp>
+#include <ndnboost/test/interaction_based.hpp>
+#include <ndnboost/test/mock_object.hpp>
+#include <ndnboost/test/framework.hpp> // for setup_error
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+// STL
+#include <stdexcept>
+#include <string>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace itest { // interaction-based testing
+
+// ************************************************************************** //
+// ************** manager ************** //
+// ************************************************************************** //
+
+manager::manager()
+{
+ instance_ptr( true, this );
+}
+
+//____________________________________________________________________________//
+
+manager::~manager()
+{
+ instance_ptr( true );
+}
+
+//____________________________________________________________________________//
+
+manager*
+manager::instance_ptr( bool reset, manager* new_ptr )
+{
+ static manager dummy( 0 );
+
+ static manager* ptr = &dummy;
+
+ if( reset ) {
+ if( new_ptr ) {
+ BOOST_TEST_SETUP_ASSERT( ptr == &dummy, BOOST_TEST_L( "Can't run two interation based test the same time" ) );
+
+ ptr = new_ptr;
+ }
+ else
+ ptr = &dummy;
+ }
+
+ return ptr;
+}
+
+} // namespace itest
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // not ancient compiler
+
+#endif // BOOST_TEST_INTERACTION_BASED_IPP_112105GER
diff --git a/ndnboost/test/impl/logged_expectations.ipp b/ndnboost/test/impl/logged_expectations.ipp
new file mode 100644
index 0000000..4db7b81
--- /dev/null
+++ b/ndnboost/test/impl/logged_expectations.ipp
@@ -0,0 +1,246 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// Use, modification, and distribution are subject to the
+// Boost Software License, ELOG_VER 1.0. (See accompanying file
+// http://www.boost.org/LICENSE_1_0.txt)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : Facilities to perform interaction based testng of logged expectations
+// ***************************************************************************
+
+#ifndef BOOST_TEST_LOGGED_EXPECTATIONS_IPP_120905GER
+#define BOOST_TEST_LOGGED_EXPECTATIONS_IPP_120905GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+#if BOOST_TEST_SUPPORT_INTERACTION_TESTING
+
+#include <ndnboost/test/detail/global_typedef.hpp>
+
+#include <ndnboost/test/utils/callback.hpp>
+#include <ndnboost/test/utils/iterator/token_iterator.hpp>
+
+#include <ndnboost/test/interaction_based.hpp>
+#include <ndnboost/test/test_tools.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+// Boost
+#include <ndnboost/lexical_cast.hpp>
+
+// STL
+#include <fstream>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+using namespace ::ndnboost::unit_test;
+
+namespace itest {
+
+// ************************************************************************** //
+// ************** logged expectation test implementation ************** //
+// ************************************************************************** //
+
+struct expectations_logger : itest::manager {
+ // Constructor
+ expectations_logger( const_string log_file_name, bool test_or_log );
+
+ virtual bool decision_point( const_string, std::size_t );
+ virtual unsigned enter_scope( const_string, std::size_t, const_string scope_name );
+ virtual void allocated( const_string, std::size_t, void*, std::size_t s );
+ virtual void data_flow( const_string d );
+ virtual std::string return_value( const_string default_value );
+
+private:
+ // Data members
+ bool m_test_or_log;
+ std::fstream m_log_file;
+};
+
+literal_string ELOG_VER = "1.0";
+literal_string CLMN_SEP = "|";
+static const char LINE_SEP = '\n';
+
+literal_string FILE_SIG = "ELOG";
+literal_string SCOPE_SIG = "SCOPE";
+literal_string ALLOC_SIG = "ALLOC";
+literal_string DP_SIG = "SWITCH";
+literal_string DATA_SIG = "DATA";
+literal_string RETURN_SIG = "RETURN";
+
+//____________________________________________________________________________//
+
+expectations_logger::expectations_logger( const_string log_file_name, bool test_or_log )
+: m_test_or_log( test_or_log )
+{
+ BOOST_REQUIRE_MESSAGE( !log_file_name.is_empty(), "Empty expectations log file name" );
+
+ m_log_file.open( log_file_name.begin(), test_or_log ? std::ios::in : std::ios::out );
+
+ BOOST_REQUIRE_MESSAGE( m_log_file.is_open(),
+ "Can't open expectations log file " << log_file_name
+ << " for " << ( m_test_or_log ? "reading" : "writing") );
+
+ if( m_test_or_log ) {
+ std::string line;
+
+ std::getline( m_log_file, line, LINE_SEP );
+
+ const_string cline( line );
+ string_token_iterator tit( cline, (dropped_delimeters = CLMN_SEP, kept_delimeters = dt_none));
+
+ BOOST_CHECK_EQUAL( *tit, FILE_SIG );
+ ++tit;
+ BOOST_CHECK_EQUAL( *tit, ELOG_VER );
+ }
+ else {
+ m_log_file << FILE_SIG << CLMN_SEP << ELOG_VER << LINE_SEP;
+ }
+}
+
+//____________________________________________________________________________//
+
+bool
+expectations_logger::decision_point( const_string, std::size_t )
+{
+ if( m_test_or_log ) {
+ std::string line;
+
+ std::getline( m_log_file, line, LINE_SEP );
+
+ const_string cline( line );
+ string_token_iterator tit( cline, (dropped_delimeters = CLMN_SEP, kept_delimeters = dt_none));
+
+ BOOST_CHECK_EQUAL( *tit, DP_SIG ); ++tit;
+ return lexical_cast<bool>( *tit );
+ }
+ else {
+ m_log_file << DP_SIG << CLMN_SEP << std::boolalpha << true << LINE_SEP;
+
+ return true;
+ }
+}
+
+//____________________________________________________________________________//
+
+unsigned
+expectations_logger::enter_scope( const_string, std::size_t, const_string scope_name )
+{
+ if( m_test_or_log ) {
+ std::string line;
+
+ std::getline( m_log_file, line, LINE_SEP );
+
+ const_string cline( line );
+ string_token_iterator tit( cline, (dropped_delimeters = CLMN_SEP, kept_delimeters = dt_none));
+
+ BOOST_CHECK_EQUAL( *tit, SCOPE_SIG ); ++tit;
+ BOOST_CHECK_EQUAL( *tit, scope_name );
+ }
+ else {
+ m_log_file << SCOPE_SIG << CLMN_SEP << scope_name << LINE_SEP;
+ }
+
+ return 0;
+}
+
+//____________________________________________________________________________//
+
+void
+expectations_logger::allocated( const_string, std::size_t, void*, std::size_t s )
+{
+ if( m_test_or_log ) {
+ std::string line;
+
+ std::getline( m_log_file, line, LINE_SEP );
+
+ const_string cline( line );
+ string_token_iterator tit( cline, (dropped_delimeters = CLMN_SEP, kept_delimeters = dt_none));
+
+ BOOST_CHECK_EQUAL( *tit, ALLOC_SIG ); ++tit;
+ BOOST_CHECK_EQUAL( lexical_cast<std::size_t>( *tit ), s );
+ }
+ else {
+ m_log_file << ALLOC_SIG << CLMN_SEP << s << LINE_SEP;
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+expectations_logger::data_flow( const_string d )
+{
+ if( m_test_or_log ) {
+ std::string line;
+
+ std::getline( m_log_file, line, LINE_SEP );
+
+ const_string cline( line );
+ string_token_iterator tit( cline, (dropped_delimeters = CLMN_SEP, kept_delimeters = dt_none));
+
+ BOOST_CHECK_EQUAL( *tit, DATA_SIG ); ++tit;
+ BOOST_CHECK_EQUAL( *tit, d );
+ }
+ else {
+ m_log_file << DATA_SIG << CLMN_SEP << d << LINE_SEP;
+ }
+}
+
+//____________________________________________________________________________//
+
+std::string
+expectations_logger::return_value( const_string default_value )
+{
+ if( m_test_or_log ) {
+ std::string line;
+
+ std::getline( m_log_file, line, LINE_SEP );
+
+ const_string cline( line );
+ string_token_iterator tit( cline, (dropped_delimeters = CLMN_SEP, kept_delimeters = dt_none));
+
+ BOOST_CHECK_EQUAL( *tit, RETURN_SIG ); ++tit;
+
+ return std::string( tit->begin(), tit->size() );
+ }
+ else {
+ m_log_file << RETURN_SIG << CLMN_SEP << default_value << LINE_SEP;
+
+ return std::string();
+ }
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** logged expectations test ************** //
+// ************************************************************************** //
+
+void BOOST_TEST_DECL
+logged_expectations( callback0<> const& F, const_string log_file_name, bool test_or_log )
+{
+ expectations_logger el( log_file_name, test_or_log );
+
+ F();
+}
+
+//____________________________________________________________________________//
+
+} // namespace itest
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // not ancient compiler
+
+#endif // BOOST_TEST_LOGGED_EXPECTATIONS_IPP_120905GER
diff --git a/ndnboost/test/impl/plain_report_formatter.ipp b/ndnboost/test/impl/plain_report_formatter.ipp
new file mode 100644
index 0000000..1f0aaac
--- /dev/null
+++ b/ndnboost/test/impl/plain_report_formatter.ipp
@@ -0,0 +1,198 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : plain report formatter definition
+// ***************************************************************************
+
+#ifndef BOOST_TEST_PLAIN_REPORT_FORMATTER_IPP_020105GER
+#define BOOST_TEST_PLAIN_REPORT_FORMATTER_IPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/output/plain_report_formatter.hpp>
+#include <ndnboost/test/utils/custom_manip.hpp>
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// STL
+#include <iomanip>
+#include <ndnboost/config/no_tr1/cmath.hpp>
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::log10; }
+# endif
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+namespace {
+
+typedef custom_manip<struct quote_t> quote;
+
+template<typename T>
+inline std::ostream&
+operator<<( custom_printer<quote> const& p, T const& value )
+{
+ *p << '"' << value << '"';
+
+ return *p;
+}
+
+//____________________________________________________________________________//
+
+void
+print_stat_value( std::ostream& ostr, counter_t v, counter_t indent, counter_t total,
+ const_string name, const_string res )
+{
+ if( v > 0 ) {
+ ostr << std::setw( indent ) << ""
+ << v << ' ' << name << ( v != 1 ? "s" : "" );
+ if( total > 0 )
+ ostr << " out of " << total;
+
+ ostr << ' ' << res << '\n';
+ }
+}
+
+//____________________________________________________________________________//
+
+} // local namespace
+
+// ************************************************************************** //
+// ************** plain_report_formatter ************** //
+// ************************************************************************** //
+
+void
+plain_report_formatter::results_report_start( std::ostream& ostr )
+{
+ m_indent = 0;
+ ostr << '\n';
+}
+
+//____________________________________________________________________________//
+
+void
+plain_report_formatter::results_report_finish( std::ostream& ostr )
+{
+ ostr.flush();
+}
+
+//____________________________________________________________________________//
+
+void
+plain_report_formatter::test_unit_report_start( test_unit const& tu, std::ostream& ostr )
+{
+ test_results const& tr = results_collector.results( tu.p_id );
+
+ const_string descr;
+
+ if( tr.passed() )
+ descr = "passed";
+ else if( tr.p_skipped )
+ descr = "skipped";
+ else if( tr.p_aborted )
+ descr = "aborted";
+ else
+ descr = "failed";
+
+ ostr << std::setw( m_indent ) << ""
+ << "Test " << (tu.p_type == tut_case ? "case " : "suite " ) << quote() << tu.p_name << ' ' << descr;
+
+ if( tr.p_skipped ) {
+ ostr << " due to " << (tu.check_dependencies() ? "test aborting\n" : "failed dependancy\n" );
+ m_indent += 2;
+ return;
+ }
+
+ counter_t total_assertions = tr.p_assertions_passed + tr.p_assertions_failed;
+ counter_t total_tc = tr.p_test_cases_passed + tr.p_test_cases_failed + tr.p_test_cases_skipped;
+
+ if( total_assertions > 0 || total_tc > 0 )
+ ostr << " with:";
+
+ ostr << '\n';
+ m_indent += 2;
+
+ print_stat_value( ostr, tr.p_assertions_passed, m_indent, total_assertions, "assertion", "passed" );
+ print_stat_value( ostr, tr.p_assertions_failed, m_indent, total_assertions, "assertion", "failed" );
+ print_stat_value( ostr, tr.p_expected_failures, m_indent, 0 , "failure" , "expected" );
+ print_stat_value( ostr, tr.p_test_cases_passed, m_indent, total_tc , "test case", "passed" );
+ print_stat_value( ostr, tr.p_test_cases_failed, m_indent, total_tc , "test case", "failed" );
+ print_stat_value( ostr, tr.p_test_cases_skipped, m_indent, total_tc , "test case", "skipped" );
+ print_stat_value( ostr, tr.p_test_cases_aborted, m_indent, total_tc , "test case", "aborted" );
+
+ ostr << '\n';
+}
+
+//____________________________________________________________________________//
+
+void
+plain_report_formatter::test_unit_report_finish( test_unit const&, std::ostream& )
+{
+ m_indent -= 2;
+}
+
+//____________________________________________________________________________//
+
+void
+plain_report_formatter::do_confirmation_report( test_unit const& tu, std::ostream& ostr )
+{
+ test_results const& tr = results_collector.results( tu.p_id );
+
+ if( tr.passed() ) {
+ ostr << "*** No errors detected\n";
+ return;
+ }
+
+ if( tr.p_skipped ) {
+ ostr << "*** Test " << tu.p_type_name << " skipped due to "
+ << (tu.check_dependencies() ? "test aborting\n" : "failed dependancy\n" );
+ return;
+ }
+
+ if( tr.p_assertions_failed == 0 ) {
+ ostr << "*** errors detected in test " << tu.p_type_name << " " << quote() << tu.p_name
+ << "; see standard output for details\n";
+ return;
+ }
+
+ counter_t num_failures = tr.p_assertions_failed;
+
+ ostr << "*** " << num_failures << " failure" << ( num_failures != 1 ? "s" : "" ) << " detected";
+
+ if( tr.p_expected_failures > 0 )
+ ostr << " (" << tr.p_expected_failures << " failure" << ( tr.p_expected_failures != 1 ? "s" : "" ) << " expected)";
+
+ ostr << " in test " << tu.p_type_name << " " << quote() << tu.p_name << "\n";
+}
+
+//____________________________________________________________________________//
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_PLAIN_REPORT_FORMATTER_IPP_020105GER
diff --git a/ndnboost/test/impl/progress_monitor.ipp b/ndnboost/test/impl/progress_monitor.ipp
new file mode 100644
index 0000000..ac93432
--- /dev/null
+++ b/ndnboost/test/impl/progress_monitor.ipp
@@ -0,0 +1,110 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : implements simple text based progress monitor
+// ***************************************************************************
+
+#ifndef BOOST_TEST_PROGRESS_MONITOR_IPP_020105GER
+#define BOOST_TEST_PROGRESS_MONITOR_IPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/progress_monitor.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+// Boost
+#include <ndnboost/progress.hpp>
+#include <ndnboost/scoped_ptr.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** progress_monitor ************** //
+// ************************************************************************** //
+
+namespace {
+
+struct progress_monitor_impl {
+ // Constructor
+ progress_monitor_impl()
+ : m_stream( runtime_config::log_sink() )
+ {}
+
+ std::ostream* m_stream;
+ scoped_ptr<progress_display> m_progress_display;
+};
+
+progress_monitor_impl& s_pm_impl() { static progress_monitor_impl the_inst; return the_inst; }
+
+} // local namespace
+
+//____________________________________________________________________________//
+
+void
+progress_monitor_t::test_start( counter_t test_cases_amount )
+{
+ s_pm_impl().m_progress_display.reset( new progress_display( test_cases_amount, *s_pm_impl().m_stream ) );
+}
+
+//____________________________________________________________________________//
+
+void
+progress_monitor_t::test_aborted()
+{
+ (*s_pm_impl().m_progress_display) += s_pm_impl().m_progress_display->count();
+}
+
+//____________________________________________________________________________//
+
+void
+progress_monitor_t::test_unit_finish( test_unit const& tu, unsigned long )
+{
+ if( tu.p_type == tut_case )
+ ++(*s_pm_impl().m_progress_display);
+}
+
+//____________________________________________________________________________//
+
+void
+progress_monitor_t::test_unit_skipped( test_unit const& tu )
+{
+ test_case_counter tcc;
+ traverse_test_tree( tu, tcc );
+
+ (*s_pm_impl().m_progress_display) += tcc.p_count;
+}
+
+//____________________________________________________________________________//
+
+void
+progress_monitor_t::set_stream( std::ostream& ostr )
+{
+ s_pm_impl().m_stream = &ostr;
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_PROGRESS_MONITOR_IPP_020105GER
diff --git a/ndnboost/test/impl/results_collector.ipp b/ndnboost/test/impl/results_collector.ipp
new file mode 100644
index 0000000..7b676cf
--- /dev/null
+++ b/ndnboost/test/impl/results_collector.ipp
@@ -0,0 +1,294 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : implements Unit Test results collecting facility.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_RESULTS_COLLECTOR_IPP_021105GER
+#define BOOST_TEST_RESULTS_COLLECTOR_IPP_021105GER
+
+// Boost.Test
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/unit_test_log.hpp>
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/framework.hpp>
+
+// Boost
+#include <ndnboost/cstdlib.hpp>
+
+// STL
+#include <map>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** test_results ************** //
+// ************************************************************************** //
+
+test_results::test_results()
+{
+ clear();
+}
+
+//____________________________________________________________________________//
+
+bool
+test_results::passed() const
+{
+ return !p_skipped &&
+ p_test_cases_failed == 0 &&
+ p_assertions_failed <= p_expected_failures &&
+ !p_aborted;
+}
+
+//____________________________________________________________________________//
+
+int
+test_results::result_code() const
+{
+ return passed() ? exit_success
+ : ( (p_assertions_failed > p_expected_failures || p_skipped )
+ ? exit_test_failure
+ : exit_exception_failure );
+}
+
+//____________________________________________________________________________//
+
+void
+test_results::operator+=( test_results const& tr )
+{
+ p_assertions_passed.value += tr.p_assertions_passed;
+ p_assertions_failed.value += tr.p_assertions_failed;
+ p_test_cases_passed.value += tr.p_test_cases_passed;
+ p_test_cases_failed.value += tr.p_test_cases_failed;
+ p_test_cases_skipped.value += tr.p_test_cases_skipped;
+ p_test_cases_aborted.value += tr.p_test_cases_aborted;
+}
+
+//____________________________________________________________________________//
+
+void
+test_results::clear()
+{
+ p_assertions_passed.value = 0;
+ p_assertions_failed.value = 0;
+ p_expected_failures.value = 0;
+ p_test_cases_passed.value = 0;
+ p_test_cases_failed.value = 0;
+ p_test_cases_skipped.value = 0;
+ p_test_cases_aborted.value = 0;
+ p_aborted.value = false;
+ p_skipped.value = true;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** results_collector ************** //
+// ************************************************************************** //
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, <1300)
+
+namespace {
+
+struct results_collector_impl {
+ std::map<test_unit_id,test_results> m_results_store;
+};
+
+results_collector_impl& s_rc_impl() { static results_collector_impl the_inst; return the_inst; }
+
+} // local namespace
+
+#else
+
+struct results_collector_impl {
+ std::map<test_unit_id,test_results> m_results_store;
+};
+
+static results_collector_impl& s_rc_impl() { static results_collector_impl the_inst; return the_inst; }
+
+#endif
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_start( counter_t )
+{
+ s_rc_impl().m_results_store.clear();
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_finish()
+{
+ // do nothing
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_aborted()
+{
+ // do nothing
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_unit_start( test_unit const& tu )
+{
+ // init test_results entry
+ test_results& tr = s_rc_impl().m_results_store[tu.p_id];
+
+ tr.clear();
+
+ tr.p_expected_failures.value = tu.p_expected_failures;
+ tr.p_skipped.value = false;
+}
+
+//____________________________________________________________________________//
+
+class results_collect_helper : public test_tree_visitor {
+public:
+ explicit results_collect_helper( test_results& tr, test_unit const& ts ) : m_tr( tr ), m_ts( ts ) {}
+
+ void visit( test_case const& tc )
+ {
+ test_results const& tr = results_collector.results( tc.p_id );
+ m_tr += tr;
+
+ if( tr.passed() )
+ m_tr.p_test_cases_passed.value++;
+ else if( tr.p_skipped )
+ m_tr.p_test_cases_skipped.value++;
+ else {
+ if( tr.p_aborted )
+ m_tr.p_test_cases_aborted.value++;
+ m_tr.p_test_cases_failed.value++;
+ }
+ }
+ bool test_suite_start( test_suite const& ts )
+ {
+ if( m_ts.p_id == ts.p_id )
+ return true;
+ else {
+ m_tr += results_collector.results( ts.p_id );
+ return false;
+ }
+ }
+
+private:
+ // Data members
+ test_results& m_tr;
+ test_unit const& m_ts;
+};
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_unit_finish( test_unit const& tu, unsigned long )
+{
+ if( tu.p_type == tut_suite ) {
+ results_collect_helper ch( s_rc_impl().m_results_store[tu.p_id], tu );
+
+ traverse_test_tree( tu, ch );
+ }
+ else {
+ test_results const& tr = s_rc_impl().m_results_store[tu.p_id];
+
+ bool num_failures_match = tr.p_aborted || tr.p_assertions_failed >= tr.p_expected_failures;
+ if( !num_failures_match )
+ BOOST_TEST_MESSAGE( "Test case " << tu.p_name << " has fewer failures than expected" );
+
+ bool check_any_assertions = tr.p_aborted || (tr.p_assertions_failed != 0) || (tr.p_assertions_passed != 0);
+ if( !check_any_assertions )
+ BOOST_TEST_MESSAGE( "Test case " << tu.p_name << " did not check any assertions" );
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_unit_skipped( test_unit const& tu )
+{
+ if( tu.p_type == tut_suite ) {
+ test_case_counter tcc;
+ traverse_test_tree( tu, tcc );
+
+ test_results& tr = s_rc_impl().m_results_store[tu.p_id];
+
+ tr.clear();
+
+ tr.p_skipped.value = true;
+ tr.p_test_cases_skipped.value = tcc.p_count;
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::assertion_result( bool passed )
+{
+ test_results& tr = s_rc_impl().m_results_store[framework::current_test_case().p_id];
+
+ if( passed )
+ tr.p_assertions_passed.value++;
+ else
+ tr.p_assertions_failed.value++;
+
+ if( tr.p_assertions_failed == 1 )
+ first_failed_assertion();
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::exception_caught( execution_exception const& )
+{
+ test_results& tr = s_rc_impl().m_results_store[framework::current_test_case().p_id];
+
+ tr.p_assertions_failed.value++;
+}
+
+//____________________________________________________________________________//
+
+void
+results_collector_t::test_unit_aborted( test_unit const& tu )
+{
+ s_rc_impl().m_results_store[tu.p_id].p_aborted.value = true;
+}
+
+//____________________________________________________________________________//
+
+test_results const&
+results_collector_t::results( test_unit_id id ) const
+{
+ return s_rc_impl().m_results_store[id];
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_RESULTS_COLLECTOR_IPP_021105GER
diff --git a/ndnboost/test/impl/results_reporter.ipp b/ndnboost/test/impl/results_reporter.ipp
new file mode 100644
index 0000000..1009a3d
--- /dev/null
+++ b/ndnboost/test/impl/results_reporter.ipp
@@ -0,0 +1,202 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : result reporting facilties
+// ***************************************************************************
+
+#ifndef BOOST_TEST_RESULTS_REPORTER_IPP_020105GER
+#define BOOST_TEST_RESULTS_REPORTER_IPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/results_reporter.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/output/plain_report_formatter.hpp>
+#include <ndnboost/test/output/xml_report_formatter.hpp>
+
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+// Boost
+#include <ndnboost/scoped_ptr.hpp>
+#include <ndnboost/io/ios_state.hpp>
+typedef ::ndnboost::io::ios_base_all_saver io_saver_type;
+
+// STL
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace results_reporter {
+
+// ************************************************************************** //
+// ************** result reporter implementation ************** //
+// ************************************************************************** //
+
+namespace {
+
+struct results_reporter_impl : test_tree_visitor {
+ // Constructor
+ results_reporter_impl()
+ : m_output( runtime_config::report_sink() )
+ , m_stream_state_saver( new io_saver_type( *m_output ) )
+ , m_report_level( CONFIRMATION_REPORT )
+ , m_formatter( new output::plain_report_formatter )
+ {}
+
+ // test tree visitor interface implementation
+ void visit( test_case const& tc )
+ {
+ m_formatter->test_unit_report_start( tc, *m_output );
+ m_formatter->test_unit_report_finish( tc, *m_output );
+ }
+ bool test_suite_start( test_suite const& ts )
+ {
+ m_formatter->test_unit_report_start( ts, *m_output );
+
+ if( m_report_level == DETAILED_REPORT && !results_collector.results( ts.p_id ).p_skipped )
+ return true;
+
+ m_formatter->test_unit_report_finish( ts, *m_output );
+ return false;
+ }
+ void test_suite_finish( test_suite const& ts )
+ {
+ m_formatter->test_unit_report_finish( ts, *m_output );
+ }
+
+ typedef scoped_ptr<io_saver_type> saver_ptr;
+
+ // Data members
+ std::ostream* m_output;
+ saver_ptr m_stream_state_saver;
+ report_level m_report_level;
+ scoped_ptr<format> m_formatter;
+};
+
+results_reporter_impl& s_rr_impl() { static results_reporter_impl the_inst; return the_inst; }
+
+} // local namespace
+
+// ************************************************************************** //
+// ************** report configuration ************** //
+// ************************************************************************** //
+
+void
+set_level( report_level l )
+{
+ if( l != INV_REPORT_LEVEL )
+ s_rr_impl().m_report_level = l;
+}
+
+//____________________________________________________________________________//
+
+void
+set_stream( std::ostream& ostr )
+{
+ s_rr_impl().m_output = &ostr;
+ s_rr_impl().m_stream_state_saver.reset( new io_saver_type( ostr ) );
+}
+
+//____________________________________________________________________________//
+
+std::ostream&
+get_stream()
+{
+ return *s_rr_impl().m_output;
+}
+
+//____________________________________________________________________________//
+
+void
+set_format( output_format rf )
+{
+ switch( rf ) {
+ case CLF:
+ set_format( new output::plain_report_formatter );
+ break;
+ case XML:
+ set_format( new output::xml_report_formatter );
+ break;
+ default:
+ break;
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+set_format( results_reporter::format* f )
+{
+ if( f )
+ s_rr_impl().m_formatter.reset( f );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** report initiation ************** //
+// ************************************************************************** //
+
+void
+make_report( report_level l, test_unit_id id )
+{
+ if( l == INV_REPORT_LEVEL )
+ l = s_rr_impl().m_report_level;
+
+ if( l == NO_REPORT )
+ return;
+
+ if( id == INV_TEST_UNIT_ID )
+ id = framework::master_test_suite().p_id;
+
+ s_rr_impl().m_stream_state_saver->restore();
+
+ report_level bkup = s_rr_impl().m_report_level;
+ s_rr_impl().m_report_level = l;
+
+ s_rr_impl().m_formatter->results_report_start( *s_rr_impl().m_output );
+
+ switch( l ) {
+ case CONFIRMATION_REPORT:
+ s_rr_impl().m_formatter->do_confirmation_report( framework::get<test_unit>( id ), *s_rr_impl().m_output );
+ break;
+ case SHORT_REPORT:
+ case DETAILED_REPORT:
+ traverse_test_tree( id, s_rr_impl() );
+ break;
+ default:
+ break;
+ }
+
+ s_rr_impl().m_formatter->results_report_finish( *s_rr_impl().m_output );
+ s_rr_impl().m_report_level = bkup;
+}
+
+//____________________________________________________________________________//
+
+} // namespace results_reporter
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_RESULTS_REPORTER_IPP_020105GER
diff --git a/ndnboost/test/impl/test_main.ipp b/ndnboost/test/impl/test_main.ipp
new file mode 100644
index 0000000..5991f1c
--- /dev/null
+++ b/ndnboost/test/impl/test_main.ipp
@@ -0,0 +1,68 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// (C) Copyright Beman Dawes 1995-2001.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $$Revision: 49312 $
+//
+// Description : implements main function for Test Execution Monitor.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_TEST_MAIN_IPP_012205GER
+#define BOOST_TEST_TEST_MAIN_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/test_tools.hpp>
+#include <ndnboost/test/unit_test_suite.hpp>
+
+// Boost
+#include <ndnboost/cstdlib.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+extern int test_main( int argc, char* argv[] ); // prototype for user's test_main()
+
+struct test_main_caller {
+ test_main_caller( int argc, char** argv ) : m_argc( argc ), m_argv( argv ) {}
+
+ void operator()() {
+ int test_main_result = test_main( m_argc, m_argv );
+
+ // translate a test_main non-success return into a test error
+ BOOST_CHECK( test_main_result == 0 || test_main_result == ndnboost::exit_success );
+ }
+
+private:
+ // Data members
+ int m_argc;
+ char** m_argv;
+};
+
+// ************************************************************************** //
+// ************** test main ************** //
+// ************************************************************************** //
+
+::ndnboost::unit_test::test_suite*
+init_unit_test_suite( int argc, char* argv[] ) {
+ using namespace ::ndnboost::unit_test;
+
+ framework::master_test_suite().p_name.value = "Test Program";
+
+ framework::master_test_suite().add( BOOST_TEST_CASE( test_main_caller( argc, argv ) ) );
+
+ return 0;
+}
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_TEST_MAIN_IPP_012205GER
diff --git a/ndnboost/test/impl/test_tools.ipp b/ndnboost/test/impl/test_tools.ipp
new file mode 100644
index 0000000..b47ef81
--- /dev/null
+++ b/ndnboost/test/impl/test_tools.ipp
@@ -0,0 +1,628 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : supplies offline implementation for the Test Tools
+// ***************************************************************************
+
+#ifndef BOOST_TEST_TEST_TOOLS_IPP_012205GER
+#define BOOST_TEST_TEST_TOOLS_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/test_tools.hpp>
+#include <ndnboost/test/unit_test_log.hpp>
+#include <ndnboost/test/output_test_stream.hpp>
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/execution_monitor.hpp> // execution_aborted
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+
+// Boost
+#include <ndnboost/config.hpp>
+
+// STL
+#include <fstream>
+#include <string>
+#include <cstring>
+#include <cctype>
+#include <cwchar>
+#include <stdexcept>
+#include <ios>
+
+// !! should we use #include <cstdarg>
+#include <stdarg.h>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::strcmp; using ::strlen; using ::isprint; }
+#if !defined( BOOST_NO_CWCHAR )
+namespace std { using ::wcscmp; }
+#endif
+# endif
+
+namespace ndnboost {
+
+namespace test_tools {
+
+// ************************************************************************** //
+// ************** print_log_value ************** //
+// ************************************************************************** //
+
+void
+print_log_value<char>::operator()( std::ostream& ostr, char t )
+{
+ if( (std::isprint)( static_cast<unsigned char>(t) ) )
+ ostr << '\'' << t << '\'';
+ else
+ ostr << std::hex
+#if BOOST_TEST_USE_STD_LOCALE
+ << std::showbase
+#else
+ << "0x"
+#endif
+ << static_cast<int>(t);
+}
+
+//____________________________________________________________________________//
+
+void
+print_log_value<unsigned char>::operator()( std::ostream& ostr, unsigned char t )
+{
+ ostr << std::hex
+ // showbase is only available for new style streams:
+#if BOOST_TEST_USE_STD_LOCALE
+ << std::showbase
+#else
+ << "0x"
+#endif
+ << static_cast<int>(t);
+}
+
+//____________________________________________________________________________//
+
+void
+print_log_value<char const*>::operator()( std::ostream& ostr, char const* t )
+{
+ ostr << ( t ? t : "null string" );
+}
+
+//____________________________________________________________________________//
+
+void
+print_log_value<wchar_t const*>::operator()( std::ostream& ostr, wchar_t const* t )
+{
+ ostr << ( t ? t : L"null string" );
+}
+
+//____________________________________________________________________________//
+
+namespace tt_detail {
+
+// ************************************************************************** //
+// ************** TOOL BOX Implementation ************** //
+// ************************************************************************** //
+
+using ::ndnboost::unit_test::lazy_ostream;
+
+bool
+check_impl( predicate_result const& pr, lazy_ostream const& check_descr,
+ const_string file_name, std::size_t line_num,
+ tool_level tl, check_type ct,
+ std::size_t num_of_args, ... )
+{
+ using namespace unit_test;
+
+ if( !framework::is_initialized() )
+ throw std::runtime_error( "can't use testing tools before framework is initialized" );
+
+ if( !!pr )
+ tl = PASS;
+
+ log_level ll;
+ char const* prefix;
+ char const* suffix;
+
+ switch( tl ) {
+ case PASS:
+ ll = log_successful_tests;
+ prefix = "check ";
+ suffix = " passed";
+ break;
+ case WARN:
+ ll = log_warnings;
+ prefix = "condition ";
+ suffix = " is not satisfied";
+ break;
+ case CHECK:
+ ll = log_all_errors;
+ prefix = "check ";
+ suffix = " failed";
+ break;
+ case REQUIRE:
+ ll = log_fatal_errors;
+ prefix = "critical check ";
+ suffix = " failed";
+ break;
+ default:
+ return true;
+ }
+
+ switch( ct ) {
+ case CHECK_PRED:
+ unit_test_log << unit_test::log::begin( file_name, line_num )
+ << ll << prefix << check_descr << suffix;
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+
+ case CHECK_MSG:
+ unit_test_log << unit_test::log::begin( file_name, line_num ) << ll;
+
+ if( tl == PASS )
+ unit_test_log << prefix << "'" << check_descr << "'" << suffix;
+ else
+ unit_test_log << check_descr;
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+
+ case CHECK_EQUAL:
+ case CHECK_NE:
+ case CHECK_LT:
+ case CHECK_LE:
+ case CHECK_GT:
+ case CHECK_GE: {
+ static char const* check_str [] = { " == ", " != ", " < " , " <= ", " > " , " >= " };
+ static char const* rever_str [] = { " != ", " == ", " >= ", " > " , " <= ", " < " };
+
+ va_list args;
+
+ va_start( args, num_of_args );
+ char const* arg1_descr = va_arg( args, char const* );
+ lazy_ostream const* arg1_val = va_arg( args, lazy_ostream const* );
+ char const* arg2_descr = va_arg( args, char const* );
+ lazy_ostream const* arg2_val = va_arg( args, lazy_ostream const* );
+
+ unit_test_log << unit_test::log::begin( file_name, line_num )
+ << ll << prefix << arg1_descr << check_str[ct-CHECK_EQUAL] << arg2_descr << suffix;
+
+ if( tl != PASS )
+ unit_test_log << " [" << *arg1_val << rever_str[ct-CHECK_EQUAL] << *arg2_val << "]" ;
+
+ va_end( args );
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+ }
+
+ case CHECK_CLOSE:
+ case CHECK_CLOSE_FRACTION: {
+ va_list args;
+
+ va_start( args, num_of_args );
+ char const* arg1_descr = va_arg( args, char const* );
+ lazy_ostream const* arg1_val = va_arg( args, lazy_ostream const* );
+ char const* arg2_descr = va_arg( args, char const* );
+ lazy_ostream const* arg2_val = va_arg( args, lazy_ostream const* );
+ /* toler_descr = */ va_arg( args, char const* );
+ lazy_ostream const* toler_val = va_arg( args, lazy_ostream const* );
+
+ unit_test_log << unit_test::log::begin( file_name, line_num ) << ll;
+
+ unit_test_log << "difference{" << pr.message() << (ct == CHECK_CLOSE ? "%" : "")
+ << "} between " << arg1_descr << "{" << *arg1_val
+ << "} and " << arg2_descr << "{" << *arg2_val
+ << ( tl == PASS ? "} doesn't exceed " : "} exceeds " )
+ << *toler_val;
+ if( ct == CHECK_CLOSE )
+ unit_test_log << "%";
+
+ va_end( args );
+
+ unit_test_log << unit_test::log::end();
+ break;
+ }
+ case CHECK_SMALL: {
+ va_list args;
+
+ va_start( args, num_of_args );
+ char const* arg1_descr = va_arg( args, char const* );
+ lazy_ostream const* arg1_val = va_arg( args, lazy_ostream const* );
+ /* toler_descr = */ va_arg( args, char const* );
+ lazy_ostream const* toler_val = va_arg( args, lazy_ostream const* );
+
+ unit_test_log << unit_test::log::begin( file_name, line_num ) << ll;
+
+ unit_test_log << "absolute value of " << arg1_descr << "{" << *arg1_val << "}"
+ << ( tl == PASS ? " doesn't exceed " : " exceeds " )
+ << *toler_val;
+
+ va_end( args );
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+ }
+
+ case CHECK_PRED_WITH_ARGS: {
+ unit_test_log << unit_test::log::begin( file_name, line_num )
+ << ll << prefix << check_descr;
+
+ // print predicate call description
+ {
+ va_list args;
+ va_start( args, num_of_args );
+
+ unit_test_log << "( ";
+ for( std::size_t i = 0; i < num_of_args; ++i ) {
+ unit_test_log << va_arg( args, char const* );
+ va_arg( args, lazy_ostream const* ); // skip argument value;
+
+ if( i != num_of_args-1 )
+ unit_test_log << ", ";
+ }
+ unit_test_log << " )" << suffix;
+ va_end( args );
+ }
+
+ if( tl != PASS ) {
+ va_list args;
+ va_start( args, num_of_args );
+
+ unit_test_log << " for ( ";
+ for( std::size_t i = 0; i < num_of_args; ++i ) {
+ va_arg( args, char const* ); // skip argument description;
+ unit_test_log << *va_arg( args, lazy_ostream const* );
+
+ if( i != num_of_args-1 )
+ unit_test_log << ", ";
+ }
+ unit_test_log << " )";
+ va_end( args );
+ }
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+ }
+
+ case CHECK_EQUAL_COLL: {
+ va_list args;
+
+ va_start( args, num_of_args );
+ char const* left_begin_descr = va_arg( args, char const* );
+ char const* left_end_descr = va_arg( args, char const* );
+ char const* right_begin_descr = va_arg( args, char const* );
+ char const* right_end_descr = va_arg( args, char const* );
+
+ unit_test_log << unit_test::log::begin( file_name, line_num )
+ << ll << prefix
+ << "{ " << left_begin_descr << ", " << left_end_descr << " } == { "
+ << right_begin_descr << ", " << right_end_descr << " }"
+ << suffix;
+
+ va_end( args );
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+ }
+
+ case CHECK_BITWISE_EQUAL: {
+ va_list args;
+
+ va_start( args, num_of_args );
+ char const* left_descr = va_arg( args, char const* );
+ char const* right_descr = va_arg( args, char const* );
+
+ unit_test_log << unit_test::log::begin( file_name, line_num )
+ << ll << prefix << left_descr << " =.= " << right_descr << suffix;
+
+ va_end( args );
+
+ if( !pr.has_empty_message() )
+ unit_test_log << ". " << pr.message();
+
+ unit_test_log << unit_test::log::end();
+ break;
+ }
+ }
+
+ switch( tl ) {
+ case PASS:
+ framework::assertion_result( true );
+ return true;
+
+ case WARN:
+ return false;
+
+ case CHECK:
+ framework::assertion_result( false );
+ return false;
+
+ case REQUIRE:
+ framework::assertion_result( false );
+
+ framework::test_unit_aborted( framework::current_test_case() );
+
+ throw execution_aborted();
+ }
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+predicate_result
+equal_impl( char const* left, char const* right )
+{
+ return (left && right) ? std::strcmp( left, right ) == 0 : (left == right);
+}
+
+//____________________________________________________________________________//
+
+#if !defined( BOOST_NO_CWCHAR )
+
+predicate_result
+equal_impl( wchar_t const* left, wchar_t const* right )
+{
+ return (left && right) ? std::wcscmp( left, right ) == 0 : (left == right);
+}
+
+#endif // !defined( BOOST_NO_CWCHAR )
+
+//____________________________________________________________________________//
+
+bool
+is_defined_impl( const_string symbol_name, const_string symbol_value )
+{
+ symbol_value.trim_left( 2 );
+ return symbol_name != symbol_value;
+}
+
+//____________________________________________________________________________//
+
+} // namespace tt_detail
+
+// ************************************************************************** //
+// ************** output_test_stream ************** //
+// ************************************************************************** //
+
+struct output_test_stream::Impl
+{
+ std::fstream m_pattern;
+ bool m_match_or_save;
+ bool m_text_or_binary;
+ std::string m_synced_string;
+
+ char get_char()
+ {
+ char res;
+ do {
+ m_pattern.get( res );
+ } while( m_text_or_binary && res == '\r' && !m_pattern.fail() && !m_pattern.eof() );
+
+ return res;
+ }
+
+ void check_and_fill( predicate_result& res )
+ {
+ if( !res.p_predicate_value )
+ res.message() << "Output content: \"" << m_synced_string << '\"';
+ }
+};
+
+//____________________________________________________________________________//
+
+output_test_stream::output_test_stream( const_string pattern_file_name, bool match_or_save, bool text_or_binary )
+: m_pimpl( new Impl )
+{
+ if( !pattern_file_name.is_empty() ) {
+ std::ios::openmode m = match_or_save ? std::ios::in : std::ios::out;
+ if( !text_or_binary )
+ m |= std::ios::binary;
+
+ m_pimpl->m_pattern.open( pattern_file_name.begin(), m );
+
+ BOOST_WARN_MESSAGE( m_pimpl->m_pattern.is_open(),
+ "Can't open pattern file " << pattern_file_name
+ << " for " << (match_or_save ? "reading" : "writing") );
+ }
+
+ m_pimpl->m_match_or_save = match_or_save;
+ m_pimpl->m_text_or_binary = text_or_binary;
+}
+
+//____________________________________________________________________________//
+
+output_test_stream::~output_test_stream()
+{
+ delete m_pimpl;
+}
+
+//____________________________________________________________________________//
+
+predicate_result
+output_test_stream::is_empty( bool flush_stream )
+{
+ sync();
+
+ result_type res( m_pimpl->m_synced_string.empty() );
+
+ m_pimpl->check_and_fill( res );
+
+ if( flush_stream )
+ flush();
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+predicate_result
+output_test_stream::check_length( std::size_t length_, bool flush_stream )
+{
+ sync();
+
+ result_type res( m_pimpl->m_synced_string.length() == length_ );
+
+ m_pimpl->check_and_fill( res );
+
+ if( flush_stream )
+ flush();
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+predicate_result
+output_test_stream::is_equal( const_string arg, bool flush_stream )
+{
+ sync();
+
+ result_type res( const_string( m_pimpl->m_synced_string ) == arg );
+
+ m_pimpl->check_and_fill( res );
+
+ if( flush_stream )
+ flush();
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+predicate_result
+output_test_stream::match_pattern( bool flush_stream )
+{
+ sync();
+
+ result_type result( true );
+
+ if( !m_pimpl->m_pattern.is_open() ) {
+ result = false;
+ result.message() << "Pattern file can't be opened!";
+ }
+ else {
+ if( m_pimpl->m_match_or_save ) {
+ for ( std::string::size_type i = 0; i < m_pimpl->m_synced_string.length(); ++i ) {
+ char c = m_pimpl->get_char();
+
+ result = !m_pimpl->m_pattern.fail() &&
+ !m_pimpl->m_pattern.eof() &&
+ (m_pimpl->m_synced_string[i] == c);
+
+ if( !result ) {
+ std::string::size_type suffix_size = (std::min)( m_pimpl->m_synced_string.length() - i,
+ static_cast<std::string::size_type>(5) );
+
+ // try to log area around the mismatch
+ result.message() << "Mismatch at position " << i << '\n'
+ << "..." << m_pimpl->m_synced_string.substr( i, suffix_size ) << "..." << '\n'
+ << "..." << c;
+
+ std::string::size_type counter = suffix_size;
+ while( --counter ) {
+ char c = m_pimpl->get_char();
+
+ if( m_pimpl->m_pattern.fail() || m_pimpl->m_pattern.eof() )
+ break;
+
+ result.message() << c;
+ }
+
+ result.message() << "...";
+
+ // skip rest of the bytes. May help for further matching
+ m_pimpl->m_pattern.ignore(
+ static_cast<std::streamsize>( m_pimpl->m_synced_string.length() - i - suffix_size) );
+ break;
+ }
+ }
+ }
+ else {
+ m_pimpl->m_pattern.write( m_pimpl->m_synced_string.c_str(),
+ static_cast<std::streamsize>( m_pimpl->m_synced_string.length() ) );
+ m_pimpl->m_pattern.flush();
+ }
+ }
+
+ if( flush_stream )
+ flush();
+
+ return result;
+}
+
+//____________________________________________________________________________//
+
+void
+output_test_stream::flush()
+{
+ m_pimpl->m_synced_string.erase();
+
+#ifndef BOOST_NO_STRINGSTREAM
+ str( std::string() );
+#else
+ seekp( 0, std::ios::beg );
+#endif
+}
+
+//____________________________________________________________________________//
+
+std::size_t
+output_test_stream::length()
+{
+ sync();
+
+ return m_pimpl->m_synced_string.length();
+}
+
+//____________________________________________________________________________//
+
+void
+output_test_stream::sync()
+{
+#ifdef BOOST_NO_STRINGSTREAM
+ m_pimpl->m_synced_string.assign( str(), pcount() );
+ freeze( false );
+#else
+ m_pimpl->m_synced_string = str();
+#endif
+}
+
+//____________________________________________________________________________//
+
+} // namespace test_tools
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_TEST_TOOLS_IPP_012205GER
diff --git a/ndnboost/test/impl/unit_test_log.ipp b/ndnboost/test/impl/unit_test_log.ipp
new file mode 100644
index 0000000..63d089e
--- /dev/null
+++ b/ndnboost/test/impl/unit_test_log.ipp
@@ -0,0 +1,444 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : implemets Unit Test Log
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_LOG_IPP_012205GER
+#define BOOST_TEST_UNIT_TEST_LOG_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/unit_test_log.hpp>
+#include <ndnboost/test/unit_test_log_formatter.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/execution_monitor.hpp>
+
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+
+#include <ndnboost/test/output/compiler_log_formatter.hpp>
+#include <ndnboost/test/output/xml_log_formatter.hpp>
+
+// Boost
+#include <ndnboost/scoped_ptr.hpp>
+#include <ndnboost/io/ios_state.hpp>
+typedef ::ndnboost::io::ios_base_all_saver io_saver_type;
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** entry_value_collector ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+entry_value_collector const&
+entry_value_collector::operator<<( lazy_ostream const& v ) const
+{
+ unit_test_log << v;
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+entry_value_collector const&
+entry_value_collector::operator<<( const_string v ) const
+{
+ unit_test_log << v;
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+entry_value_collector::~entry_value_collector()
+{
+ if( m_last )
+ unit_test_log << log::end();
+}
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** unit_test_log ************** //
+// ************************************************************************** //
+
+namespace {
+
+struct unit_test_log_impl {
+ // Constructor
+ unit_test_log_impl()
+ : m_stream( runtime_config::log_sink() )
+ , m_stream_state_saver( new io_saver_type( *m_stream ) )
+ , m_threshold_level( log_all_errors )
+ , m_log_formatter( new output::compiler_log_formatter )
+ {
+ }
+
+ // log data
+ typedef scoped_ptr<unit_test_log_formatter> formatter_ptr;
+ typedef scoped_ptr<io_saver_type> saver_ptr;
+
+ std::ostream* m_stream;
+ saver_ptr m_stream_state_saver;
+ log_level m_threshold_level;
+ formatter_ptr m_log_formatter;
+
+ // entry data
+ bool m_entry_in_progress;
+ bool m_entry_started;
+ log_entry_data m_entry_data;
+
+ // check point data
+ log_checkpoint_data m_checkpoint_data;
+
+ // helper functions
+ std::ostream& stream() { return *m_stream; }
+ void set_checkpoint( const_string file, std::size_t line_num, const_string msg )
+ {
+ assign_op( m_checkpoint_data.m_message, msg, 0 );
+ m_checkpoint_data.m_file_name = file;
+ m_checkpoint_data.m_line_num = line_num;
+ }
+};
+
+unit_test_log_impl& s_log_impl() { static unit_test_log_impl the_inst; return the_inst; }
+
+} // local namespace
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_start( counter_t test_cases_amount )
+{
+ if( s_log_impl().m_threshold_level == log_nothing )
+ return;
+
+ s_log_impl().m_log_formatter->log_start( s_log_impl().stream(), test_cases_amount );
+
+ if( runtime_config::show_build_info() )
+ s_log_impl().m_log_formatter->log_build_info( s_log_impl().stream() );
+
+ s_log_impl().m_entry_in_progress = false;
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_finish()
+{
+ if( s_log_impl().m_threshold_level == log_nothing )
+ return;
+
+ s_log_impl().m_log_formatter->log_finish( s_log_impl().stream() );
+
+ s_log_impl().stream().flush();
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_aborted()
+{
+ BOOST_TEST_LOG_ENTRY( log_messages ) << "Test is aborted";
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_unit_start( test_unit const& tu )
+{
+ if( s_log_impl().m_threshold_level > log_test_units )
+ return;
+
+ if( s_log_impl().m_entry_in_progress )
+ *this << log::end();
+
+ s_log_impl().m_log_formatter->test_unit_start( s_log_impl().stream(), tu );
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_unit_finish( test_unit const& tu, unsigned long elapsed )
+{
+ if( s_log_impl().m_threshold_level > log_test_units )
+ return;
+
+ s_log_impl().m_checkpoint_data.clear();
+
+ if( s_log_impl().m_entry_in_progress )
+ *this << log::end();
+
+ s_log_impl().m_log_formatter->test_unit_finish( s_log_impl().stream(), tu, elapsed );
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_unit_skipped( test_unit const& tu )
+{
+ if( s_log_impl().m_threshold_level > log_test_units )
+ return;
+
+ if( s_log_impl().m_entry_in_progress )
+ *this << log::end();
+
+ s_log_impl().m_log_formatter->test_unit_skipped( s_log_impl().stream(), tu );
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::test_unit_aborted( test_unit const& )
+{
+ // do nothing
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::assertion_result( bool )
+{
+ // do nothing
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::exception_caught( execution_exception const& ex )
+{
+ log_level l =
+ ex.code() <= execution_exception::cpp_exception_error ? log_cpp_exception_errors :
+ (ex.code() <= execution_exception::timeout_error ? log_system_errors
+ : log_fatal_errors );
+
+ if( l >= s_log_impl().m_threshold_level ) {
+ if( s_log_impl().m_entry_in_progress )
+ *this << log::end();
+
+ s_log_impl().m_log_formatter->log_exception( s_log_impl().stream(), s_log_impl().m_checkpoint_data, ex );
+ }
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::set_checkpoint( const_string file, std::size_t line_num, const_string msg )
+{
+ s_log_impl().set_checkpoint( file, line_num, msg );
+}
+
+//____________________________________________________________________________//
+
+char
+set_unix_slash( char in )
+{
+ return in == '\\' ? '/' : in;
+}
+
+unit_test_log_t&
+unit_test_log_t::operator<<( log::begin const& b )
+{
+ if( s_log_impl().m_entry_in_progress )
+ *this << log::end();
+
+ s_log_impl().m_stream_state_saver->restore();
+
+ s_log_impl().m_entry_data.clear();
+
+ assign_op( s_log_impl().m_entry_data.m_file_name, b.m_file_name, 0 );
+
+ // normalize file name
+ std::transform( s_log_impl().m_entry_data.m_file_name.begin(), s_log_impl().m_entry_data.m_file_name.end(),
+ s_log_impl().m_entry_data.m_file_name.begin(),
+ &set_unix_slash );
+
+ s_log_impl().m_entry_data.m_line_num = b.m_line_num;
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+unit_test_log_t&
+unit_test_log_t::operator<<( log::end const& )
+{
+ if( s_log_impl().m_entry_in_progress )
+ s_log_impl().m_log_formatter->log_entry_finish( s_log_impl().stream() );
+
+ s_log_impl().m_entry_in_progress = false;
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+unit_test_log_t&
+unit_test_log_t::operator<<( log_level l )
+{
+ s_log_impl().m_entry_data.m_level = l;
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+ut_detail::entry_value_collector
+unit_test_log_t::operator()( log_level l )
+{
+ *this << l;
+
+ return ut_detail::entry_value_collector();
+}
+
+//____________________________________________________________________________//
+
+bool
+unit_test_log_t::log_entry_start()
+{
+ if( s_log_impl().m_entry_in_progress )
+ return true;
+
+ switch( s_log_impl().m_entry_data.m_level ) {
+ case log_successful_tests:
+ s_log_impl().m_log_formatter->log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
+ unit_test_log_formatter::BOOST_UTL_ET_INFO );
+ break;
+ case log_messages:
+ s_log_impl().m_log_formatter->log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
+ unit_test_log_formatter::BOOST_UTL_ET_MESSAGE );
+ break;
+ case log_warnings:
+ s_log_impl().m_log_formatter->log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
+ unit_test_log_formatter::BOOST_UTL_ET_WARNING );
+ break;
+ case log_all_errors:
+ case log_cpp_exception_errors:
+ case log_system_errors:
+ s_log_impl().m_log_formatter->log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
+ unit_test_log_formatter::BOOST_UTL_ET_ERROR );
+ break;
+ case log_fatal_errors:
+ s_log_impl().m_log_formatter->log_entry_start( s_log_impl().stream(), s_log_impl().m_entry_data,
+ unit_test_log_formatter::BOOST_UTL_ET_FATAL_ERROR );
+ break;
+ case log_nothing:
+ case log_test_units:
+ case invalid_log_level:
+ return false;
+ }
+
+ s_log_impl().m_entry_in_progress = true;
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+unit_test_log_t&
+unit_test_log_t::operator<<( const_string value )
+{
+ if( s_log_impl().m_entry_data.m_level >= s_log_impl().m_threshold_level && !value.empty() && log_entry_start() )
+ s_log_impl().m_log_formatter->log_entry_value( s_log_impl().stream(), value );
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+unit_test_log_t&
+unit_test_log_t::operator<<( lazy_ostream const& value )
+{
+ if( s_log_impl().m_entry_data.m_level >= s_log_impl().m_threshold_level && !value.empty() && log_entry_start() )
+ s_log_impl().m_log_formatter->log_entry_value( s_log_impl().stream(), value );
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::set_stream( std::ostream& str )
+{
+ if( s_log_impl().m_entry_in_progress )
+ return;
+
+ s_log_impl().m_stream = &str;
+ s_log_impl().m_stream_state_saver.reset( new io_saver_type( str ) );
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::set_threshold_level( log_level lev )
+{
+ if( s_log_impl().m_entry_in_progress || lev == invalid_log_level )
+ return;
+
+ s_log_impl().m_threshold_level = lev;
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::set_format( output_format log_format )
+{
+ if( s_log_impl().m_entry_in_progress )
+ return;
+
+ if( log_format == CLF )
+ set_formatter( new output::compiler_log_formatter );
+ else
+ set_formatter( new output::xml_log_formatter );
+}
+
+//____________________________________________________________________________//
+
+void
+unit_test_log_t::set_formatter( unit_test_log_formatter* the_formatter )
+{
+ s_log_impl().m_log_formatter.reset( the_formatter );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** unit_test_log_formatter ************** //
+// ************************************************************************** //
+
+void
+unit_test_log_formatter::log_entry_value( std::ostream& ostr, lazy_ostream const& value )
+{
+ log_entry_value( ostr, (wrap_stringstream().ref() << value).str() );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_LOG_IPP_012205GER
diff --git a/ndnboost/test/impl/unit_test_main.ipp b/ndnboost/test/impl/unit_test_main.ipp
new file mode 100644
index 0000000..bde871f
--- /dev/null
+++ b/ndnboost/test/impl/unit_test_main.ipp
@@ -0,0 +1,246 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : main function implementation for Unit Test Framework
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_MAIN_IPP_012205GER
+#define BOOST_TEST_UNIT_TEST_MAIN_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/results_reporter.hpp>
+
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+#if !defined(__BORLANDC__) && !BOOST_WORKAROUND( BOOST_MSVC, < 1300 ) && !BOOST_WORKAROUND( __SUNPRO_CC, < 0x5100 )
+#define BOOST_TEST_SUPPORT_RUN_BY_NAME
+#include <ndnboost/test/utils/iterator/token_iterator.hpp>
+#endif
+
+// Boost
+#include <ndnboost/cstdlib.hpp>
+#include <ndnboost/bind.hpp>
+
+// STL
+#include <stdexcept>
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** test_case_filter ************** //
+// ************************************************************************** //
+
+class test_case_filter : public test_tree_visitor {
+public:
+ struct single_filter {
+ single_filter( const_string in )
+ {
+ if( in == "*" )
+ m_kind = SFK_ALL;
+ else if( first_char( in ) == '*' && last_char( in ) == '*' ) {
+ m_kind = SFK_SUBSTR;
+ m_value = in.substr( 1, in.size()-1 );
+ }
+ else if( first_char( in ) == '*' ) {
+ m_kind = SFK_TRAILING;
+ m_value = in.substr( 1 );
+ }
+ else if( last_char( in ) == '*' ) {
+ m_kind = SFK_LEADING;
+ m_value = in.substr( 0, in.size()-1 );
+ }
+ else {
+ m_kind = SFK_MATCH;
+ m_value = in;
+ }
+ };
+
+ bool pass( test_unit const& tu ) const
+ {
+ const_string name( tu.p_name );
+
+ switch( m_kind ) {
+ default:
+ case SFK_ALL:
+ return true;
+
+ case SFK_LEADING:
+ return name.substr( 0, m_value.size() ) == m_value;
+
+ case SFK_TRAILING:
+ return name.size() >= m_value.size() && name.substr( name.size() - m_value.size() ) == m_value;
+
+ case SFK_SUBSTR:
+ return name.find( m_value ) != const_string::npos;
+
+ case SFK_MATCH:
+ return m_value == tu.p_name.get();
+ }
+ }
+ enum kind { SFK_ALL, SFK_LEADING, SFK_TRAILING, SFK_SUBSTR, SFK_MATCH };
+
+ kind m_kind;
+ const_string m_value;
+ };
+ // Constructor
+#ifndef BOOST_TEST_SUPPORT_RUN_BY_NAME
+ explicit test_case_filter( const_string ) : m_depth( 0 ) {}
+#else
+ explicit test_case_filter( const_string tc_to_run )
+ : m_depth( 0 )
+ {
+ string_token_iterator tit( tc_to_run, (dropped_delimeters = "/", kept_delimeters = dt_none) );
+
+ while( tit != string_token_iterator() ) {
+ m_filters.push_back(
+ std::vector<single_filter>( string_token_iterator( *tit, (dropped_delimeters = ",", kept_delimeters = dt_none) ),
+ string_token_iterator() ) );
+
+ ++tit;
+ }
+ }
+#endif
+
+ void filter_unit( test_unit const& tu )
+ {
+ if( (++m_depth - 1) > m_filters.size() ) {
+ tu.p_enabled.value = true;
+ return;
+ }
+
+ if( m_depth == 1 )
+ return;
+
+ std::vector<single_filter> const& filters = m_filters[m_depth-2];
+
+ tu.p_enabled.value =
+ std::find_if( filters.begin(), filters.end(), bind( &single_filter::pass, _1, ndnboost::ref(tu) ) ) != filters.end();
+ }
+
+ // test tree visitor interface
+ virtual void visit( test_case const& tc )
+ {
+ if( m_depth < m_filters.size() ) {
+ tc.p_enabled.value = false;
+ return;
+ }
+
+ filter_unit( tc );
+
+ --m_depth;
+ }
+
+ virtual bool test_suite_start( test_suite const& ts )
+ {
+ filter_unit( ts );
+
+ if( !ts.p_enabled )
+ --m_depth;
+
+ return ts.p_enabled;
+ }
+
+ virtual void test_suite_finish( test_suite const& ) { --m_depth; }
+
+private:
+ // Data members
+ std::vector<std::vector<single_filter> > m_filters;
+ unsigned m_depth;
+};
+
+// ************************************************************************** //
+// ************** unit_test_main ************** //
+// ************************************************************************** //
+
+int BOOST_TEST_DECL
+unit_test_main( init_unit_test_func init_func, int argc, char* argv[] )
+{
+ try {
+ framework::init( init_func, argc, argv );
+
+ if( !runtime_config::test_to_run().is_empty() ) {
+ test_case_filter filter( runtime_config::test_to_run() );
+
+ traverse_test_tree( framework::master_test_suite().p_id, filter );
+ }
+
+ framework::run();
+
+ results_reporter::make_report();
+
+ return runtime_config::no_result_code()
+ ? ndnboost::exit_success
+ : results_collector.results( framework::master_test_suite().p_id ).result_code();
+ }
+ catch( framework::nothing_to_test const& ) {
+ return ndnboost::exit_success;
+ }
+ catch( framework::internal_error const& ex ) {
+ results_reporter::get_stream() << "Boost.Test framework internal error: " << ex.what() << std::endl;
+
+ return ndnboost::exit_exception_failure;
+ }
+ catch( framework::setup_error const& ex ) {
+ results_reporter::get_stream() << "Test setup error: " << ex.what() << std::endl;
+
+ return ndnboost::exit_exception_failure;
+ }
+ catch( ... ) {
+ results_reporter::get_stream() << "Boost.Test framework internal error: unknown reason" << std::endl;
+
+ return ndnboost::exit_exception_failure;
+ }
+}
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#if !defined(BOOST_TEST_DYN_LINK) && !defined(BOOST_TEST_NO_MAIN)
+
+// ************************************************************************** //
+// ************** main function for tests using lib ************** //
+// ************************************************************************** //
+
+int BOOST_TEST_CALL_DECL
+main( int argc, char* argv[] )
+{
+ // prototype for user's unit test init function
+#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
+ extern bool init_unit_test();
+
+ ndnboost::unit_test::init_unit_test_func init_func = &init_unit_test;
+#else
+ extern ::ndnboost::unit_test::test_suite* init_unit_test_suite( int argc, char* argv[] );
+
+ ndnboost::unit_test::init_unit_test_func init_func = &init_unit_test_suite;
+#endif
+
+ return ::ndnboost::unit_test::unit_test_main( init_func, argc, argv );
+}
+
+#endif // !BOOST_TEST_DYN_LINK && !BOOST_TEST_NO_MAIN
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_MAIN_IPP_012205GER
diff --git a/ndnboost/test/impl/unit_test_monitor.ipp b/ndnboost/test/impl/unit_test_monitor.ipp
new file mode 100644
index 0000000..0932bf3
--- /dev/null
+++ b/ndnboost/test/impl/unit_test_monitor.ipp
@@ -0,0 +1,101 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : implements specific subclass of Executon Monitor used by Unit
+// Test Framework to monitor test cases run.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_MONITOR_IPP_012205GER
+#define BOOST_TEST_UNIT_TEST_MONITOR_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/unit_test_monitor.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/test_tools.hpp>
+#include <ndnboost/test/framework.hpp>
+
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace {
+
+template<typename F>
+struct zero_return_wrapper_t {
+ explicit zero_return_wrapper_t( F const& f ) : m_f( f ) {}
+
+ int operator()() { m_f(); return 0; }
+
+ F const& m_f;
+};
+
+template<typename F>
+zero_return_wrapper_t<F>
+zero_return_wrapper( F const& f )
+{
+ return zero_return_wrapper_t<F>( f );
+}
+
+}
+
+// ************************************************************************** //
+// ************** unit_test_monitor ************** //
+// ************************************************************************** //
+
+unit_test_monitor_t::error_level
+unit_test_monitor_t::execute_and_translate( test_case const& tc )
+{
+ try {
+ p_catch_system_errors.value = runtime_config::catch_sys_errors();
+ p_timeout.value = tc.p_timeout.get();
+ p_auto_start_dbg.value = runtime_config::auto_start_dbg();
+ p_use_alt_stack.value = runtime_config::use_alt_stack();
+ p_detect_fp_exceptions.value = runtime_config::detect_fp_exceptions();
+
+ execute( callback0<int>( zero_return_wrapper( tc.test_func() ) ) );
+ }
+ catch( execution_exception const& ex ) {
+ framework::exception_caught( ex );
+ framework::test_unit_aborted( framework::current_test_case() );
+
+ // translate execution_exception::error_code to error_level
+ switch( ex.code() ) {
+ case execution_exception::no_error: return test_ok;
+ case execution_exception::user_error: return unexpected_exception;
+ case execution_exception::cpp_exception_error: return unexpected_exception;
+ case execution_exception::system_error: return os_exception;
+ case execution_exception::timeout_error: return os_timeout;
+ case execution_exception::user_fatal_error:
+ case execution_exception::system_fatal_error: return fatal_error;
+ default: return unexpected_exception;
+ }
+ }
+
+ return test_ok;
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_MONITOR_IPP_012205GER
diff --git a/ndnboost/test/impl/unit_test_parameters.ipp b/ndnboost/test/impl/unit_test_parameters.ipp
new file mode 100644
index 0000000..ffc29c9
--- /dev/null
+++ b/ndnboost/test/impl/unit_test_parameters.ipp
@@ -0,0 +1,527 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 63640 $
+//
+// Description : simple implementation for Unit Test Framework parameter
+// handling routines. May be rewritten in future to use some kind of
+// command-line arguments parsing facility and environment variable handling
+// facility
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_PARAMETERS_IPP_012205GER
+#define BOOST_TEST_UNIT_TEST_PARAMETERS_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/fixed_mapping.hpp>
+#include <ndnboost/test/debug.hpp>
+#include <ndnboost/test/framework.hpp>
+
+// Boost.Runtime.Param
+#include <ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/parser.hpp>
+
+namespace rt = ndnboost::runtime;
+namespace cla = rt::cla;
+
+
+#ifndef UNDER_CE
+#include <ndnboost/test/utils/runtime/env/variable.hpp>
+
+namespace env = rt::env;
+#endif
+
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+#include <ndnboost/lexical_cast.hpp>
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+// STL
+#include <map>
+#include <cstdlib>
+#include <iostream>
+#include <fstream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::getenv; using ::strncmp; using ::strcmp; }
+# endif
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** input operations for unit_test's enums ************** //
+// ************************************************************************** //
+
+std::istream&
+operator>>( std::istream& in, unit_test::log_level& ll )
+{
+ static fixed_mapping<const_string,unit_test::log_level,case_ins_less<char const> > log_level_name(
+ "all" , log_successful_tests,
+ "success" , log_successful_tests,
+ "test_suite" , log_test_units,
+ "unit_scope" , log_test_units,
+ "message" , log_messages,
+ "warning" , log_warnings,
+ "error" , log_all_errors,
+ "cpp_exception" , log_cpp_exception_errors,
+ "system_error" , log_system_errors,
+ "fatal_error" , log_fatal_errors,
+ "nothing" , log_nothing,
+
+ invalid_log_level
+ );
+
+ std::string val;
+ in >> val;
+
+ ll = log_level_name[val];
+ BOOST_TEST_SETUP_ASSERT( ll != unit_test::invalid_log_level, "invalid log level " + val );
+
+ return in;
+}
+
+//____________________________________________________________________________//
+
+std::istream&
+operator>>( std::istream& in, unit_test::report_level& rl )
+{
+ fixed_mapping<const_string,unit_test::report_level,case_ins_less<char const> > report_level_name (
+ "confirm", CONFIRMATION_REPORT,
+ "short", SHORT_REPORT,
+ "detailed", DETAILED_REPORT,
+ "no", NO_REPORT,
+
+ INV_REPORT_LEVEL
+ );
+
+ std::string val;
+ in >> val;
+
+ rl = report_level_name[val];
+ BOOST_TEST_SETUP_ASSERT( rl != INV_REPORT_LEVEL, "invalid report level " + val );
+
+ return in;
+}
+
+//____________________________________________________________________________//
+
+std::istream&
+operator>>( std::istream& in, unit_test::output_format& of )
+{
+ fixed_mapping<const_string,unit_test::output_format,case_ins_less<char const> > output_format_name (
+ "HRF", unit_test::CLF,
+ "CLF", unit_test::CLF,
+ "XML", unit_test::XML,
+
+ unit_test::INV_OF
+ );
+
+ std::string val;
+ in >> val;
+
+ of = output_format_name[val];
+ BOOST_TEST_SETUP_ASSERT( of != unit_test::INV_OF, "invalid output format " + val );
+
+ return in;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** runtime_config ************** //
+// ************************************************************************** //
+
+namespace runtime_config {
+
+namespace {
+
+// framework parameters and corresponding command-line arguments
+std::string AUTO_START_DBG = "auto_start_dbg";
+std::string BREAK_EXEC_PATH = "break_exec_path";
+std::string BUILD_INFO = "build_info";
+std::string CATCH_SYS_ERRORS = "catch_system_errors";
+std::string DETECT_FP_EXCEPT = "detect_fp_exceptions";
+std::string DETECT_MEM_LEAKS = "detect_memory_leaks";
+std::string LOG_FORMAT = "log_format";
+std::string LOG_LEVEL = "log_level";
+std::string LOG_SINK = "log_sink";
+std::string OUTPUT_FORMAT = "output_format";
+std::string RANDOM_SEED = "random";
+std::string REPORT_FORMAT = "report_format";
+std::string REPORT_LEVEL = "report_level";
+std::string REPORT_SINK = "report_sink";
+std::string RESULT_CODE = "result_code";
+std::string TESTS_TO_RUN = "run_test";
+std::string SAVE_TEST_PATTERN = "save_pattern";
+std::string SHOW_PROGRESS = "show_progress";
+std::string USE_ALT_STACK = "use_alt_stack";
+
+fixed_mapping<const_string,const_string> parameter_2_env_var(
+ AUTO_START_DBG , "BOOST_TEST_AUTO_START_DBG",
+ BREAK_EXEC_PATH , "BOOST_TEST_BREAK_EXEC_PATH",
+ BUILD_INFO , "BOOST_TEST_BUILD_INFO",
+ CATCH_SYS_ERRORS , "BOOST_TEST_CATCH_SYSTEM_ERRORS",
+ DETECT_FP_EXCEPT , "BOOST_TEST_DETECT_FP_EXCEPTIONS",
+ DETECT_MEM_LEAKS , "BOOST_TEST_DETECT_MEMORY_LEAK",
+ LOG_FORMAT , "BOOST_TEST_LOG_FORMAT",
+ LOG_LEVEL , "BOOST_TEST_LOG_LEVEL",
+ LOG_SINK , "BOOST_TEST_LOG_SINK",
+ OUTPUT_FORMAT , "BOOST_TEST_OUTPUT_FORMAT",
+ RANDOM_SEED , "BOOST_TEST_RANDOM",
+ REPORT_FORMAT , "BOOST_TEST_REPORT_FORMAT",
+ REPORT_LEVEL , "BOOST_TEST_REPORT_LEVEL",
+ REPORT_SINK , "BOOST_TEST_REPORT_SINK",
+ RESULT_CODE , "BOOST_TEST_RESULT_CODE",
+ TESTS_TO_RUN , "BOOST_TESTS_TO_RUN",
+ SAVE_TEST_PATTERN , "BOOST_TEST_SAVE_PATTERN",
+ SHOW_PROGRESS , "BOOST_TEST_SHOW_PROGRESS",
+ USE_ALT_STACK , "BOOST_TEST_USE_ALT_STACK",
+
+ ""
+);
+
+//____________________________________________________________________________//
+
+// storage for the CLAs
+cla::parser s_cla_parser;
+std::string s_empty;
+
+output_format s_report_format;
+output_format s_log_format;
+
+//____________________________________________________________________________//
+
+template<typename T>
+T
+retrieve_parameter( const_string parameter_name, cla::parser const& s_cla_parser, T const& default_value = T(), T const& optional_value = T() )
+{
+ rt::const_argument_ptr arg = s_cla_parser[parameter_name];
+ if( arg ) {
+ if( rtti::type_id<T>() == rtti::type_id<bool>() ||
+ !static_cast<cla::parameter const&>( arg->p_formal_parameter.get() ).p_optional_value )
+ return s_cla_parser.get<T>( parameter_name );
+
+ optional<T> val = s_cla_parser.get<optional<T> >( parameter_name );
+ if( val )
+ return *val;
+ else
+ return optional_value;
+ }
+
+ ndnboost::optional<T> v;
+
+#ifndef UNDER_CE
+ env::get( parameter_2_env_var[parameter_name], v );
+#endif
+
+ if( v )
+ return *v;
+ else
+ return default_value;
+}
+
+//____________________________________________________________________________//
+
+} // local namespace
+
+void
+init( int& argc, char** argv )
+{
+ using namespace cla;
+
+ try {
+ s_cla_parser - cla::ignore_mismatch
+ << cla::dual_name_parameter<bool>( AUTO_START_DBG + "|d" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Automatically starts debugger if system level error (signal) occurs")
+ << cla::named_parameter<std::string>( BREAK_EXEC_PATH )
+ - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,
+ cla::description = "For the exception safety testing allows to break at specific execution path")
+ << cla::dual_name_parameter<bool>( BUILD_INFO + "|i" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Shows library build information" )
+ << cla::dual_name_parameter<bool>( CATCH_SYS_ERRORS + "|s" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Allows to switch between catching and ignoring system errors (signals)")
+ << cla::named_parameter<bool>( DETECT_FP_EXCEPT )
+ - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,
+ cla::description = "Allows to switch between catching and ignoring floating point exceptions")
+ << cla::named_parameter<long>( DETECT_MEM_LEAKS )
+ - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,
+ cla::description = "Allows to switch between catching and ignoring memory leaks")
+ << cla::dual_name_parameter<unit_test::output_format>( LOG_FORMAT + "|f" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies log format")
+ << cla::dual_name_parameter<unit_test::log_level>( LOG_LEVEL + "|l" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies log level")
+ << cla::dual_name_parameter<std::string>( LOG_SINK + "|k" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies log sink:stdout(default),stderr or file name")
+ << cla::dual_name_parameter<unit_test::output_format>( OUTPUT_FORMAT + "|o" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies output format (both log and report)")
+ << cla::dual_name_parameter<int>( RANDOM_SEED + "|a" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,cla::optional_value,
+ cla::description = "Allows to switch between sequential and random order of test units execution.\n"
+ "Optionally allows to specify concrete seed for random number generator")
+ << cla::dual_name_parameter<unit_test::output_format>( REPORT_FORMAT + "|m" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies report format")
+ << cla::dual_name_parameter<unit_test::report_level>(REPORT_LEVEL + "|r")
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies report level")
+ << cla::dual_name_parameter<std::string>( REPORT_SINK + "|e" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Specifies report sink:stderr(default),stdout or file name")
+ << cla::dual_name_parameter<bool>( RESULT_CODE + "|c" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Allows to disable test modules's result code generation")
+ << cla::dual_name_parameter<std::string>( TESTS_TO_RUN + "|t" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Allows to filter which test units to run")
+ << cla::named_parameter<bool>( SAVE_TEST_PATTERN )
+ - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,
+ cla::description = "Allows to switch between saving and matching against test pattern file")
+ << cla::dual_name_parameter<bool>( SHOW_PROGRESS + "|p" )
+ - (cla::prefix = "--|-",cla::separator = "=| ",cla::guess_name,cla::optional,
+ cla::description = "Turns on progress display")
+ << cla::named_parameter<bool>( USE_ALT_STACK )
+ - (cla::prefix = "--",cla::separator = "=",cla::guess_name,cla::optional,
+ cla::description = "Turns on/off usage of an alternative stack for signal handling")
+
+ << cla::dual_name_parameter<bool>( "help|?" )
+ - (cla::prefix = "--|-",cla::separator = "=",cla::guess_name,cla::optional,
+ cla::description = "this help message")
+ ;
+
+ s_cla_parser.parse( argc, argv );
+
+ if( s_cla_parser["help"] ) {
+ s_cla_parser.help( std::cout );
+ throw framework::nothing_to_test();
+ }
+
+ s_report_format = retrieve_parameter( REPORT_FORMAT, s_cla_parser, unit_test::CLF );
+ s_log_format = retrieve_parameter( LOG_FORMAT, s_cla_parser, unit_test::CLF );
+
+ unit_test::output_format of = retrieve_parameter( OUTPUT_FORMAT, s_cla_parser, unit_test::INV_OF );
+
+ if( of != unit_test::INV_OF )
+ s_report_format = s_log_format = of;
+ }
+ catch( rt::logic_error const& ex ) {
+ std::ostringstream err;
+
+ err << "Fail to process runtime parameters: " << ex.msg() << std::endl;
+ s_cla_parser.usage( err );
+
+ throw framework::setup_error( err.str() );
+ }
+}
+
+//____________________________________________________________________________//
+
+unit_test::log_level
+log_level()
+{
+ return retrieve_parameter( LOG_LEVEL, s_cla_parser, unit_test::log_all_errors );
+}
+
+//____________________________________________________________________________//
+
+bool
+no_result_code()
+{
+ return !retrieve_parameter( RESULT_CODE, s_cla_parser, true );
+}
+
+//____________________________________________________________________________//
+
+unit_test::report_level
+report_level()
+{
+ return retrieve_parameter( REPORT_LEVEL, s_cla_parser, unit_test::CONFIRMATION_REPORT );
+}
+
+//____________________________________________________________________________//
+
+const_string
+test_to_run()
+{
+ static std::string s_test_to_run = retrieve_parameter( TESTS_TO_RUN, s_cla_parser, s_empty );
+
+ return s_test_to_run;
+}
+
+//____________________________________________________________________________//
+
+const_string
+break_exec_path()
+{
+ static std::string s_break_exec_path = retrieve_parameter( BREAK_EXEC_PATH, s_cla_parser, s_empty );
+
+ return s_break_exec_path;
+}
+
+//____________________________________________________________________________//
+
+bool
+save_pattern()
+{
+ return retrieve_parameter( SAVE_TEST_PATTERN, s_cla_parser, false );
+}
+
+//____________________________________________________________________________//
+
+bool
+show_progress()
+{
+ return retrieve_parameter( SHOW_PROGRESS, s_cla_parser, false );
+}
+
+//____________________________________________________________________________//
+
+bool
+show_build_info()
+{
+ return retrieve_parameter( BUILD_INFO, s_cla_parser, false );
+}
+
+//____________________________________________________________________________//
+
+bool
+catch_sys_errors()
+{
+ return retrieve_parameter( CATCH_SYS_ERRORS, s_cla_parser,
+#ifdef BOOST_TEST_DEFAULTS_TO_CORE_DUMP
+ false
+#else
+ true
+#endif
+ );
+}
+
+//____________________________________________________________________________//
+
+bool
+auto_start_dbg()
+{
+ // !! set debugger as an option
+ return retrieve_parameter( AUTO_START_DBG, s_cla_parser, false );
+;
+}
+
+//____________________________________________________________________________//
+
+bool
+use_alt_stack()
+{
+ return retrieve_parameter( USE_ALT_STACK, s_cla_parser, true );
+}
+
+//____________________________________________________________________________//
+
+bool
+detect_fp_exceptions()
+{
+ return retrieve_parameter( DETECT_FP_EXCEPT, s_cla_parser, false );
+}
+
+//____________________________________________________________________________//
+
+output_format
+report_format()
+{
+ return s_report_format;
+}
+
+//____________________________________________________________________________//
+
+output_format
+log_format()
+{
+ return s_log_format;
+}
+
+//____________________________________________________________________________//
+
+std::ostream*
+report_sink()
+{
+ std::string sink_name = retrieve_parameter( REPORT_SINK, s_cla_parser, s_empty );
+
+ if( sink_name.empty() || sink_name == "stderr" )
+ return &std::cerr;
+
+ if( sink_name == "stdout" )
+ return &std::cout;
+
+ static std::ofstream log_file( sink_name.c_str() );
+ return &log_file;
+}
+
+//____________________________________________________________________________//
+
+std::ostream*
+log_sink()
+{
+ std::string sink_name = retrieve_parameter( LOG_SINK, s_cla_parser, s_empty );
+
+ if( sink_name.empty() || sink_name == "stdout" )
+ return &std::cout;
+
+ if( sink_name == "stderr" )
+ return &std::cerr;
+
+ static std::ofstream report_file( sink_name.c_str() );
+ return &report_file;
+}
+
+//____________________________________________________________________________//
+
+long
+detect_memory_leaks()
+{
+ return retrieve_parameter( DETECT_MEM_LEAKS, s_cla_parser, static_cast<long>(1) );
+}
+
+//____________________________________________________________________________//
+
+int
+random_seed()
+{
+ return retrieve_parameter( RANDOM_SEED, s_cla_parser, 0, 1 );
+}
+
+//____________________________________________________________________________//
+
+} // namespace runtime_config
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_PARAMETERS_IPP_012205GER
diff --git a/ndnboost/test/impl/unit_test_suite.ipp b/ndnboost/test/impl/unit_test_suite.ipp
new file mode 100644
index 0000000..983682d
--- /dev/null
+++ b/ndnboost/test/impl/unit_test_suite.ipp
@@ -0,0 +1,346 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : privides core implementation for Unit Test Framework.
+// Extensions can be provided in separate files
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_SUITE_IPP_012205GER
+#define BOOST_TEST_UNIT_TEST_SUITE_IPP_012205GER
+
+// Boost.Test
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/detail/unit_test_parameters.hpp>
+
+// Boost
+#include <ndnboost/timer.hpp>
+
+// STL
+#include <algorithm>
+#include <vector>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+#if BOOST_WORKAROUND(__BORLANDC__, < 0x600) && \
+ BOOST_WORKAROUND(_STLPORT_VERSION, <= 0x450) \
+ /**/
+ using std::rand; // rand is in std and random_shuffle is in _STL
+#endif
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** test_unit ************** //
+// ************************************************************************** //
+
+test_unit::test_unit( const_string name, test_unit_type t )
+: p_type( t )
+, p_type_name( t == tut_case ? "case" : "suite" )
+, p_id( INV_TEST_UNIT_ID )
+, p_name( std::string( name.begin(), name.size() ) )
+, p_enabled( true )
+{
+}
+
+//____________________________________________________________________________//
+
+test_unit::~test_unit()
+{
+ framework::deregister_test_unit( this );
+}
+
+//____________________________________________________________________________//
+
+void
+test_unit::depends_on( test_unit* tu )
+{
+ m_dependencies.push_back( tu->p_id );
+}
+
+//____________________________________________________________________________//
+
+bool
+test_unit::check_dependencies() const
+{
+ BOOST_TEST_FOREACH( test_unit_id, tu_id, m_dependencies ) {
+ if( !unit_test::results_collector.results( tu_id ).passed() )
+ return false;
+ }
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+void
+test_unit::increase_exp_fail( unsigned num )
+{
+ p_expected_failures.value += num;
+
+ if( p_parent_id != 0 )
+ framework::get<test_suite>( p_parent_id ).increase_exp_fail( num );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** test_case ************** //
+// ************************************************************************** //
+
+test_case::test_case( const_string name, callback0<> const& test_func )
+: test_unit( name, static_cast<test_unit_type>(type) )
+, m_test_func( test_func )
+{
+ // !! weirdest MSVC BUG; try to remove this statement; looks like it eats first token of next statement
+#if BOOST_WORKAROUND(BOOST_MSVC,<1300)
+ 0;
+#endif
+ framework::register_test_unit( this );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** test_suite ************** //
+// ************************************************************************** //
+
+//____________________________________________________________________________//
+
+test_suite::test_suite( const_string name )
+: test_unit( name, static_cast<test_unit_type>(type) )
+{
+ framework::register_test_unit( this );
+}
+
+//____________________________________________________________________________//
+
+void
+test_suite::add( test_unit* tu, counter_t expected_failures, unsigned timeout )
+{
+ if( timeout != 0 )
+ tu->p_timeout.value = timeout;
+
+ m_members.push_back( tu->p_id );
+ tu->p_parent_id.value = p_id;
+
+ if( tu->p_expected_failures )
+ increase_exp_fail( tu->p_expected_failures );
+
+ if( expected_failures )
+ tu->increase_exp_fail( expected_failures );
+}
+
+//____________________________________________________________________________//
+
+void
+test_suite::add( test_unit_generator const& gen, unsigned timeout )
+{
+ test_unit* tu;
+ while((tu = gen.next(), tu))
+ add( tu, 0, timeout );
+}
+
+//____________________________________________________________________________//
+
+void
+test_suite::remove( test_unit_id id )
+{
+ std::vector<test_unit_id>::iterator it = std::find( m_members.begin(), m_members.end(), id );
+
+ if( it != m_members.end() )
+ m_members.erase( it );
+}
+
+//____________________________________________________________________________//
+
+test_unit_id
+test_suite::get( const_string tu_name ) const
+{
+ BOOST_TEST_FOREACH( test_unit_id, id, m_members ) {
+ if( tu_name == framework::get( id, ut_detail::test_id_2_unit_type( id ) ).p_name.get() )
+ return id;
+ }
+
+ return INV_TEST_UNIT_ID;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** traverse_test_tree ************** //
+// ************************************************************************** //
+
+void
+traverse_test_tree( test_case const& tc, test_tree_visitor& V )
+{
+ if( tc.p_enabled )
+ V.visit( tc );
+}
+
+//____________________________________________________________________________//
+
+void
+traverse_test_tree( test_suite const& suite, test_tree_visitor& V )
+{
+ if( !suite.p_enabled || !V.test_suite_start( suite ) )
+ return;
+
+ try {
+ if( runtime_config::random_seed() == 0 ) {
+ BOOST_TEST_FOREACH( test_unit_id, id, suite.m_members )
+ traverse_test_tree( id, V );
+ }
+ else {
+ std::vector<test_unit_id> members( suite.m_members );
+ std::random_shuffle( members.begin(), members.end() );
+ BOOST_TEST_FOREACH( test_unit_id, id, members )
+ traverse_test_tree( id, V );
+ }
+
+ } catch( test_being_aborted const& ) {
+ V.test_suite_finish( suite );
+ framework::test_unit_aborted( suite );
+
+ throw;
+ }
+
+ V.test_suite_finish( suite );
+}
+
+//____________________________________________________________________________//
+
+void
+traverse_test_tree( test_unit_id id, test_tree_visitor& V )
+{
+ if( ut_detail::test_id_2_unit_type( id ) == tut_case )
+ traverse_test_tree( framework::get<test_case>( id ), V );
+ else
+ traverse_test_tree( framework::get<test_suite>( id ), V );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** test_case_counter ************** //
+// ************************************************************************** //
+
+void
+test_case_counter::visit( test_case const& tc )
+{
+ if( tc.p_enabled )
+ ++p_count.value;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** object generators ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+std::string
+normalize_test_case_name( const_string name )
+{
+ return ( name[0] == '&'
+ ? std::string( name.begin()+1, name.size()-1 )
+ : std::string( name.begin(), name.size() ) );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** auto_test_unit_registrar ************** //
+// ************************************************************************** //
+
+auto_test_unit_registrar::auto_test_unit_registrar( test_case* tc, counter_t exp_fail )
+{
+ curr_ts_store().back()->add( tc, exp_fail );
+}
+
+//____________________________________________________________________________//
+
+auto_test_unit_registrar::auto_test_unit_registrar( const_string ts_name )
+{
+ test_unit_id id = curr_ts_store().back()->get( ts_name );
+
+ test_suite* ts;
+
+ if( id != INV_TEST_UNIT_ID ) {
+ ts = &framework::get<test_suite>( id ); // !! test for invalid tu type
+ BOOST_ASSERT( ts->p_parent_id == curr_ts_store().back()->p_id );
+ }
+ else {
+ ts = new test_suite( ts_name );
+ curr_ts_store().back()->add( ts );
+ }
+
+ curr_ts_store().push_back( ts );
+}
+
+//____________________________________________________________________________//
+
+auto_test_unit_registrar::auto_test_unit_registrar( test_unit_generator const& tc_gen )
+{
+ curr_ts_store().back()->add( tc_gen );
+}
+
+//____________________________________________________________________________//
+
+auto_test_unit_registrar::auto_test_unit_registrar( int )
+{
+ if( curr_ts_store().size() == 0 )
+ return; // report error?
+
+ curr_ts_store().pop_back();
+}
+
+//____________________________________________________________________________//
+
+std::list<test_suite*>&
+auto_test_unit_registrar::curr_ts_store()
+{
+ static std::list<test_suite*> inst( 1, &framework::master_test_suite() );
+ return inst;
+}
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** global_fixture ************** //
+// ************************************************************************** //
+
+global_fixture::global_fixture()
+{
+ framework::register_observer( *this );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_SUITE_IPP_012205GER
diff --git a/ndnboost/test/impl/xml_log_formatter.ipp b/ndnboost/test/impl/xml_log_formatter.ipp
new file mode 100644
index 0000000..0bf6460
--- /dev/null
+++ b/ndnboost/test/impl/xml_log_formatter.ipp
@@ -0,0 +1,180 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : implements XML Log formatter
+// ***************************************************************************
+
+#ifndef BOOST_TEST_XML_LOG_FORMATTER_IPP_020105GER
+#define BOOST_TEST_XML_LOG_FORMATTER_IPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/output/xml_log_formatter.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/framework.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+#include <ndnboost/test/utils/xml_printer.hpp>
+
+// Boost
+#include <ndnboost/version.hpp>
+
+// STL
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+static const_string tu_type_name( test_unit const& tu )
+{
+ return tu.p_type == tut_case ? "TestCase" : "TestSuite";
+}
+
+// ************************************************************************** //
+// ************** xml_log_formatter ************** //
+// ************************************************************************** //
+
+void
+xml_log_formatter::log_start( std::ostream& ostr, counter_t )
+{
+ ostr << "<TestLog>";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::log_finish( std::ostream& ostr )
+{
+ ostr << "</TestLog>";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::log_build_info( std::ostream& ostr )
+{
+ ostr << "<BuildInfo"
+ << " platform" << attr_value() << BOOST_PLATFORM
+ << " compiler" << attr_value() << BOOST_COMPILER
+ << " stl" << attr_value() << BOOST_STDLIB
+ << " boost=\"" << BOOST_VERSION/100000 << "."
+ << BOOST_VERSION/100 % 1000 << "."
+ << BOOST_VERSION % 100 << '\"'
+ << "/>";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::test_unit_start( std::ostream& ostr, test_unit const& tu )
+{
+ ostr << "<" << tu_type_name( tu ) << " name" << attr_value() << tu.p_name.get() << ">";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::test_unit_finish( std::ostream& ostr, test_unit const& tu, unsigned long elapsed )
+{
+ if( tu.p_type == tut_case )
+ ostr << "<TestingTime>" << elapsed << "</TestingTime>";
+
+ ostr << "</" << tu_type_name( tu ) << ">";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::test_unit_skipped( std::ostream& ostr, test_unit const& tu )
+{
+ ostr << "<" << tu_type_name( tu )
+ << " name" << attr_value() << tu.p_name.get()
+ << " skipped" << attr_value() << "yes"
+ << "/>";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::log_exception( std::ostream& ostr, log_checkpoint_data const& checkpoint_data, execution_exception const& ex )
+{
+ execution_exception::location const& loc = ex.where();
+
+ ostr << "<Exception file" << attr_value() << loc.m_file_name
+ << " line" << attr_value() << loc.m_line_num;
+
+ if( !loc.m_function.is_empty() )
+ ostr << " function" << attr_value() << loc.m_function;
+
+ ostr << ">" << cdata() << ex.what();
+
+ if( !checkpoint_data.m_file_name.is_empty() ) {
+ ostr << "<LastCheckpoint file" << attr_value() << checkpoint_data.m_file_name
+ << " line" << attr_value() << checkpoint_data.m_line_num
+ << ">"
+ << cdata() << checkpoint_data.m_message
+ << "</LastCheckpoint>";
+ }
+
+ ostr << "</Exception>";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::log_entry_start( std::ostream& ostr, log_entry_data const& entry_data, log_entry_types let )
+{
+ static literal_string xml_tags[] = { "Info", "Message", "Warning", "Error", "FatalError" };
+
+ m_curr_tag = xml_tags[let];
+ ostr << '<' << m_curr_tag
+ << BOOST_TEST_L( " file" ) << attr_value() << entry_data.m_file_name
+ << BOOST_TEST_L( " line" ) << attr_value() << entry_data.m_line_num
+ << BOOST_TEST_L( "><![CDATA[" );
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::log_entry_value( std::ostream& ostr, const_string value )
+{
+ ostr << value;
+}
+
+//____________________________________________________________________________//
+
+void
+xml_log_formatter::log_entry_finish( std::ostream& ostr )
+{
+ ostr << BOOST_TEST_L( "]]></" ) << m_curr_tag << BOOST_TEST_L( ">" );
+
+ m_curr_tag.clear();
+}
+
+//____________________________________________________________________________//
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_XML_LOG_FORMATTER_IPP_020105GER
diff --git a/ndnboost/test/impl/xml_report_formatter.ipp b/ndnboost/test/impl/xml_report_formatter.ipp
new file mode 100644
index 0000000..92655ee
--- /dev/null
+++ b/ndnboost/test/impl/xml_report_formatter.ipp
@@ -0,0 +1,115 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : XML report formatter
+// ***************************************************************************
+
+#ifndef BOOST_TEST_XML_REPORT_FORMATTER_IPP_020105GER
+#define BOOST_TEST_XML_REPORT_FORMATTER_IPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/results_collector.hpp>
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/output/xml_report_formatter.hpp>
+
+#include <ndnboost/test/utils/xml_printer.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+void
+xml_report_formatter::results_report_start( std::ostream& ostr )
+{
+ ostr << "<TestResult>";
+}
+
+//____________________________________________________________________________//
+
+void
+xml_report_formatter::results_report_finish( std::ostream& ostr )
+{
+ ostr << "</TestResult>";
+}
+
+
+//____________________________________________________________________________//
+
+void
+xml_report_formatter::test_unit_report_start( test_unit const& tu, std::ostream& ostr )
+{
+ test_results const& tr = results_collector.results( tu.p_id );
+
+ const_string descr;
+
+ if( tr.passed() )
+ descr = "passed";
+ else if( tr.p_skipped )
+ descr = "skipped";
+ else if( tr.p_aborted )
+ descr = "aborted";
+ else
+ descr = "failed";
+
+ ostr << '<' << ( tu.p_type == tut_case ? "TestCase" : "TestSuite" )
+ << " name" << attr_value() << tu.p_name.get()
+ << " result" << attr_value() << descr
+ << " assertions_passed" << attr_value() << tr.p_assertions_passed
+ << " assertions_failed" << attr_value() << tr.p_assertions_failed
+ << " expected_failures" << attr_value() << tr.p_expected_failures;
+
+ if( tu.p_type == tut_suite )
+ ostr << " test_cases_passed" << attr_value() << tr.p_test_cases_passed
+ << " test_cases_failed" << attr_value() << tr.p_test_cases_failed
+ << " test_cases_skipped" << attr_value() << tr.p_test_cases_skipped
+ << " test_cases_aborted" << attr_value() << tr.p_test_cases_aborted;
+
+
+ ostr << '>';
+}
+
+//____________________________________________________________________________//
+
+void
+xml_report_formatter::test_unit_report_finish( test_unit const& tu, std::ostream& ostr )
+{
+ ostr << "</" << ( tu.p_type == tut_case ? "TestCase" : "TestSuite" ) << '>';
+}
+
+//____________________________________________________________________________//
+
+void
+xml_report_formatter::do_confirmation_report( test_unit const& tu, std::ostream& ostr )
+{
+ test_unit_report_start( tu, ostr );
+ test_unit_report_finish( tu, ostr );
+}
+
+//____________________________________________________________________________//
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_XML_REPORT_FORMATTER_IPP_020105GER
diff --git a/ndnboost/test/interaction_based.hpp b/ndnboost/test/interaction_based.hpp
new file mode 100644
index 0000000..bb38d21
--- /dev/null
+++ b/ndnboost/test/interaction_based.hpp
@@ -0,0 +1,262 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : Facilities to perform interaction-based testing
+// ***************************************************************************
+
+#ifndef BOOST_TEST_INTERACTION_BASED_HPP_112105GER
+#define BOOST_TEST_INTERACTION_BASED_HPP_112105GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/detail/global_typedef.hpp>
+
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+// Boost
+#include <ndnboost/lexical_cast.hpp>
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_EPOINT ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_EPOINT( description ) \
+ ::ndnboost::itest::manager::instance().exception_point( BOOST_TEST_L(__FILE__), __LINE__, description )
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_DPOINT ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_DPOINT() \
+ ::ndnboost::itest::manager::instance().decision_point( BOOST_TEST_L(__FILE__), __LINE__ )
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_SCOPE ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_SCOPE( scope_name ) \
+ ::ndnboost::itest::scope_guard itest_scope_guard ## __LINE__( BOOST_TEST_L(__FILE__), __LINE__, BOOST_STRINGIZE(scope_name) )
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_NEW ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_NEW( type_name ) \
+ new ( ::ndnboost::itest::location( BOOST_TEST_L(__FILE__), __LINE__ ) ) type_name
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_DATA_FLOW ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_DATA_FLOW( v ) \
+ ::ndnboost::itest::manager::instance().generic_data_flow( v )
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_RETURN ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_RETURN( type, default_value ) \
+ ::ndnboost::itest::manager::instance().generic_return<type>( default_value )
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_ITEST_MOCK_FUNC ************** //
+// ************************************************************************** //
+
+#define BOOST_ITEST_MOCK_FUNC( function_name ) \
+ BOOST_ITEST_SCOPE( function_name ); \
+ BOOST_ITEST_EPOINT( 0 ); \
+ return ::ndnboost::itest::mock_object<>::prototype(); \
+/**/
+
+namespace ndnboost {
+
+namespace itest { // interaction-based testing
+
+using unit_test::const_string;
+
+// ************************************************************************** //
+// ************** manager ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL manager {
+public:
+ // instance access
+ static manager& instance() { return *instance_ptr(); }
+
+ // Mock objects interface hooks
+ virtual void exception_point( const_string /*file*/,
+ std::size_t /*line_num*/,
+ const_string /*descr*/ ){}
+ virtual bool decision_point( const_string /*file*/,
+ std::size_t /*line_num*/ ) { return true; }
+ virtual unsigned enter_scope( const_string /*file*/,
+ std::size_t /*line_num*/,
+ const_string /*scope_name*/){ return 0; }
+ virtual void leave_scope( unsigned ) {}
+ virtual void allocated( const_string /*file*/,
+ std::size_t /*line_num*/,
+ void* /*p*/, std::size_t /*s*/ ) {}
+ virtual void freed( void* /*p*/ ) {}
+ virtual void data_flow( const_string /*d*/ ) {}
+ virtual std::string return_value( const_string /*default_value */ ) { return ""; }
+
+ template<typename T>
+ void generic_data_flow( T const& t )
+ {
+ wrap_stringstream ws;
+
+ data_flow( (ws << t).str() );
+ }
+ template<typename T, typename DefaultValueType>
+ T generic_return( DefaultValueType const& dv )
+ {
+ wrap_stringstream ws;
+
+ std::string const& res = return_value( (ws << dv).str() );
+
+ if( res.empty() )
+ return dv;
+
+ return lexical_cast<T>( res );
+ }
+
+protected:
+ manager();
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+public:
+#endif
+ BOOST_TEST_PROTECTED_VIRTUAL ~manager();
+
+private:
+ struct dummy_constr{};
+ explicit manager( dummy_constr* ) {}
+
+ static manager* instance_ptr( bool reset = false, manager* ptr = 0 );
+}; // manager
+
+// ************************************************************************** //
+// ************** scope_guard ************** //
+// ************************************************************************** //
+
+class scope_guard {
+public:
+ // Constructor
+ scope_guard( const_string file, std::size_t line_num, const_string scope_name )
+ {
+ m_scope_index = manager::instance().enter_scope( file, line_num, scope_name );
+ }
+ ~scope_guard()
+ {
+ manager::instance().leave_scope( m_scope_index );
+ }
+
+ unsigned m_scope_index;
+};
+
+// ************************************************************************** //
+// ************** location ************** //
+// ************************************************************************** //
+
+struct location {
+ location( const_string file, std::size_t line )
+ : m_file_name( file )
+ , m_line_num( line )
+ {}
+
+ const_string m_file_name;
+ std::size_t m_line_num;
+};
+
+} // namespace itest
+
+} // namespace ndnboost
+
+// ************************************************************************** //
+// ************** operator new overload ************** //
+// ************************************************************************** //
+
+#if !defined(BOOST_ITEST_NO_NEW_OVERLOADS)
+
+// STL
+#include <cstdlib>
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::malloc; using ::free; }
+# endif
+# ifdef _CRTDBG_MAP_ALLOC
+namespace std { using ::_malloc_dbg; using ::_free_dbg; }
+# endif
+
+inline void*
+operator new( std::size_t s, ::ndnboost::itest::location const& l )
+{
+ void* res = std::malloc(s ? s : 1);
+
+ if( res )
+ ::ndnboost::itest::manager::instance().allocated( l.m_file_name, l.m_line_num, res, s );
+ else
+ throw std::bad_alloc();
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+inline void*
+operator new[]( std::size_t s, ::ndnboost::itest::location const& l )
+{
+ void* res = std::malloc(s ? s : 1);
+
+ if( res )
+ ::ndnboost::itest::manager::instance().allocated( l.m_file_name, l.m_line_num, res, s );
+ else
+ throw std::bad_alloc();
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+inline void
+operator delete( void* p, ::ndnboost::itest::location const& )
+{
+ ::ndnboost::itest::manager::instance().freed( p );
+
+ std::free( p );
+}
+
+//____________________________________________________________________________//
+
+inline void
+operator delete[]( void* p, ::ndnboost::itest::location const& )
+{
+ ::ndnboost::itest::manager::instance().freed( p );
+
+ std::free( p );
+}
+
+//____________________________________________________________________________//
+
+#endif
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_INTERACTION_BASED_HPP_112105GER
diff --git a/ndnboost/test/minimal.hpp b/ndnboost/test/minimal.hpp
new file mode 100644
index 0000000..9f4ca44
--- /dev/null
+++ b/ndnboost/test/minimal.hpp
@@ -0,0 +1,143 @@
+// (C) Copyright Gennadiy Rozental 2002-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : simple minimal testing definitions and implementation
+// ***************************************************************************
+
+#ifndef BOOST_TEST_MINIMAL_HPP_071894GER
+#define BOOST_TEST_MINIMAL_HPP_071894GER
+
+#define BOOST_CHECK(exp) \
+ ( (exp) \
+ ? static_cast<void>(0) \
+ : ndnboost::minimal_test::report_error(#exp,__FILE__,__LINE__, BOOST_CURRENT_FUNCTION) )
+
+#define BOOST_REQUIRE(exp) \
+ ( (exp) \
+ ? static_cast<void>(0) \
+ : ndnboost::minimal_test::report_critical_error(#exp,__FILE__,__LINE__,BOOST_CURRENT_FUNCTION))
+
+#define BOOST_ERROR( msg_ ) \
+ ndnboost::minimal_test::report_error( (msg_),__FILE__,__LINE__, BOOST_CURRENT_FUNCTION, true )
+#define BOOST_FAIL( msg_ ) \
+ ndnboost::minimal_test::report_critical_error( (msg_),__FILE__,__LINE__, BOOST_CURRENT_FUNCTION, true )
+
+//____________________________________________________________________________//
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/impl/execution_monitor.ipp>
+#include <ndnboost/test/impl/debug.ipp>
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// Boost
+#include <ndnboost/cstdlib.hpp> // for exit codes#include <ndnboost/cstdlib.hpp> // for exit codes
+#include <ndnboost/current_function.hpp> // for BOOST_CURRENT_FUNCTION
+
+// STL
+#include <iostream> // std::cerr, std::endl
+#include <string> // std::string
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+int test_main( int argc, char* argv[] ); // prototype for users test_main()
+
+namespace ndnboost {
+namespace minimal_test {
+
+typedef ndnboost::unit_test::const_string const_string;
+
+inline unit_test::counter_t& errors_counter() { static unit_test::counter_t ec = 0; return ec; }
+
+inline void
+report_error( const char* msg, const char* file, int line, const_string func_name, bool is_msg = false )
+{
+ ++errors_counter();
+ std::cerr << file << "(" << line << "): ";
+
+ if( is_msg )
+ std::cerr << msg;
+ else
+ std::cerr << "test " << msg << " failed";
+
+ if( func_name != "(unknown)" )
+ std::cerr << " in function: '" << func_name << "'";
+
+ std::cerr << std::endl;
+}
+
+inline void
+report_critical_error( const char* msg, const char* file, int line, const_string func_name, bool is_msg = false )
+{
+ report_error( msg, file, line, func_name, is_msg );
+
+ throw ndnboost::execution_aborted();
+}
+
+class caller {
+public:
+ // constructor
+ caller( int argc, char** argv )
+ : m_argc( argc ), m_argv( argv ) {}
+
+ // execution monitor hook implementation
+ int operator()() { return test_main( m_argc, m_argv ); }
+
+private:
+ // Data members
+ int m_argc;
+ char** m_argv;
+}; // monitor
+
+} // namespace minimal_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+int BOOST_TEST_CALL_DECL main( int argc, char* argv[] )
+{
+ using namespace ndnboost::minimal_test;
+
+ try {
+ ::ndnboost::execution_monitor ex_mon;
+ int run_result = ex_mon.execute( caller( argc, argv ) );
+
+ BOOST_CHECK( run_result == 0 || run_result == ndnboost::exit_success );
+ }
+ catch( ndnboost::execution_exception const& exex ) {
+ if( exex.code() != ndnboost::execution_exception::no_error )
+ BOOST_ERROR( (std::string( "exception \"" ).
+ append( exex.what().begin(), exex.what().end() ).
+ append( "\" caught" ) ).c_str() );
+ std::cerr << "\n**** Testing aborted.";
+ }
+
+ if( ndnboost::minimal_test::errors_counter() != 0 ) {
+ std::cerr << "\n**** " << errors_counter()
+ << " error" << (errors_counter() > 1 ? "s" : "" ) << " detected\n";
+
+ return ndnboost::exit_test_failure;
+ }
+
+ std::cout << "\n**** no errors detected\n";
+
+ return ndnboost::exit_success;
+}
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_MINIMAL_HPP_071894GER
diff --git a/ndnboost/test/mock_object.hpp b/ndnboost/test/mock_object.hpp
new file mode 100644
index 0000000..f2ad7d0
--- /dev/null
+++ b/ndnboost/test/mock_object.hpp
@@ -0,0 +1,328 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : Facilities to perform exception safety_tests
+// ***************************************************************************
+
+#ifndef BOOST_TEST_MOCK_OBJECT_HPP_112205GER
+#define BOOST_TEST_MOCK_OBJECT_HPP_112205GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/interaction_based.hpp>
+
+// Boost
+#include <ndnboost/preprocessor/punctuation/comma.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace itest {
+
+// ************************************************************************** //
+// ************** mock_object_base ************** //
+// ************************************************************************** //
+
+class mock_object_base {
+public:
+ mock_object_base() {}
+
+ template<typename T1>
+ mock_object_base( T1 const& ) {}
+
+ template<typename T1, typename T2>
+ mock_object_base( T1 const&, T2 const& ) {}
+
+ template<typename T1, typename T2, typename T3>
+ mock_object_base( T1 const&, T2 const&, T3 const& ) {}
+
+ template<typename T1, typename T2, typename T3, typename T4>
+ mock_object_base( T1 const&, T2 const&, T3 const&, T4 const& ) {}
+
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ mock_object_base( T1 const&, T2 const&, T3 const&, T4 const&, T5 const& ) {}
+};
+
+// ************************************************************************** //
+// ************** mock_object implementation helpers ************** //
+// ************************************************************************** //
+
+#define MO_OP_IMPL( op, descr, ret ) \
+ BOOST_ITEST_SCOPE( mock_object::operator op ); \
+ BOOST_ITEST_EPOINT( descr ); \
+ return ret \
+/**/
+
+#define MO_UNARY_OP( op, descr ) \
+self_type const& operator op() const \
+{ \
+ MO_OP_IMPL( op, descr, prototype() ); \
+} \
+/**/
+
+#define MO_UNARY_BOOL_OP( op, descr ) \
+bool operator op() const \
+{ \
+ MO_OP_IMPL( op, descr, (!!BOOST_ITEST_DPOINT()) ); \
+} \
+/**/
+
+#define MO_BINARY_OP( op, descr ) \
+template<int i1, typename Base1,int i2, typename Base2> \
+inline mock_object<i1,Base1> const& \
+operator op( mock_object<i1,Base1> const& mo, \
+ mock_object<i2,Base2> const& ) \
+{ \
+ MO_OP_IMPL( op, descr, mo ); \
+} \
+ \
+template<int i, typename Base, typename T> \
+inline mock_object<i,Base> const& \
+operator op( mock_object<i,Base> const& mo, T const& ) \
+{ \
+ MO_OP_IMPL( op, descr, mo ); \
+} \
+ \
+template<int i, typename Base, typename T> \
+inline mock_object<i,Base> const& \
+operator op( T const&, mock_object<i,Base> const& mo ) \
+{ \
+ MO_OP_IMPL( op, descr, mo ); \
+} \
+/**/
+
+#define MO_BINARY_BOOL_OP( op, descr ) \
+template<int i1, typename Base1,int i2, typename Base2> \
+inline bool \
+operator op( mock_object<i1,Base1> const&, \
+ mock_object<i2,Base2> const& ) \
+{ \
+ MO_OP_IMPL( op, descr, BOOST_ITEST_DPOINT() ); \
+} \
+ \
+template<int i, typename Base, typename T> \
+inline bool \
+operator op( mock_object<i,Base> const&, T const& ) \
+{ \
+ MO_OP_IMPL( op, descr, BOOST_ITEST_DPOINT() ); \
+} \
+ \
+template<int i, typename Base, typename T> \
+inline bool \
+operator op( T const&, mock_object<i,Base> const& ) \
+{ \
+ MO_OP_IMPL( op, descr, BOOST_ITEST_DPOINT() ); \
+} \
+/**/
+
+// ************************************************************************** //
+// ************** mock_object ************** //
+// ************************************************************************** //
+
+template<int i = 0, typename Base=mock_object_base>
+class mock_object;
+
+template<int i, typename Base>
+class mock_object : public Base {
+ // Private typeefs
+ typedef mock_object<i,Base> self_type;
+ struct dummy { void nonnull() {}; };
+ typedef void (dummy::*safe_bool)();
+
+ // prototype constructor
+ mock_object( dummy* ) {}
+
+public:
+ static mock_object& prototype()
+ {
+ static mock_object p( reinterpret_cast<dummy*>(0) );
+ return p;
+ }
+
+ // Constructors
+ mock_object()
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object default constructor" );
+ }
+
+ template<typename T1>
+ mock_object( T1 const& arg1 )
+ : mock_object_base( arg1 )
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object constructor" );
+ }
+
+ template<typename T1, typename T2>
+ mock_object( T1 const& arg1, T2 const& arg2 )
+ : mock_object_base( arg1, arg2 )
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object constructor" );
+ }
+
+ template<typename T1, typename T2, typename T3>
+ mock_object( T1 const& arg1, T2 const& arg2, T3 const& arg3 )
+ : mock_object_base( arg1, arg2, arg3 )
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object constructor" );
+ }
+
+ template<typename T1, typename T2, typename T3, typename T4>
+ mock_object( T1 const& arg1, T2 const& arg2, T3 const& arg3, T4 const& arg4 )
+ : mock_object_base( arg1, arg2, arg3, arg4 )
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object constructor" );
+ }
+
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ mock_object( T1 const& arg1, T2 const& arg2, T3 const& arg3, T4 const& arg4, T5 const& arg5 )
+ : mock_object_base( arg1, arg2, arg3, arg4, arg5 )
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object constructor" );
+ }
+
+ mock_object( mock_object const& )
+ {
+ BOOST_ITEST_SCOPE( mock_object::mock_object );
+ BOOST_ITEST_EPOINT( "Mock object copy constructor" );
+ }
+
+ // assignment
+ self_type const& operator =( mock_object const& ) const
+ {
+ MO_OP_IMPL( =, "Copy assignment", prototype() );
+ }
+
+ template <typename T>
+ self_type const& operator =( T const& ) const
+ {
+ MO_OP_IMPL( =, "Copy assignment", prototype() );
+ }
+
+ // Unary operators
+ MO_UNARY_BOOL_OP( !, "Logical NOT operator" )
+ MO_UNARY_OP( &, "Address-of operator" )
+ MO_UNARY_OP( ~, "One's complement operator" )
+ MO_UNARY_OP( *, "Pointer dereference" )
+ MO_UNARY_OP( +, "Unary plus" )
+
+ // Increment and Decrement
+ MO_UNARY_OP( ++, "Prefix increment" )
+ MO_UNARY_OP( --, "Prefix decrement" )
+ self_type const& operator ++(int) const
+ {
+ MO_OP_IMPL( ++, "Postfix increment", prototype() );
+ }
+ self_type const& operator --(int) const
+ {
+ MO_OP_IMPL( --, "Postfix decrement", prototype() );
+ }
+
+ // Bool context convertion
+ operator safe_bool() const
+ {
+ MO_OP_IMPL( safe_bool, "Bool context conversion",
+ (BOOST_ITEST_DPOINT() ? 0 : &dummy::nonnull) );
+ }
+
+ // Function-call operators
+ self_type const& operator ()() const
+ {
+ MO_OP_IMPL( (), "0-arity function-call", prototype() );
+ }
+ template<typename T1>
+ self_type const& operator ()( T1 const& arg1 ) const
+ {
+ MO_OP_IMPL( (), "1-arity function-call", prototype() );
+ }
+ template<typename T1, typename T2>
+ self_type const& operator ()( T1 const&, T2 const& ) const
+ {
+ MO_OP_IMPL( (), "2-arity function-call", prototype() );
+ }
+ template<typename T1, typename T2, typename T3>
+ self_type const& operator ()( T1 const&, T2 const&, T3 const& ) const
+ {
+ MO_OP_IMPL( (), "3-arity function-call", prototype() );
+ }
+ template<typename T1, typename T2, typename T3, typename T4>
+ self_type const& operator ()( T1 const&, T2 const&, T3 const&, T4 const& ) const
+ {
+ MO_OP_IMPL( (), "4-arity function-call", prototype() );
+ }
+ template<typename T1, typename T2, typename T3, typename T4, typename T5>
+ self_type const& operator ()( T1 const&, T2 const&, T3 const&, T4 const&, T5 const& ) const
+ {
+ MO_OP_IMPL( (), "5-arity function-call", prototype() );
+ }
+
+ // Substripting
+ template<typename T>
+ self_type const& operator []( T const& ) const
+ {
+ MO_OP_IMPL( [], "Substripting", prototype() );
+ }
+
+ // Class member access
+ self_type const* operator->() const
+ {
+ MO_OP_IMPL( ->, "Class member access", this );
+ }
+};
+
+// !! MO_BINARY_OP( BOOST_PP_COMMA(), "Comma operator" )
+
+MO_BINARY_BOOL_OP( !=, "Inequality" )
+MO_BINARY_OP( %, "Modulus" )
+MO_BINARY_OP( %=, "Modulus/assignment" )
+MO_BINARY_OP( &, "Bitwise AND" )
+MO_BINARY_BOOL_OP( &&, "Logical AND" )
+MO_BINARY_OP( &=, "Bitwise AND/assignment" )
+MO_BINARY_OP( *, "Multiplication" )
+MO_BINARY_OP( *=, "Multiplication/assignment" )
+MO_BINARY_OP( +, "Addition" )
+MO_BINARY_OP( +=, "Addition/assignment" )
+//MO_BINARY_OP( -, "Subtraction" )
+MO_BINARY_OP( -=, "Subtraction/assignment" )
+MO_BINARY_OP( ->*, "Pointer-to-member selection" )
+MO_BINARY_OP( /, "Division" )
+MO_BINARY_OP( /=, "Division/assignment" )
+MO_BINARY_BOOL_OP( <, "Less than" )
+MO_BINARY_OP( <<=, "Left shift/assignment" )
+MO_BINARY_BOOL_OP( <=, "Less than or equal to" )
+MO_BINARY_BOOL_OP( ==, "Equality" )
+MO_BINARY_BOOL_OP( >, "Greater than" )
+MO_BINARY_BOOL_OP( >=, "Greater than or equal to" )
+MO_BINARY_OP( >>=, "Right shift/assignment" )
+MO_BINARY_OP( ^, "Exclusive OR" )
+MO_BINARY_OP( ^=, "Exclusive OR/assignment" )
+MO_BINARY_OP( |, "Bitwise inclusive OR" )
+MO_BINARY_OP( |=, "Bitwise inclusive OR/assignment" )
+MO_BINARY_BOOL_OP( ||, "Logical OR" )
+
+MO_BINARY_OP( <<, "Left shift" )
+MO_BINARY_OP( >>, "Right shift" )
+
+} // namespace itest
+
+} // namespace ndnboost
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_MOCK_OBJECT_HPP_112205GER
diff --git a/ndnboost/test/output/compiler_log_formatter.hpp b/ndnboost/test/output/compiler_log_formatter.hpp
new file mode 100644
index 0000000..acef150
--- /dev/null
+++ b/ndnboost/test/output/compiler_log_formatter.hpp
@@ -0,0 +1,68 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : contains compiler like Log formatter definition
+// ***************************************************************************
+
+#ifndef BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER
+#define BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/unit_test_log_formatter.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+// ************************************************************************** //
+// ************** compiler_log_formatter ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL compiler_log_formatter : public unit_test_log_formatter {
+public:
+ // Formatter interface
+ void log_start( std::ostream&, counter_t test_cases_amount );
+ void log_finish( std::ostream& );
+ void log_build_info( std::ostream& );
+
+ void test_unit_start( std::ostream&, test_unit const& tu );
+ void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed );
+ void test_unit_skipped( std::ostream&, test_unit const& tu );
+
+ void log_exception( std::ostream&, log_checkpoint_data const&, execution_exception const& ex );
+
+ void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let );
+ void log_entry_value( std::ostream&, const_string value );
+ void log_entry_value( std::ostream&, lazy_ostream const& value );
+ void log_entry_finish( std::ostream& );
+
+protected:
+ virtual void print_prefix( std::ostream&, const_string file, std::size_t line );
+};
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_COMPILER_LOG_FORMATTER_HPP_020105GER
diff --git a/ndnboost/test/output/plain_report_formatter.hpp b/ndnboost/test/output/plain_report_formatter.hpp
new file mode 100644
index 0000000..a9bd022
--- /dev/null
+++ b/ndnboost/test/output/plain_report_formatter.hpp
@@ -0,0 +1,62 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : plain report formatter implementation
+// ***************************************************************************
+
+#ifndef BOOST_TEST_PLAIN_REPORT_FORMATTER_HPP_020105GER
+#define BOOST_TEST_PLAIN_REPORT_FORMATTER_HPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/results_reporter.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+// ************************************************************************** //
+// ************** plain_report_formatter ************** //
+// ************************************************************************** //
+
+class plain_report_formatter : public results_reporter::format {
+public:
+ // Formatter interface
+ void results_report_start( std::ostream& ostr );
+ void results_report_finish( std::ostream& ostr );
+
+ void test_unit_report_start( test_unit const&, std::ostream& ostr );
+ void test_unit_report_finish( test_unit const&, std::ostream& ostr );
+
+ void do_confirmation_report( test_unit const&, std::ostream& ostr );
+
+private:
+ // Data members
+ counter_t m_indent;
+};
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_PLAIN_REPORT_FORMATTER_HPP_020105GER
diff --git a/ndnboost/test/output/xml_log_formatter.hpp b/ndnboost/test/output/xml_log_formatter.hpp
new file mode 100644
index 0000000..59ffdcc
--- /dev/null
+++ b/ndnboost/test/output/xml_log_formatter.hpp
@@ -0,0 +1,72 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : contains XML Log formatter definition
+// ***************************************************************************
+
+#ifndef BOOST_TEST_XML_LOG_FORMATTER_020105GER
+#define BOOST_TEST_XML_LOG_FORMATTER_020105GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/unit_test_log_formatter.hpp>
+
+// STL
+#include <cstddef> // std::size_t
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+// ************************************************************************** //
+// ************** xml_log_formatter ************** //
+// ************************************************************************** //
+
+class xml_log_formatter : public unit_test_log_formatter {
+public:
+ // Formatter interface
+ void log_start( std::ostream&, counter_t test_cases_amount );
+ void log_finish( std::ostream& );
+ void log_build_info( std::ostream& );
+
+ void test_unit_start( std::ostream&, test_unit const& tu );
+ void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed );
+ void test_unit_skipped( std::ostream&, test_unit const& tu );
+
+ void log_exception( std::ostream&, log_checkpoint_data const&, execution_exception const& ex );
+
+ void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let );
+ using unit_test_log_formatter::log_entry_value; // bring base class functions into overload set
+ void log_entry_value( std::ostream&, const_string value );
+ void log_entry_finish( std::ostream& );
+
+private:
+ // Data members
+ const_string m_curr_tag;
+};
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_XML_LOG_FORMATTER_020105GER
diff --git a/ndnboost/test/output/xml_report_formatter.hpp b/ndnboost/test/output/xml_report_formatter.hpp
new file mode 100644
index 0000000..17fbe8d
--- /dev/null
+++ b/ndnboost/test/output/xml_report_formatter.hpp
@@ -0,0 +1,58 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : XML report formatter implementation
+// ***************************************************************************
+
+#ifndef BOOST_TEST_XML_REPORT_FORMATTER_HPP_020105GER
+#define BOOST_TEST_XML_REPORT_FORMATTER_HPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/results_reporter.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace output {
+
+// ************************************************************************** //
+// ************** xml_report_formatter ************** //
+// ************************************************************************** //
+
+class xml_report_formatter : public results_reporter::format {
+public:
+ // Formatter interface
+ void results_report_start( std::ostream& ostr );
+ void results_report_finish( std::ostream& ostr );
+
+ void test_unit_report_start( test_unit const&, std::ostream& ostr );
+ void test_unit_report_finish( test_unit const&, std::ostream& ostr );
+
+ void do_confirmation_report( test_unit const&, std::ostream& ostr );
+};
+
+} // namespace output
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_XML_REPORT_FORMATTER_HPP_020105GER
diff --git a/ndnboost/test/output_test_stream.hpp b/ndnboost/test/output_test_stream.hpp
new file mode 100644
index 0000000..a62aaef
--- /dev/null
+++ b/ndnboost/test/output_test_stream.hpp
@@ -0,0 +1,78 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : output_test_stream class definition
+// ***************************************************************************
+
+#ifndef BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER
+#define BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/predicate_result.hpp>
+
+// STL
+#include <cstddef> // for std::size_t
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** output_test_stream ************** //
+// ************************************************************************** //
+
+// class to be used to simplify testing of ostream-based output operations
+
+namespace ndnboost {
+
+namespace test_tools {
+
+class BOOST_TEST_DECL output_test_stream : public wrap_stringstream::wrapped_stream {
+ typedef unit_test::const_string const_string;
+ typedef predicate_result result_type;
+public:
+ // Constructor
+ explicit output_test_stream( const_string pattern_file_name = const_string(),
+ bool match_or_save = true,
+ bool text_or_binary = true );
+
+ // Destructor
+ ~output_test_stream();
+
+ // checking function
+ result_type is_empty( bool flush_stream = true );
+ result_type check_length( std::size_t length, bool flush_stream = true );
+ result_type is_equal( const_string arg_, bool flush_stream = true );
+ result_type match_pattern( bool flush_stream = true );
+
+ // explicit flush
+ void flush();
+
+private:
+ // helper functions
+ std::size_t length();
+ void sync();
+
+ struct Impl;
+ Impl* m_pimpl;
+};
+
+} // namespace test_tools
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_OUTPUT_TEST_STREAM_HPP_012705GER
diff --git a/ndnboost/test/predicate_result.hpp b/ndnboost/test/predicate_result.hpp
new file mode 100644
index 0000000..13dc668
--- /dev/null
+++ b/ndnboost/test/predicate_result.hpp
@@ -0,0 +1,88 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : enhanced result for test predicate that include message explaining failure
+// ***************************************************************************
+
+#ifndef BOOST_TEST_PREDICATE_RESULT_HPP_012705GER
+#define BOOST_TEST_PREDICATE_RESULT_HPP_012705GER
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+// STL
+#include <cstddef> // for std::size_t
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace test_tools {
+
+// ************************************************************************** //
+// ************** predicate_result ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL predicate_result {
+ typedef unit_test::const_string const_string;
+ struct dummy { void nonnull() {}; };
+ typedef void (dummy::*safe_bool)();
+
+public:
+ // Constructor
+ predicate_result( bool pv_ )
+ : p_predicate_value( pv_ )
+ {}
+
+ template<typename BoolConvertable>
+ predicate_result( BoolConvertable const& pv_ ) : p_predicate_value( !!pv_ ) {}
+
+ // Access methods
+ bool operator!() const { return !p_predicate_value; }
+ void operator=( bool pv_ ) { p_predicate_value.value = pv_; }
+ operator safe_bool() const { return !!p_predicate_value ? &dummy::nonnull : 0; }
+
+ // Public properties
+ BOOST_READONLY_PROPERTY( bool, (predicate_result) ) p_predicate_value;
+
+ // Access methods
+ bool has_empty_message() const { return !m_message; }
+ wrap_stringstream& message()
+ {
+ if( !m_message )
+ m_message.reset( new wrap_stringstream );
+
+ return *m_message;
+ }
+ const_string message() const { return !m_message ? const_string() : const_string( m_message->str() ); }
+
+private:
+ // Data members
+ shared_ptr<wrap_stringstream> m_message;
+};
+
+} // namespace test_tools
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_PREDICATE_RESULT_HPP_012705GER
diff --git a/ndnboost/test/progress_monitor.hpp b/ndnboost/test/progress_monitor.hpp
new file mode 100644
index 0000000..bca78ad
--- /dev/null
+++ b/ndnboost/test/progress_monitor.hpp
@@ -0,0 +1,70 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines simple text based progress monitor
+// ***************************************************************************
+
+#ifndef BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
+#define BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
+
+// Boost.Test
+#include <ndnboost/test/test_observer.hpp>
+#include <ndnboost/test/utils/trivial_singleton.hpp>
+
+// STL
+#include <iosfwd> // for std::ostream&
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** progress_monitor ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL progress_monitor_t : public test_observer, public singleton<progress_monitor_t> {
+public:
+ // test observer interface
+ void test_start( counter_t test_cases_amount );
+ void test_finish() {}
+ void test_aborted();
+
+ void test_unit_start( test_unit const& ) {}
+ void test_unit_finish( test_unit const&, unsigned long );
+ void test_unit_skipped( test_unit const& );
+ void test_unit_aborted( test_unit const& ) {}
+
+ void assertion_result( bool ) {}
+ void exception_caught( execution_exception const& ) {}
+
+ // configuration
+ void set_stream( std::ostream& );
+
+private:
+ BOOST_TEST_SINGLETON_CONS( progress_monitor_t );
+}; // progress_monitor_t
+
+BOOST_TEST_SINGLETON_INST( progress_monitor )
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_PROGRESS_MONITOR_HPP_020105GER
+
diff --git a/ndnboost/test/results_collector.hpp b/ndnboost/test/results_collector.hpp
new file mode 100644
index 0000000..858bc51
--- /dev/null
+++ b/ndnboost/test/results_collector.hpp
@@ -0,0 +1,112 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines class unit_test_result that is responsible for
+// gathering test results and presenting this information to end-user
+// ***************************************************************************
+
+#ifndef BOOST_TEST_RESULTS_COLLECTOR_HPP_071894GER
+#define BOOST_TEST_RESULTS_COLLECTOR_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/test_observer.hpp>
+
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+
+#include <ndnboost/test/utils/trivial_singleton.hpp>
+#include <ndnboost/test/utils/class_properties.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** first failed assertion debugger hook ************** //
+// ************************************************************************** //
+
+namespace {
+inline void first_failed_assertion() {}
+}
+
+// ************************************************************************** //
+// ************** test_results ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_results {
+public:
+ test_results();
+
+ typedef BOOST_READONLY_PROPERTY( counter_t, (results_collector_t)(test_results)(results_collect_helper) ) counter_prop;
+ typedef BOOST_READONLY_PROPERTY( bool, (results_collector_t)(test_results)(results_collect_helper) ) bool_prop;
+
+ counter_prop p_assertions_passed;
+ counter_prop p_assertions_failed;
+ counter_prop p_expected_failures;
+ counter_prop p_test_cases_passed;
+ counter_prop p_test_cases_failed;
+ counter_prop p_test_cases_skipped;
+ counter_prop p_test_cases_aborted;
+ bool_prop p_aborted;
+ bool_prop p_skipped;
+
+ // "conclusion" methods
+ bool passed() const;
+ int result_code() const;
+
+ // collection helper
+ void operator+=( test_results const& );
+
+ void clear();
+};
+
+// ************************************************************************** //
+// ************** results_collector ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL results_collector_t : public test_observer, public singleton<results_collector_t> {
+public:
+ // test_observer interface implementation
+ void test_start( counter_t test_cases_amount );
+ void test_finish();
+ void test_aborted();
+
+ void test_unit_start( test_unit const& );
+ void test_unit_finish( test_unit const&, unsigned long elapsed );
+ void test_unit_skipped( test_unit const& );
+ void test_unit_aborted( test_unit const& );
+
+ void assertion_result( bool passed );
+ void exception_caught( execution_exception const& );
+
+ // results access
+ test_results const& results( test_unit_id ) const;
+
+private:
+ BOOST_TEST_SINGLETON_CONS( results_collector_t );
+};
+
+BOOST_TEST_SINGLETON_INST( results_collector )
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_RESULTS_COLLECTOR_HPP_071894GER
+
diff --git a/ndnboost/test/results_reporter.hpp b/ndnboost/test/results_reporter.hpp
new file mode 100644
index 0000000..013523c
--- /dev/null
+++ b/ndnboost/test/results_reporter.hpp
@@ -0,0 +1,88 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines class unit_test_result that is responsible for
+// gathering test results and presenting this information to end-user
+// ***************************************************************************
+
+#ifndef BOOST_TEST_RESULTS_REPORTER_HPP_021205GER
+#define BOOST_TEST_RESULTS_REPORTER_HPP_021205GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+
+// STL
+#include <iosfwd> // for std::ostream&
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace results_reporter {
+
+// ************************************************************************** //
+// ************** formatter interface ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL format {
+public:
+ // Destructor
+ virtual ~format() {}
+
+ virtual void results_report_start( std::ostream& ostr ) = 0;
+ virtual void results_report_finish( std::ostream& ostr ) = 0;
+
+ virtual void test_unit_report_start( test_unit const&, std::ostream& ostr ) = 0;
+ virtual void test_unit_report_finish( test_unit const&, std::ostream& ostr ) = 0;
+
+ virtual void do_confirmation_report( test_unit const&, std::ostream& ostr ) = 0;
+};
+
+// ************************************************************************** //
+// ************** report configuration ************** //
+// ************************************************************************** //
+
+BOOST_TEST_DECL void set_level( report_level );
+BOOST_TEST_DECL void set_stream( std::ostream& );
+BOOST_TEST_DECL void set_format( output_format );
+BOOST_TEST_DECL void set_format( results_reporter::format* );
+
+BOOST_TEST_DECL std::ostream& get_stream();
+
+// ************************************************************************** //
+// ************** report initiation ************** //
+// ************************************************************************** //
+
+BOOST_TEST_DECL void make_report( report_level l = INV_REPORT_LEVEL, test_unit_id = INV_TEST_UNIT_ID );
+inline void confirmation_report( test_unit_id id = INV_TEST_UNIT_ID )
+{ make_report( CONFIRMATION_REPORT, id ); }
+inline void short_report( test_unit_id id = INV_TEST_UNIT_ID )
+{ make_report( SHORT_REPORT, id ); }
+inline void detailed_report( test_unit_id id = INV_TEST_UNIT_ID )
+{ make_report( DETAILED_REPORT, id ); }
+
+} // namespace results_reporter
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_RESULTS_REPORTER_HPP_021205GER
+
diff --git a/ndnboost/test/test_observer.hpp b/ndnboost/test/test_observer.hpp
new file mode 100644
index 0000000..21a0846
--- /dev/null
+++ b/ndnboost/test/test_observer.hpp
@@ -0,0 +1,65 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines abstract interface for test observer
+// ***************************************************************************
+
+#ifndef BOOST_TEST_TEST_OBSERVER_HPP_021005GER
+#define BOOST_TEST_TEST_OBSERVER_HPP_021005GER
+
+// Boost.Test
+#include <ndnboost/test/detail/fwd_decl.hpp>
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/config.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** test_observer ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_observer {
+public:
+ // test observer interface
+ virtual void test_start( counter_t /* test_cases_amount */ ) {}
+ virtual void test_finish() {}
+ virtual void test_aborted() {}
+
+ virtual void test_unit_start( test_unit const& ) {}
+ virtual void test_unit_finish( test_unit const&, unsigned long /* elapsed */ ) {}
+ virtual void test_unit_skipped( test_unit const& ) {}
+ virtual void test_unit_aborted( test_unit const& ) {}
+
+ virtual void assertion_result( bool /* passed */ ) {}
+ virtual void exception_caught( execution_exception const& ) {}
+
+ virtual int priority() { return 0; }
+
+protected:
+ BOOST_TEST_PROTECTED_VIRTUAL ~test_observer() {}
+};
+
+} // unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_TEST_OBSERVER_HPP_021005GER
+
diff --git a/ndnboost/test/test_tools.hpp b/ndnboost/test/test_tools.hpp
new file mode 100644
index 0000000..49a0f73
--- /dev/null
+++ b/ndnboost/test/test_tools.hpp
@@ -0,0 +1,719 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : contains definition for all test tools in test toolbox
+// ***************************************************************************
+
+#ifndef BOOST_TEST_TEST_TOOLS_HPP_012705GER
+#define BOOST_TEST_TEST_TOOLS_HPP_012705GER
+
+// Boost.Test
+#include <ndnboost/test/predicate_result.hpp>
+#include <ndnboost/test/unit_test_log.hpp>
+#include <ndnboost/test/floating_point_comparison.hpp>
+
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/workaround.hpp>
+
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/lazy_ostream.hpp>
+
+// Boost
+#include <ndnboost/preprocessor/seq/for_each.hpp>
+#include <ndnboost/preprocessor/seq/size.hpp>
+#include <ndnboost/preprocessor/seq/enum.hpp>
+#include <ndnboost/preprocessor/repetition/repeat.hpp>
+#include <ndnboost/preprocessor/punctuation/comma_if.hpp>
+#include <ndnboost/preprocessor/arithmetic/add.hpp>
+
+#include <ndnboost/limits.hpp>
+
+#include <ndnboost/type_traits/is_array.hpp>
+#include <ndnboost/type_traits/is_function.hpp>
+#include <ndnboost/type_traits/is_abstract.hpp>
+
+#include <ndnboost/mpl/or.hpp>
+
+// STL
+#include <cstddef> // for std::size_t
+#include <iosfwd>
+#include <ios> // for std::boolalpha
+#include <climits> // for CHAR_BIT
+
+#ifdef BOOST_MSVC
+# pragma warning(disable: 4127) // conditional expression is constant
+#endif
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** TOOL BOX ************** //
+// ************************************************************************** //
+
+// In macros below following argument abbreviations are used:
+// P - predicate
+// M - message
+// S - statement
+// E - exception
+// L - left argument
+// R - right argument
+// TL - tool level
+// CT - check type
+// ARGS - arguments list
+
+#define BOOST_TEST_TOOL_IMPL( func, P, check_descr, TL, CT ) \
+ ::ndnboost::test_tools::tt_detail::func( \
+ P, \
+ ::ndnboost::unit_test::lazy_ostream::instance() << check_descr, \
+ BOOST_TEST_L(__FILE__), \
+ static_cast<std::size_t>(__LINE__), \
+ ::ndnboost::test_tools::tt_detail::TL, \
+ ::ndnboost::test_tools::tt_detail::CT \
+/**/
+
+//____________________________________________________________________________//
+
+#define BOOST_CHECK_IMPL( P, check_descr, TL, CT ) \
+do { \
+ BOOST_TEST_PASSPOINT(); \
+ BOOST_TEST_TOOL_IMPL( check_impl, P, check_descr, TL, CT ), 0 );\
+} while( ::ndnboost::test_tools::dummy_cond ) \
+/**/
+
+//____________________________________________________________________________//
+
+#define BOOST_TEST_PASS_ARG_INFO( r, data, arg ) , arg, BOOST_STRINGIZE( arg )
+
+#define BOOST_CHECK_WITH_ARGS_IMPL( P, check_descr, TL, CT, ARGS ) \
+do { \
+ BOOST_TEST_PASSPOINT(); \
+ BOOST_TEST_TOOL_IMPL( check_frwd, P, check_descr, TL, CT ) \
+ BOOST_PP_SEQ_FOR_EACH( BOOST_TEST_PASS_ARG_INFO, '_', ARGS ) ); \
+} while( ::ndnboost::test_tools::dummy_cond ) \
+/**/
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN( P ) BOOST_CHECK_IMPL( (P), BOOST_TEST_STRINGIZE( P ), WARN, CHECK_PRED )
+#define BOOST_CHECK( P ) BOOST_CHECK_IMPL( (P), BOOST_TEST_STRINGIZE( P ), CHECK, CHECK_PRED )
+#define BOOST_REQUIRE( P ) BOOST_CHECK_IMPL( (P), BOOST_TEST_STRINGIZE( P ), REQUIRE, CHECK_PRED )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_MESSAGE( P, M ) BOOST_CHECK_IMPL( (P), M, WARN, CHECK_MSG )
+#define BOOST_CHECK_MESSAGE( P, M ) BOOST_CHECK_IMPL( (P), M, CHECK, CHECK_MSG )
+#define BOOST_REQUIRE_MESSAGE( P, M ) BOOST_CHECK_IMPL( (P), M, REQUIRE, CHECK_MSG )
+
+//____________________________________________________________________________//
+
+#define BOOST_ERROR( M ) BOOST_CHECK_MESSAGE( false, M )
+#define BOOST_FAIL( M ) BOOST_REQUIRE_MESSAGE( false, M )
+
+//____________________________________________________________________________//
+
+#define BOOST_CHECK_THROW_IMPL( S, E, P, prefix, TL ) \
+ try { \
+ BOOST_TEST_PASSPOINT(); \
+ S; \
+ BOOST_CHECK_IMPL( false, "exception " BOOST_STRINGIZE( E ) " is expected", TL, CHECK_MSG ); } \
+ catch( E const& ex ) { \
+ ::ndnboost::unit_test::ut_detail::ignore_unused_variable_warning( ex ); \
+ BOOST_CHECK_IMPL( P, prefix BOOST_STRINGIZE( E ) " is caught", TL, CHECK_MSG ); \
+ } \
+/**/
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "exception ", WARN )
+#define BOOST_CHECK_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "exception ", CHECK )
+#define BOOST_REQUIRE_THROW( S, E ) BOOST_CHECK_THROW_IMPL( S, E, true, "exception ", REQUIRE )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), "incorrect exception ", WARN )
+#define BOOST_CHECK_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), "incorrect exception ", CHECK )
+#define BOOST_REQUIRE_EXCEPTION( S, E, P ) BOOST_CHECK_THROW_IMPL( S, E, P( ex ), "incorrect exception ", REQUIRE )
+
+//____________________________________________________________________________//
+
+#define BOOST_CHECK_NO_THROW_IMPL( S, TL ) \
+ try { \
+ S; \
+ BOOST_CHECK_IMPL( true, "no exceptions thrown by " BOOST_STRINGIZE( S ), TL, CHECK_MSG ); } \
+ catch( ... ) { \
+ BOOST_CHECK_IMPL( false, "exception thrown by " BOOST_STRINGIZE( S ), TL, CHECK_MSG ); \
+ } \
+/**/
+
+#define BOOST_WARN_NO_THROW( S ) BOOST_CHECK_NO_THROW_IMPL( S, WARN )
+#define BOOST_CHECK_NO_THROW( S ) BOOST_CHECK_NO_THROW_IMPL( S, CHECK )
+#define BOOST_REQUIRE_NO_THROW( S ) BOOST_CHECK_NO_THROW_IMPL( S, REQUIRE )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_EQUAL( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::equal_impl_frwd(), "", WARN, CHECK_EQUAL, (L)(R) )
+#define BOOST_CHECK_EQUAL( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::equal_impl_frwd(), "", CHECK, CHECK_EQUAL, (L)(R) )
+#define BOOST_REQUIRE_EQUAL( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::equal_impl_frwd(), "", REQUIRE, CHECK_EQUAL, (L)(R) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_NE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::ne_impl(), "", WARN, CHECK_NE, (L)(R) )
+#define BOOST_CHECK_NE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::ne_impl(), "", CHECK, CHECK_NE, (L)(R) )
+#define BOOST_REQUIRE_NE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::ne_impl(), "", REQUIRE, CHECK_NE, (L)(R) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_LT( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::lt_impl(), "", WARN, CHECK_LT, (L)(R) )
+#define BOOST_CHECK_LT( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::lt_impl(), "", CHECK, CHECK_LT, (L)(R) )
+#define BOOST_REQUIRE_LT( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::lt_impl(), "", REQUIRE, CHECK_LT, (L)(R) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_LE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::le_impl(), "", WARN, CHECK_LE, (L)(R) )
+#define BOOST_CHECK_LE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::le_impl(), "", CHECK, CHECK_LE, (L)(R) )
+#define BOOST_REQUIRE_LE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::le_impl(), "", REQUIRE, CHECK_LE, (L)(R) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_GT( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::gt_impl(), "", WARN, CHECK_GT, (L)(R) )
+#define BOOST_CHECK_GT( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::gt_impl(), "", CHECK, CHECK_GT, (L)(R) )
+#define BOOST_REQUIRE_GT( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::gt_impl(), "", REQUIRE, CHECK_GT, (L)(R) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_GE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::ge_impl(), "", WARN, CHECK_GE, (L)(R) )
+#define BOOST_CHECK_GE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::ge_impl(), "", CHECK, CHECK_GE, (L)(R) )
+#define BOOST_REQUIRE_GE( L, R ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::tt_detail::ge_impl(), "", REQUIRE, CHECK_GE, (L)(R) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_CLOSE( L, R, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_close, "", WARN, CHECK_CLOSE, \
+ (L)(R)(::ndnboost::test_tools::percent_tolerance(T)) )
+#define BOOST_CHECK_CLOSE( L, R, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_close, "", CHECK, CHECK_CLOSE, \
+ (L)(R)(::ndnboost::test_tools::percent_tolerance(T)) )
+#define BOOST_REQUIRE_CLOSE( L, R, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_close, "", REQUIRE, CHECK_CLOSE, \
+ (L)(R)(::ndnboost::test_tools::percent_tolerance(T)) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_CLOSE_FRACTION( L, R, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_close, "", WARN, CHECK_CLOSE_FRACTION, \
+ (L)(R)(::ndnboost::test_tools::fraction_tolerance(T)) )
+#define BOOST_CHECK_CLOSE_FRACTION( L, R, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_close, "", CHECK, CHECK_CLOSE_FRACTION, \
+ (L)(R)(::ndnboost::test_tools::fraction_tolerance(T)) )
+#define BOOST_REQUIRE_CLOSE_FRACTION( L, R, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_close, "", REQUIRE, CHECK_CLOSE_FRACTION, \
+ (L)(R)(::ndnboost::test_tools::fraction_tolerance(T)) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_SMALL( FPV, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_small, "", WARN, CHECK_SMALL, (FPV)(T) )
+#define BOOST_CHECK_SMALL( FPV, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_small, "", CHECK, CHECK_SMALL, (FPV)(T) )
+#define BOOST_REQUIRE_SMALL( FPV, T ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( ::ndnboost::test_tools::check_is_small, "", REQUIRE, CHECK_SMALL, (FPV)(T) )
+
+//____________________________________________________________________________//
+
+#define BOOST_WARN_PREDICATE( P, ARGS ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( P, BOOST_TEST_STRINGIZE( P ), WARN, CHECK_PRED_WITH_ARGS, ARGS )
+#define BOOST_CHECK_PREDICATE( P, ARGS ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( P, BOOST_TEST_STRINGIZE( P ), CHECK, CHECK_PRED_WITH_ARGS, ARGS )
+#define BOOST_REQUIRE_PREDICATE( P, ARGS ) \
+ BOOST_CHECK_WITH_ARGS_IMPL( P, BOOST_TEST_STRINGIZE( P ), REQUIRE, CHECK_PRED_WITH_ARGS, ARGS )
+
+//____________________________________________________________________________//
+
+#define BOOST_EQUAL_COLLECTIONS_IMPL( L_begin, L_end, R_begin, R_end, TL ) \
+ BOOST_TEST_TOOL_IMPL( check_impl, ::ndnboost::test_tools::tt_detail::equal_coll_impl( \
+ (L_begin), (L_end), (R_begin), (R_end) ), "", TL, CHECK_EQUAL_COLL ), \
+ 4, \
+ BOOST_STRINGIZE( L_begin ), BOOST_STRINGIZE( L_end ), \
+ BOOST_STRINGIZE( R_begin ), BOOST_STRINGIZE( R_end ) ) \
+/**/
+
+#define BOOST_WARN_EQUAL_COLLECTIONS( L_begin, L_end, R_begin, R_end ) \
+ BOOST_EQUAL_COLLECTIONS_IMPL( L_begin, L_end, R_begin, R_end, WARN )
+#define BOOST_CHECK_EQUAL_COLLECTIONS( L_begin, L_end, R_begin, R_end ) \
+ BOOST_EQUAL_COLLECTIONS_IMPL( L_begin, L_end, R_begin, R_end, CHECK )
+#define BOOST_REQUIRE_EQUAL_COLLECTIONS( L_begin, L_end, R_begin, R_end ) \
+ BOOST_EQUAL_COLLECTIONS_IMPL( L_begin, L_end, R_begin, R_end, REQUIRE )
+
+//____________________________________________________________________________//
+
+#define BOOST_BITWISE_EQUAL_IMPL( L, R, TL ) \
+ BOOST_TEST_TOOL_IMPL( check_impl, \
+ ::ndnboost::test_tools::tt_detail::bitwise_equal_impl( (L), (R) ), \
+ "", TL, CHECK_BITWISE_EQUAL ), \
+ 2, BOOST_STRINGIZE( L ), BOOST_STRINGIZE( R ) ) \
+/**/
+
+#define BOOST_WARN_BITWISE_EQUAL( L, R ) BOOST_BITWISE_EQUAL_IMPL( L, R, WARN )
+#define BOOST_CHECK_BITWISE_EQUAL( L, R ) BOOST_BITWISE_EQUAL_IMPL( L, R, CHECK )
+#define BOOST_REQUIRE_BITWISE_EQUAL( L, R ) BOOST_BITWISE_EQUAL_IMPL( L, R, REQUIRE )
+
+//____________________________________________________________________________//
+
+#define BOOST_IS_DEFINED( symb ) ::ndnboost::test_tools::tt_detail::is_defined_impl( #symb, BOOST_STRINGIZE(= symb) )
+
+//____________________________________________________________________________//
+
+// ***************************** //
+// deprecated interface
+
+#define BOOST_BITWISE_EQUAL( L, R ) BOOST_CHECK_BITWISE_EQUAL( L, R )
+#define BOOST_MESSAGE( M ) BOOST_TEST_MESSAGE( M )
+#define BOOST_CHECKPOINT( M ) BOOST_TEST_CHECKPOINT( M )
+
+namespace ndnboost {
+
+namespace test_tools {
+
+typedef unit_test::const_string const_string;
+
+namespace { bool dummy_cond = false; }
+
+// ************************************************************************** //
+// ************** print_log_value ************** //
+// ************************************************************************** //
+
+template<typename T>
+struct print_log_value {
+ void operator()( std::ostream& ostr, T const& t )
+ {
+ // avoid warning: 'ndnboost::test_tools::<unnamed>::dummy_cond' defined but not used
+ if (::ndnboost::test_tools::dummy_cond) {}
+
+ typedef typename mpl::or_<is_array<T>,is_function<T>,is_abstract<T> >::type cant_use_nl;
+
+ set_precision( ostr, cant_use_nl() );
+
+ ostr << t; // by default print the value
+ }
+
+ void set_precision( std::ostream& ostr, mpl::false_ )
+ {
+ if( std::numeric_limits<T>::is_specialized && std::numeric_limits<T>::radix == 2 )
+ ostr.precision( 2 + std::numeric_limits<T>::digits * 301/1000 );
+ }
+
+ void set_precision( std::ostream&, mpl::true_ ) {}
+};
+
+//____________________________________________________________________________//
+
+#define BOOST_TEST_DONT_PRINT_LOG_VALUE( the_type ) \
+namespace ndnboost { namespace test_tools { \
+template<> \
+struct print_log_value<the_type > { \
+ void operator()( std::ostream&, the_type const& ) {} \
+}; \
+}} \
+/**/
+
+//____________________________________________________________________________//
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+template<typename T, std::size_t N >
+struct print_log_value< T[N] > {
+ void operator()( std::ostream& ostr, T const* t )
+ {
+ ostr << t;
+ }
+};
+#endif
+
+//____________________________________________________________________________//
+
+template<>
+struct BOOST_TEST_DECL print_log_value<bool> {
+ void operator()( std::ostream& ostr, bool t )
+ {
+ ostr << std::boolalpha << t;
+ }
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct BOOST_TEST_DECL print_log_value<char> {
+ void operator()( std::ostream& ostr, char t );
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct BOOST_TEST_DECL print_log_value<unsigned char> {
+ void operator()( std::ostream& ostr, unsigned char t );
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct BOOST_TEST_DECL print_log_value<char const*> {
+ void operator()( std::ostream& ostr, char const* t );
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct BOOST_TEST_DECL print_log_value<wchar_t const*> {
+ void operator()( std::ostream& ostr, wchar_t const* t );
+};
+
+//____________________________________________________________________________//
+
+namespace tt_detail {
+
+// ************************************************************************** //
+// ************** tools classification ************** //
+// ************************************************************************** //
+
+enum check_type {
+ CHECK_PRED,
+ CHECK_MSG,
+ CHECK_EQUAL,
+ CHECK_NE,
+ CHECK_LT,
+ CHECK_LE,
+ CHECK_GT,
+ CHECK_GE,
+ CHECK_CLOSE,
+ CHECK_CLOSE_FRACTION,
+ CHECK_SMALL,
+ CHECK_BITWISE_EQUAL,
+ CHECK_PRED_WITH_ARGS,
+ CHECK_EQUAL_COLL
+};
+
+enum tool_level {
+ WARN, CHECK, REQUIRE, PASS
+};
+
+// ************************************************************************** //
+// ************** print_helper ************** //
+// ************************************************************************** //
+// Adds level of indirection to the output operation, allowing us to customize
+// it for types that do not support operator << directly or for any other reason
+
+template<typename T>
+struct print_helper_t {
+ explicit print_helper_t( T const& t ) : m_t( t ) {}
+
+ T const& m_t;
+};
+
+//____________________________________________________________________________//
+
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+// Borland suffers premature pointer decay passing arrays by reference
+template<typename T, std::size_t N >
+struct print_helper_t< T[N] > {
+ explicit print_helper_t( T const * t ) : m_t( t ) {}
+
+ T const * m_t;
+};
+#endif
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline print_helper_t<T> print_helper( T const& t )
+{
+ return print_helper_t<T>( t );
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline std::ostream&
+operator<<( std::ostream& ostr, print_helper_t<T> const& ph )
+{
+ print_log_value<T>()( ostr, ph.m_t );
+
+ return ostr;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** TOOL BOX Implementation ************** //
+// ************************************************************************** //
+
+BOOST_TEST_DECL
+bool check_impl( predicate_result const& pr, ::ndnboost::unit_test::lazy_ostream const& check_descr,
+ const_string file_name, std::size_t line_num,
+ tool_level tl, check_type ct,
+ std::size_t num_args, ... );
+
+//____________________________________________________________________________//
+
+#define TEMPL_PARAMS( z, m, dummy ) , typename BOOST_JOIN( Arg, m )
+#define FUNC_PARAMS( z, m, dummy ) \
+ , BOOST_JOIN( Arg, m ) const& BOOST_JOIN( arg, m ) \
+ , char const* BOOST_JOIN( BOOST_JOIN( arg, m ), _descr ) \
+/**/
+
+#define PRED_PARAMS( z, m, dummy ) BOOST_PP_COMMA_IF( m ) BOOST_JOIN( arg, m )
+
+#define ARG_INFO( z, m, dummy ) \
+ , BOOST_JOIN( BOOST_JOIN( arg, m ), _descr ) \
+ , &static_cast<const unit_test::lazy_ostream&>(unit_test::lazy_ostream::instance() \
+ << ::ndnboost::test_tools::tt_detail::print_helper( BOOST_JOIN( arg, m ) )) \
+/**/
+
+#define IMPL_FRWD( z, n, dummy ) \
+template<typename Pred \
+ BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), TEMPL_PARAMS, _ )> \
+inline bool \
+check_frwd( Pred P, unit_test::lazy_ostream const& check_descr, \
+ const_string file_name, std::size_t line_num, \
+ tool_level tl, check_type ct \
+ BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), FUNC_PARAMS, _ ) \
+) \
+{ \
+ return \
+ check_impl( P( BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), PRED_PARAMS, _ ) ), \
+ check_descr, file_name, line_num, tl, ct, \
+ BOOST_PP_ADD( n, 1 ) \
+ BOOST_PP_REPEAT_ ## z( BOOST_PP_ADD( n, 1 ), ARG_INFO, _ ) \
+ ); \
+} \
+/**/
+
+#ifndef BOOST_TEST_MAX_PREDICATE_ARITY
+#define BOOST_TEST_MAX_PREDICATE_ARITY 5
+#endif
+
+BOOST_PP_REPEAT( BOOST_TEST_MAX_PREDICATE_ARITY, IMPL_FRWD, _ )
+
+#undef TEMPL_PARAMS
+#undef FUNC_PARAMS
+#undef PRED_INFO
+#undef ARG_INFO
+#undef IMPL_FRWD
+
+//____________________________________________________________________________//
+
+template <class Left, class Right>
+predicate_result equal_impl( Left const& left, Right const& right )
+{
+ return left == right;
+}
+
+//____________________________________________________________________________//
+
+predicate_result BOOST_TEST_DECL equal_impl( char const* left, char const* right );
+inline predicate_result equal_impl( char* left, char const* right ) { return equal_impl( static_cast<char const*>(left), static_cast<char const*>(right) ); }
+inline predicate_result equal_impl( char const* left, char* right ) { return equal_impl( static_cast<char const*>(left), static_cast<char const*>(right) ); }
+inline predicate_result equal_impl( char* left, char* right ) { return equal_impl( static_cast<char const*>(left), static_cast<char const*>(right) ); }
+
+#if !defined( BOOST_NO_CWCHAR )
+predicate_result BOOST_TEST_DECL equal_impl( wchar_t const* left, wchar_t const* right );
+inline predicate_result equal_impl( wchar_t* left, wchar_t const* right ) { return equal_impl( static_cast<wchar_t const*>(left), static_cast<wchar_t const*>(right) ); }
+inline predicate_result equal_impl( wchar_t const* left, wchar_t* right ) { return equal_impl( static_cast<wchar_t const*>(left), static_cast<wchar_t const*>(right) ); }
+inline predicate_result equal_impl( wchar_t* left, wchar_t* right ) { return equal_impl( static_cast<wchar_t const*>(left), static_cast<wchar_t const*>(right) ); }
+#endif
+
+//____________________________________________________________________________//
+
+struct equal_impl_frwd {
+ template <typename Left, typename Right>
+ inline predicate_result
+ call_impl( Left const& left, Right const& right, mpl::false_ ) const
+ {
+ return equal_impl( left, right );
+ }
+
+ template <typename Left, typename Right>
+ inline predicate_result
+ call_impl( Left const& left, Right const& right, mpl::true_ ) const
+ {
+ return (*this)( right, &left[0] );
+ }
+
+ template <typename Left, typename Right>
+ inline predicate_result
+ operator()( Left const& left, Right const& right ) const
+ {
+ typedef typename is_array<Left>::type left_is_array;
+ return call_impl( left, right, left_is_array() );
+ }
+};
+
+//____________________________________________________________________________//
+
+struct ne_impl {
+ template <class Left, class Right>
+ predicate_result operator()( Left const& left, Right const& right )
+ {
+ return !equal_impl_frwd()( left, right );
+ }
+};
+
+//____________________________________________________________________________//
+
+struct lt_impl {
+ template <class Left, class Right>
+ predicate_result operator()( Left const& left, Right const& right )
+ {
+ return left < right;
+ }
+};
+
+//____________________________________________________________________________//
+
+struct le_impl {
+ template <class Left, class Right>
+ predicate_result operator()( Left const& left, Right const& right )
+ {
+ return left <= right;
+ }
+};
+
+//____________________________________________________________________________//
+
+struct gt_impl {
+ template <class Left, class Right>
+ predicate_result operator()( Left const& left, Right const& right )
+ {
+ return left > right;
+ }
+};
+
+//____________________________________________________________________________//
+
+struct ge_impl {
+ template <class Left, class Right>
+ predicate_result operator()( Left const& left, Right const& right )
+ {
+ return left >= right;
+ }
+};
+
+//____________________________________________________________________________//
+
+template <typename Left, typename Right>
+inline predicate_result
+equal_coll_impl( Left left_begin, Left left_end, Right right_begin, Right right_end )
+{
+ predicate_result res( true );
+ std::size_t pos = 0;
+
+ for( ; left_begin != left_end && right_begin != right_end; ++left_begin, ++right_begin, ++pos ) {
+ if( *left_begin != *right_begin ) {
+ res = false;
+ res.message() << "\nMismatch in a position " << pos << ": " << *left_begin << " != " << *right_begin;
+ }
+ }
+
+ if( left_begin != left_end ) {
+ std::size_t r_size = pos;
+ while( left_begin != left_end ) {
+ ++pos;
+ ++left_begin;
+ }
+
+ res = false;
+ res.message() << "\nCollections size mismatch: " << pos << " != " << r_size;
+ }
+
+ if( right_begin != right_end ) {
+ std::size_t l_size = pos;
+ while( right_begin != right_end ) {
+ ++pos;
+ ++right_begin;
+ }
+
+ res = false;
+ res.message() << "\nCollections size mismatch: " << l_size << " != " << pos;
+ }
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+template <class Left, class Right>
+inline predicate_result
+bitwise_equal_impl( Left const& left, Right const& right )
+{
+ predicate_result res( true );
+
+ std::size_t left_bit_size = sizeof(Left)*CHAR_BIT;
+ std::size_t right_bit_size = sizeof(Right)*CHAR_BIT;
+
+ static Left const leftOne( 1 );
+ static Right const rightOne( 1 );
+
+ std::size_t total_bits = left_bit_size < right_bit_size ? left_bit_size : right_bit_size;
+
+ for( std::size_t counter = 0; counter < total_bits; ++counter ) {
+ if( ( left & ( leftOne << counter ) ) != ( right & ( rightOne << counter ) ) ) {
+ res = false;
+ res.message() << "\nMismatch in a position " << counter;
+ }
+ }
+
+ if( left_bit_size != right_bit_size ) {
+ res = false;
+ res.message() << "\nOperands bit sizes mismatch: " << left_bit_size << " != " << right_bit_size;
+ }
+
+ return res;
+}
+
+//____________________________________________________________________________//
+
+bool BOOST_TEST_DECL is_defined_impl( const_string symbol_name, const_string symbol_value );
+
+//____________________________________________________________________________//
+
+} // namespace tt_detail
+
+} // namespace test_tools
+
+namespace test_toolbox = test_tools;
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_TEST_TOOLS_HPP_012705GER
diff --git a/ndnboost/test/unit_test_log.hpp b/ndnboost/test/unit_test_log.hpp
new file mode 100644
index 0000000..844b6d7
--- /dev/null
+++ b/ndnboost/test/unit_test_log.hpp
@@ -0,0 +1,177 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines singleton class unit_test_log and all manipulators.
+// unit_test_log has output stream like interface. It's implementation is
+// completely hidden with pimple idiom
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_LOG_HPP_071894GER
+#define BOOST_TEST_UNIT_TEST_LOG_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/test_observer.hpp>
+
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/log_level.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/utils/trivial_singleton.hpp>
+#include <ndnboost/test/utils/lazy_ostream.hpp>
+
+// Boost
+#include <ndnboost/utility.hpp>
+
+// STL
+#include <iosfwd> // for std::ostream&
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** log manipulators ************** //
+// ************************************************************************** //
+
+namespace log {
+
+struct BOOST_TEST_DECL begin {
+ begin( const_string fn, std::size_t ln )
+ : m_file_name( fn )
+ , m_line_num( ln )
+ {}
+
+ const_string m_file_name;
+ std::size_t m_line_num;
+};
+
+struct end {};
+
+} // namespace log
+
+// ************************************************************************** //
+// ************** entry_value_collector ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+class BOOST_TEST_DECL entry_value_collector {
+public:
+ // Constructors
+ entry_value_collector() : m_last( true ) {}
+ entry_value_collector( entry_value_collector const& rhs ) : m_last( true ) { rhs.m_last = false; }
+ ~entry_value_collector();
+
+ // collection interface
+ entry_value_collector const& operator<<( lazy_ostream const& ) const;
+ entry_value_collector const& operator<<( const_string ) const;
+
+private:
+ // Data members
+ mutable bool m_last;
+};
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** unit_test_log ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL unit_test_log_t : public test_observer, public singleton<unit_test_log_t> {
+public:
+ // test_observer interface implementation
+ void test_start( counter_t test_cases_amount );
+ void test_finish();
+ void test_aborted();
+
+ void test_unit_start( test_unit const& );
+ void test_unit_finish( test_unit const&, unsigned long elapsed );
+ void test_unit_skipped( test_unit const& );
+ void test_unit_aborted( test_unit const& );
+
+ void assertion_result( bool passed );
+ void exception_caught( execution_exception const& );
+
+ virtual int priority() { return 1; }
+
+ // log configuration methods
+ void set_stream( std::ostream& );
+ void set_threshold_level( log_level );
+ void set_format( output_format );
+ void set_formatter( unit_test_log_formatter* );
+
+ // test progress logging
+ void set_checkpoint( const_string file, std::size_t line_num, const_string msg = const_string() );
+
+ // entry logging
+ unit_test_log_t& operator<<( log::begin const& ); // begin entry
+ unit_test_log_t& operator<<( log::end const& ); // end entry
+ unit_test_log_t& operator<<( log_level ); // set entry level
+ unit_test_log_t& operator<<( const_string ); // log entry value
+ unit_test_log_t& operator<<( lazy_ostream const& ); // log entry value
+
+ ut_detail::entry_value_collector operator()( log_level ); // initiate entry collection
+
+private:
+ bool log_entry_start();
+
+ BOOST_TEST_SINGLETON_CONS( unit_test_log_t );
+}; // unit_test_log_t
+
+BOOST_TEST_SINGLETON_INST( unit_test_log )
+
+// helper macros
+#define BOOST_TEST_LOG_ENTRY( ll ) \
+ (::ndnboost::unit_test::unit_test_log \
+ << ::ndnboost::unit_test::log::begin( BOOST_TEST_L(__FILE__), __LINE__ ))(ll) \
+/**/
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+// ************************************************************************** //
+// ************** Unit test log interface helpers ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_MESSAGE( M ) \
+ BOOST_TEST_LOG_ENTRY( ::ndnboost::unit_test::log_messages ) \
+ << (::ndnboost::unit_test::lazy_ostream::instance() << M) \
+/**/
+
+//____________________________________________________________________________//
+
+#define BOOST_TEST_PASSPOINT() \
+ ::ndnboost::unit_test::unit_test_log.set_checkpoint( \
+ BOOST_TEST_L(__FILE__), \
+ static_cast<std::size_t>(__LINE__) ) \
+/**/
+
+//____________________________________________________________________________//
+
+#define BOOST_TEST_CHECKPOINT( M ) \
+ ::ndnboost::unit_test::unit_test_log.set_checkpoint( \
+ BOOST_TEST_L(__FILE__), \
+ static_cast<std::size_t>(__LINE__), \
+ (::ndnboost::wrap_stringstream().ref() << M).str() ) \
+/**/
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_LOG_HPP_071894GER
+
diff --git a/ndnboost/test/unit_test_log_formatter.hpp b/ndnboost/test/unit_test_log_formatter.hpp
new file mode 100644
index 0000000..6449c83
--- /dev/null
+++ b/ndnboost/test/unit_test_log_formatter.hpp
@@ -0,0 +1,123 @@
+// (C) Copyright Gennadiy Rozental 2003-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description :
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_LOG_FORMATTER_HPP_071894GER
+#define BOOST_TEST_UNIT_TEST_LOG_FORMATTER_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/detail/log_level.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+
+#include <ndnboost/test/execution_monitor.hpp>
+
+// STL
+#include <iosfwd>
+#include <string> // for std::string
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** log_entry_data ************** //
+// ************************************************************************** //
+
+struct BOOST_TEST_DECL log_entry_data {
+ log_entry_data()
+ {
+ m_file_name.reserve( 200 );
+ }
+
+ std::string m_file_name;
+ std::size_t m_line_num;
+ log_level m_level;
+
+ void clear()
+ {
+ m_file_name.erase();
+ m_line_num = 0;
+ m_level = log_nothing;
+ }
+};
+
+// ************************************************************************** //
+// ************** checkpoint_data ************** //
+// ************************************************************************** //
+
+struct BOOST_TEST_DECL log_checkpoint_data
+{
+ const_string m_file_name;
+ std::size_t m_line_num;
+ std::string m_message;
+
+ void clear()
+ {
+ m_file_name.clear();
+ m_line_num = 0;
+ m_message = std::string();
+ }
+};
+
+// ************************************************************************** //
+// ************** unit_test_log_formatter ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL unit_test_log_formatter {
+public:
+ enum log_entry_types { BOOST_UTL_ET_INFO,
+ BOOST_UTL_ET_MESSAGE,
+ BOOST_UTL_ET_WARNING,
+ BOOST_UTL_ET_ERROR,
+ BOOST_UTL_ET_FATAL_ERROR };
+
+ // Destructor
+ virtual ~unit_test_log_formatter() {}
+
+ // Formatter interface
+ virtual void log_start( std::ostream&, counter_t test_cases_amount ) = 0;
+ virtual void log_finish( std::ostream& ) = 0;
+ virtual void log_build_info( std::ostream& ) = 0;
+
+ virtual void test_unit_start( std::ostream&, test_unit const& tu ) = 0;
+ virtual void test_unit_finish( std::ostream&, test_unit const& tu, unsigned long elapsed ) = 0;
+ virtual void test_unit_skipped( std::ostream&, test_unit const& ) = 0;
+
+ virtual void log_exception( std::ostream& os, log_checkpoint_data const& cd, execution_exception const& ex )
+ {
+ // for backward compatibility
+ log_exception( os, cd, ex.what() );
+ }
+ virtual void log_exception( std::ostream&, log_checkpoint_data const&, const_string /* explanation */ ) {}
+
+ virtual void log_entry_start( std::ostream&, log_entry_data const&, log_entry_types let ) = 0;
+ virtual void log_entry_value( std::ostream&, const_string value ) = 0;
+ virtual void log_entry_value( std::ostream&, lazy_ostream const& value ); // there is a default impl
+ virtual void log_entry_finish( std::ostream& ) = 0;
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_LOG_FORMATTER_HPP_071894GER
+
diff --git a/ndnboost/test/unit_test_monitor.hpp b/ndnboost/test/unit_test_monitor.hpp
new file mode 100644
index 0000000..4777d17
--- /dev/null
+++ b/ndnboost/test/unit_test_monitor.hpp
@@ -0,0 +1,69 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines specific version of execution monitor used to managed
+// run unit of test cases. Translates execution exception into error level
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER
+#define BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER
+
+// Boost.Test
+#include <ndnboost/test/execution_monitor.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+#include <ndnboost/test/utils/trivial_singleton.hpp>
+#include <ndnboost/test/utils/callback.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** unit_test_monitor ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL unit_test_monitor_t : public singleton<unit_test_monitor_t>, public execution_monitor {
+public:
+ enum error_level {
+ test_fail = 1,
+ test_ok = 0,
+ constructor_error = -1,
+ unexpected_exception = -2,
+ os_exception = -3,
+ os_timeout = -4,
+ fatal_error = -5, // includes both system and user
+ destructor_error = -6
+ };
+
+ static bool is_critical_error( error_level e ) { return e <= fatal_error; }
+
+ // monitor method
+ error_level execute_and_translate( test_case const& );
+
+private:
+ BOOST_TEST_SINGLETON_CONS( unit_test_monitor_t );
+};
+
+BOOST_TEST_SINGLETON_INST( unit_test_monitor )
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_MONITOR_HPP_020905GER
diff --git a/ndnboost/test/unit_test_suite.hpp b/ndnboost/test/unit_test_suite.hpp
new file mode 100644
index 0000000..5ef5f13
--- /dev/null
+++ b/ndnboost/test/unit_test_suite.hpp
@@ -0,0 +1,245 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : defines Unit Test Framework public API
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_SUITE_HPP_071894GER
+#define BOOST_TEST_UNIT_TEST_SUITE_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/unit_test_suite_impl.hpp>
+#include <ndnboost/test/framework.hpp>
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** Non-auto (explicit) test case interface ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_CASE( test_function ) \
+ndnboost::unit_test::make_test_case( ndnboost::unit_test::callback0<>(test_function), BOOST_TEST_STRINGIZE( test_function ) )
+#define BOOST_CLASS_TEST_CASE( test_function, tc_instance ) \
+ndnboost::unit_test::make_test_case((test_function), BOOST_TEST_STRINGIZE( test_function ), tc_instance )
+
+// ************************************************************************** //
+// ************** BOOST_TEST_SUITE ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_SUITE( testsuite_name ) \
+( new ndnboost::unit_test::test_suite( testsuite_name ) )
+
+// ************************************************************************** //
+// ************** BOOST_AUTO_TEST_SUITE ************** //
+// ************************************************************************** //
+
+#define BOOST_AUTO_TEST_SUITE( suite_name ) \
+namespace suite_name { \
+BOOST_AUTO_TU_REGISTRAR( suite_name )( BOOST_STRINGIZE( suite_name ) ); \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_FIXTURE_TEST_SUITE ************** //
+// ************************************************************************** //
+
+#define BOOST_FIXTURE_TEST_SUITE( suite_name, F ) \
+BOOST_AUTO_TEST_SUITE( suite_name ) \
+typedef F BOOST_AUTO_TEST_CASE_FIXTURE; \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_AUTO_TEST_SUITE_END ************** //
+// ************************************************************************** //
+
+#define BOOST_AUTO_TEST_SUITE_END() \
+BOOST_AUTO_TU_REGISTRAR( BOOST_JOIN( end_suite, __LINE__ ) )( 1 ); \
+} \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES ************** //
+// ************************************************************************** //
+
+#define BOOST_AUTO_TEST_CASE_EXPECTED_FAILURES( test_name, n ) \
+struct BOOST_AUTO_TC_UNIQUE_ID( test_name ); \
+ \
+static struct BOOST_JOIN( test_name, _exp_fail_num_spec ) \
+: ndnboost::unit_test::ut_detail:: \
+ auto_tc_exp_fail<BOOST_AUTO_TC_UNIQUE_ID( test_name ) > \
+{ \
+ BOOST_JOIN( test_name, _exp_fail_num_spec )() \
+ : ndnboost::unit_test::ut_detail:: \
+ auto_tc_exp_fail<BOOST_AUTO_TC_UNIQUE_ID( test_name ) >( n ) \
+ {} \
+} BOOST_JOIN( test_name, _exp_fail_num_spec_inst ); \
+ \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_FIXTURE_TEST_CASE ************** //
+// ************************************************************************** //
+
+#define BOOST_FIXTURE_TEST_CASE( test_name, F ) \
+struct test_name : public F { void test_method(); }; \
+ \
+static void BOOST_AUTO_TC_INVOKER( test_name )() \
+{ \
+ test_name t; \
+ t.test_method(); \
+} \
+ \
+struct BOOST_AUTO_TC_UNIQUE_ID( test_name ) {}; \
+ \
+BOOST_AUTO_TU_REGISTRAR( test_name )( \
+ ndnboost::unit_test::make_test_case( \
+ &BOOST_AUTO_TC_INVOKER( test_name ), #test_name ), \
+ ndnboost::unit_test::ut_detail::auto_tc_exp_fail< \
+ BOOST_AUTO_TC_UNIQUE_ID( test_name )>::instance()->value() ); \
+ \
+void test_name::test_method() \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_AUTO_TEST_CASE ************** //
+// ************************************************************************** //
+
+#define BOOST_AUTO_TEST_CASE( test_name ) \
+BOOST_FIXTURE_TEST_CASE( test_name, BOOST_AUTO_TEST_CASE_FIXTURE )
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_FIXTURE_TEST_CASE_TEMPLATE ************** //
+// ************************************************************************** //
+
+#define BOOST_FIXTURE_TEST_CASE_TEMPLATE( test_name, type_name, TL, F ) \
+template<typename type_name> \
+struct test_name : public F \
+{ void test_method(); }; \
+ \
+struct BOOST_AUTO_TC_INVOKER( test_name ) { \
+ template<typename TestType> \
+ static void run( ndnboost::type<TestType>* = 0 ) \
+ { \
+ test_name<TestType> t; \
+ t.test_method(); \
+ } \
+}; \
+ \
+BOOST_AUTO_TU_REGISTRAR( test_name )( \
+ ndnboost::unit_test::ut_detail::template_test_case_gen< \
+ BOOST_AUTO_TC_INVOKER( test_name ),TL >( \
+ BOOST_STRINGIZE( test_name ) ) ); \
+ \
+template<typename type_name> \
+void test_name<type_name>::test_method() \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_AUTO_TEST_CASE_TEMPLATE ************** //
+// ************************************************************************** //
+
+#define BOOST_AUTO_TEST_CASE_TEMPLATE( test_name, type_name, TL ) \
+BOOST_FIXTURE_TEST_CASE_TEMPLATE( test_name, type_name, TL, BOOST_AUTO_TEST_CASE_FIXTURE )
+
+// ************************************************************************** //
+// ************** BOOST_TEST_CASE_TEMPLATE ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_CASE_TEMPLATE( name, typelist ) \
+ ndnboost::unit_test::ut_detail::template_test_case_gen<name,typelist >( \
+ BOOST_TEST_STRINGIZE( name ) ) \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_TEST_CASE_TEMPLATE_FUNCTION ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_CASE_TEMPLATE_FUNCTION( name, type_name ) \
+template<typename type_name> \
+void BOOST_JOIN( name, _impl )( ndnboost::type<type_name>* ); \
+ \
+struct name { \
+ template<typename TestType> \
+ static void run( ndnboost::type<TestType>* frwrd = 0 ) \
+ { \
+ BOOST_JOIN( name, _impl )( frwrd ); \
+ } \
+}; \
+ \
+template<typename type_name> \
+void BOOST_JOIN( name, _impl )( ndnboost::type<type_name>* ) \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_GLOBAL_FIXURE ************** //
+// ************************************************************************** //
+
+#define BOOST_GLOBAL_FIXTURE( F ) \
+static ndnboost::unit_test::ut_detail::global_fixture_impl<F> BOOST_JOIN( gf_, F ) ; \
+/**/
+
+// ************************************************************************** //
+// ************** BOOST_AUTO_TEST_CASE_FIXTURE ************** //
+// ************************************************************************** //
+
+namespace ndnboost { namespace unit_test { namespace ut_detail {
+
+struct nil_t {};
+
+} // namespace ut_detail
+} // unit_test
+} // namespace ndnboost
+
+// Intentionally is in global namespace, so that FIXURE_TEST_SUITE can reset it in user code.
+typedef ::ndnboost::unit_test::ut_detail::nil_t BOOST_AUTO_TEST_CASE_FIXTURE;
+
+// ************************************************************************** //
+// ************** Auto registration facility helper macros ************** //
+// ************************************************************************** //
+
+#define BOOST_AUTO_TU_REGISTRAR( test_name ) \
+static ndnboost::unit_test::ut_detail::auto_test_unit_registrar BOOST_JOIN( BOOST_JOIN( test_name, _registrar ), __LINE__ )
+#define BOOST_AUTO_TC_INVOKER( test_name ) BOOST_JOIN( test_name, _invoker )
+#define BOOST_AUTO_TC_UNIQUE_ID( test_name ) BOOST_JOIN( test_name, _id )
+
+// ************************************************************************** //
+// ************** BOOST_TEST_MAIN ************** //
+// ************************************************************************** //
+
+#if defined(BOOST_TEST_MAIN)
+
+#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
+bool init_unit_test() {
+#else
+::ndnboost::unit_test::test_suite*
+init_unit_test_suite( int, char* [] ) {
+#endif
+
+#ifdef BOOST_TEST_MODULE
+ using namespace ::ndnboost::unit_test;
+ assign_op( framework::master_test_suite().p_name.value, BOOST_TEST_STRINGIZE( BOOST_TEST_MODULE ).trim( "\"" ), 0 );
+
+#endif
+
+#ifdef BOOST_TEST_ALTERNATIVE_INIT_API
+ return true;
+}
+#else
+ return 0;
+}
+#endif
+
+#endif
+
+//____________________________________________________________________________//
+
+#endif // BOOST_TEST_UNIT_TEST_SUITE_HPP_071894GER
+
diff --git a/ndnboost/test/unit_test_suite_impl.hpp b/ndnboost/test/unit_test_suite_impl.hpp
new file mode 100644
index 0000000..42933e4
--- /dev/null
+++ b/ndnboost/test/unit_test_suite_impl.hpp
@@ -0,0 +1,434 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines test_unit, test_case, test_case_results, test_suite and test_tree_visitor
+// ***************************************************************************
+
+#ifndef BOOST_TEST_UNIT_TEST_SUITE_IMPL_HPP_071894GER
+#define BOOST_TEST_UNIT_TEST_SUITE_IMPL_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/detail/global_typedef.hpp>
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/callback.hpp>
+#include <ndnboost/test/detail/fwd_decl.hpp>
+#include <ndnboost/test/detail/workaround.hpp>
+#include <ndnboost/test/test_observer.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+#include <ndnboost/mpl/for_each.hpp>
+#include <ndnboost/mpl/identity.hpp>
+#include <ndnboost/type.hpp>
+#include <ndnboost/type_traits/is_const.hpp>
+
+// STL
+#include <typeinfo> // for typeid
+#include <string> // for std::string
+#include <list> // for std::list
+#include <vector> // for std::vector
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** test_unit ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_unit {
+public:
+ enum { type = tut_any };
+
+ // Constructor
+ test_unit( const_string tu_name, test_unit_type t );
+
+ // dependencies management
+ void depends_on( test_unit* tu );
+ bool check_dependencies() const;
+
+ // Public r/o properties
+ typedef BOOST_READONLY_PROPERTY(test_unit_id,(framework_impl)) id_t;
+ typedef BOOST_READONLY_PROPERTY(test_unit_id,(test_suite)) parent_id_t;
+ readonly_property<test_unit_type> p_type; // type for this test unit
+ readonly_property<const_string> p_type_name; // "case"/"suite"
+ id_t p_id; // unique id for this test unit
+ parent_id_t p_parent_id; // parent test suite id
+
+ // Public r/w properties
+ readwrite_property<std::string> p_name; // name for this test unit
+ readwrite_property<unsigned> p_timeout; // timeout for the test unit execution
+ readwrite_property<counter_t> p_expected_failures; // number of expected failures in this test unit
+ mutable readwrite_property<bool> p_enabled; // enabled status for this unit
+
+ void increase_exp_fail( unsigned num );
+
+protected:
+ ~test_unit();
+
+private:
+ // Data members
+ std::list<test_unit_id> m_dependencies;
+};
+
+// ************************************************************************** //
+// ************** test_case_generator ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_unit_generator {
+public:
+ virtual test_unit* next() const = 0;
+
+protected:
+ BOOST_TEST_PROTECTED_VIRTUAL ~test_unit_generator() {}
+};
+
+// ************************************************************************** //
+// ************** test_case ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_case : public test_unit {
+public:
+ enum { type = tut_case };
+
+ // Constructor
+ test_case( const_string tc_name, callback0<> const& test_func );
+
+ // Access methods
+ callback0<> const& test_func() const { return m_test_func; }
+
+private:
+ friend class framework_impl;
+ ~test_case() {}
+
+ // BOOST_MSVC <= 1200 have problems with callback as property
+ // Data members
+ callback0<> m_test_func;
+};
+
+// ************************************************************************** //
+// ************** test_suite ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_suite : public test_unit {
+public:
+ enum { type = tut_suite };
+
+ // Constructor
+ explicit test_suite( const_string ts_name );
+
+ // test unit list management
+ void add( test_unit* tu, counter_t expected_failures = 0, unsigned timeout = 0 );
+ void add( test_unit_generator const& gen, unsigned timeout = 0 );
+ void remove( test_unit_id id );
+
+ // access methods
+ test_unit_id get( const_string tu_name ) const;
+ std::size_t size() const { return m_members.size(); }
+
+protected:
+ friend BOOST_TEST_DECL
+ void traverse_test_tree( test_suite const&, test_tree_visitor& );
+ friend class framework_impl;
+ virtual ~test_suite() {}
+
+ // Data members
+ std::vector<test_unit_id> m_members;
+};
+
+// ************************************************************************** //
+// ************** master_test_suite ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL master_test_suite_t : public test_suite {
+public:
+ master_test_suite_t() : test_suite( "Master Test Suite" )
+ , argc( 0 )
+ , argv( 0 )
+ {}
+
+ // Data members
+ int argc;
+ char** argv;
+};
+
+
+// ************************************************************************** //
+// ************** test_tree_visitor ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL test_tree_visitor {
+public:
+ // test tree visitor interface
+ virtual void visit( test_case const& ) {}
+ virtual bool test_suite_start( test_suite const& ) { return true; }
+ virtual void test_suite_finish( test_suite const& ) {}
+
+protected:
+ BOOST_TEST_PROTECTED_VIRTUAL ~test_tree_visitor() {}
+};
+
+// ************************************************************************** //
+// ************** traverse_test_tree ************** //
+// ************************************************************************** //
+
+BOOST_TEST_DECL void traverse_test_tree( test_case const&, test_tree_visitor& );
+BOOST_TEST_DECL void traverse_test_tree( test_suite const&, test_tree_visitor& );
+BOOST_TEST_DECL void traverse_test_tree( test_unit_id , test_tree_visitor& );
+
+//____________________________________________________________________________//
+
+inline void
+traverse_test_tree( test_unit const& tu, test_tree_visitor& V )
+{
+ if( tu.p_type == tut_case )
+ traverse_test_tree( static_cast<test_case const&>( tu ), V );
+ else
+ traverse_test_tree( static_cast<test_suite const&>( tu ), V );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** test_case_counter ************** //
+// ************************************************************************** //
+
+class test_case_counter : public test_tree_visitor {
+public:
+ // Constructor
+ test_case_counter() : p_count( 0 ) {}
+
+ BOOST_READONLY_PROPERTY( counter_t, (test_case_counter)) p_count;
+private:
+ // test tree visitor interface
+ virtual void visit( test_case const& );
+ virtual bool test_suite_start( test_suite const& ts ) { return ts.p_enabled; }
+};
+
+// ************************************************************************** //
+// ************** test_being_aborted ************** //
+// ************************************************************************** //
+
+struct BOOST_TEST_DECL test_being_aborted {};
+
+// ************************************************************************** //
+// ************** object generators ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+BOOST_TEST_DECL std::string normalize_test_case_name( const_string tu_name );
+
+template<typename InstanceType,typename UserTestCase>
+struct user_tc_method_invoker {
+ typedef void (UserTestCase::*TestMethod )();
+
+ user_tc_method_invoker( shared_ptr<InstanceType> inst, TestMethod test_method )
+ : m_inst( inst ), m_test_method( test_method ) {}
+
+ void operator()() { ((*m_inst).*m_test_method)(); }
+
+ shared_ptr<InstanceType> m_inst;
+ TestMethod m_test_method;
+};
+
+} // namespace ut_detail
+
+//____________________________________________________________________________//
+
+inline test_case*
+make_test_case( callback0<> const& test_func, const_string tc_name )
+{
+ return new test_case( ut_detail::normalize_test_case_name( tc_name ), test_func );
+}
+
+//____________________________________________________________________________//
+
+template<typename UserTestCase, typename InstanceType>
+inline test_case*
+make_test_case( void (UserTestCase::* test_method )(),
+ const_string tc_name,
+ ndnboost::shared_ptr<InstanceType> user_test_case )
+{
+ return new test_case( ut_detail::normalize_test_case_name( tc_name ),
+ ut_detail::user_tc_method_invoker<InstanceType,UserTestCase>( user_test_case, test_method ) );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** auto_test_unit_registrar ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+struct BOOST_TEST_DECL auto_test_unit_registrar
+{
+ // Constructors
+ auto_test_unit_registrar( test_case* tc, counter_t exp_fail );
+ explicit auto_test_unit_registrar( const_string ts_name );
+ explicit auto_test_unit_registrar( test_unit_generator const& tc_gen );
+ explicit auto_test_unit_registrar( int );
+
+private:
+ static std::list<test_suite*>& curr_ts_store();
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+struct auto_tc_exp_fail {
+ auto_tc_exp_fail() : m_value( 0 ) {}
+
+ explicit auto_tc_exp_fail( unsigned v )
+ : m_value( v )
+ {
+ instance() = this;
+ }
+
+ static auto_tc_exp_fail*& instance()
+ {
+ static auto_tc_exp_fail inst;
+ static auto_tc_exp_fail* inst_ptr = &inst;
+
+ return inst_ptr;
+ }
+
+ unsigned value() const { return m_value; }
+
+private:
+ // Data members
+ unsigned m_value;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** global_fixture ************** //
+// ************************************************************************** //
+
+class BOOST_TEST_DECL global_fixture : public test_observer {
+public:
+ // Constructor
+ global_fixture();
+};
+
+//____________________________________________________________________________//
+
+namespace ut_detail {
+
+template<typename F>
+struct global_fixture_impl : public global_fixture {
+ // Constructor
+ global_fixture_impl(): m_fixure( 0 ) {}
+
+ // test observer interface
+ virtual void test_start( counter_t ) { m_fixure = new F; }
+ virtual void test_finish() { delete m_fixure; m_fixure = 0; }
+ virtual void test_aborted() { delete m_fixure; m_fixure = 0; }
+
+private:
+ // Data members
+ F* m_fixure;
+};
+
+// ************************************************************************** //
+// ************** test_case_template_invoker ************** //
+// ************************************************************************** //
+
+template<typename TestCaseTemplate,typename TestType>
+class test_case_template_invoker {
+public:
+ void operator()() { TestCaseTemplate::run( (ndnboost::type<TestType>*)0 ); }
+};
+
+// ************************************************************************** //
+// ************** generate_test_case_4_type ************** //
+// ************************************************************************** //
+
+template<typename Generator,typename TestCaseTemplate>
+struct generate_test_case_4_type {
+ explicit generate_test_case_4_type( const_string tc_name, Generator& G )
+ : m_test_case_name( tc_name )
+ , m_holder( G )
+ {}
+
+ template<typename TestType>
+ void operator()( mpl::identity<TestType> )
+ {
+ std::string full_name;
+ assign_op( full_name, m_test_case_name, 0 );
+ full_name += '<';
+ full_name += typeid(TestType).name();
+ if( ndnboost::is_const<TestType>::value )
+ full_name += " const";
+ full_name += '>';
+
+ m_holder.m_test_cases.push_back(
+ new test_case( full_name, test_case_template_invoker<TestCaseTemplate,TestType>() ) );
+ }
+
+private:
+ // Data members
+ const_string m_test_case_name;
+ Generator& m_holder;
+};
+
+// ************************************************************************** //
+// ************** test_case_template ************** //
+// ************************************************************************** //
+
+template<typename TestCaseTemplate,typename TestTypesList>
+class template_test_case_gen : public test_unit_generator {
+public:
+ // Constructor
+ template_test_case_gen( const_string tc_name )
+ {
+ typedef generate_test_case_4_type<template_test_case_gen<TestCaseTemplate,TestTypesList>,
+ TestCaseTemplate
+ > single_test_gen;
+ mpl::for_each<TestTypesList,mpl::make_identity<mpl::_> >( single_test_gen( tc_name, *this ) );
+ }
+
+ virtual test_unit* next() const
+ {
+ if( m_test_cases.empty() )
+ return 0;
+
+ test_unit* res = m_test_cases.front();
+ m_test_cases.pop_front();
+
+ return res;
+ }
+
+ // Data members
+ mutable std::list<test_unit*> m_test_cases;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+} // unit_test
+
+} // namespace ndnboost
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_UNIT_TEST_SUITE_IMPL_HPP_071894GER
+
diff --git a/ndnboost/test/utils/algorithm.hpp b/ndnboost/test/utils/algorithm.hpp
new file mode 100644
index 0000000..8003dfe
--- /dev/null
+++ b/ndnboost/test/utils/algorithm.hpp
@@ -0,0 +1,228 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : addition to STL algorithms
+// ***************************************************************************
+
+#ifndef BOOST_ALGORITHM_HPP_062304GER
+#define BOOST_ALGORITHM_HPP_062304GER
+
+#include <utility>
+#include <algorithm> // std::find
+#include <functional> // std::bind1st
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+/// @brief this algorithm search through two collections for first mismatch position that get returned as a pair
+/// of iterators, first pointing to the mismatch position in first collection, second iterator in second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template <class InputIter1, class InputIter2>
+inline std::pair<InputIter1, InputIter2>
+mismatch( InputIter1 first1, InputIter1 last1,
+ InputIter2 first2, InputIter2 last2 )
+{
+ while( first1 != last1 && first2 != last2 && *first1 == *first2 ) {
+ ++first1;
+ ++first2;
+ }
+
+ return std::pair<InputIter1, InputIter2>(first1, first2);
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through two collections for first mismatch position that get returned as a pair
+/// of iterators, first pointing to the mismatch position in first collection, second iterator in second one. This algorithms
+/// uses supplied predicate for collection elements comparison
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template <class InputIter1, class InputIter2, class Predicate>
+inline std::pair<InputIter1, InputIter2>
+mismatch( InputIter1 first1, InputIter1 last1,
+ InputIter2 first2, InputIter2 last2,
+ Predicate pred )
+{
+ while( first1 != last1 && first2 != last2 && pred( *first1, *first2 ) ) {
+ ++first1;
+ ++first2;
+ }
+
+ return std::pair<InputIter1, InputIter2>(first1, first2);
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for first element that does not belong a second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template<class ForwardIterator1, class ForwardIterator2>
+inline ForwardIterator1
+find_first_not_of( ForwardIterator1 first1, ForwardIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2 )
+{
+ while( first1 != last1 ) {
+ if( std::find( first2, last2, *first1 ) == last2 )
+ break;
+ ++first1;
+ }
+
+ return first1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for first element that does not satisfy binary
+/// predicate in conjunction will any element in second collection
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template<class ForwardIterator1, class ForwardIterator2, class Predicate>
+inline ForwardIterator1
+find_first_not_of( ForwardIterator1 first1, ForwardIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2,
+ Predicate pred )
+{
+ while( first1 != last1 ) {
+ if( std::find_if( first2, last2, std::bind1st( pred, *first1 ) ) == last2 )
+ break;
+ ++first1;
+ }
+
+ return first1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that belongs to a second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template<class BidirectionalIterator1, class ForwardIterator2>
+inline BidirectionalIterator1
+find_last_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2 )
+{
+ if( first1 == last1 || first2 == last2 )
+ return last1;
+
+ BidirectionalIterator1 it1 = last1;
+ while( --it1 != first1 && std::find( first2, last2, *it1 ) == last2 ) {}
+
+ return it1 == first1 && std::find( first2, last2, *it1 ) == last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that satisfy binary
+/// predicate in conjunction will at least one element in second collection
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template<class BidirectionalIterator1, class ForwardIterator2, class Predicate>
+inline BidirectionalIterator1
+find_last_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2,
+ Predicate pred )
+{
+ if( first1 == last1 || first2 == last2 )
+ return last1;
+
+ BidirectionalIterator1 it1 = last1;
+ while( --it1 != first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) == last2 ) {}
+
+ return it1 == first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) == last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that does not belong to a second one
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+template<class BidirectionalIterator1, class ForwardIterator2>
+inline BidirectionalIterator1
+find_last_not_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2 )
+{
+ if( first1 == last1 || first2 == last2 )
+ return last1;
+
+ BidirectionalIterator1 it1 = last1;
+ while( --it1 != first1 && std::find( first2, last2, *it1 ) != last2 ) {}
+
+ return it1 == first1 && std::find( first2, last2, *it1 ) != last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+/// @brief this algorithm search through first collection for last element that does not satisfy binary
+/// predicate in conjunction will any element in second collection
+
+/// @param first1 - first collection begin iterator
+/// @param last1 - first collection end iterator
+/// @param first2 - second collection begin iterator
+/// @param last2 - second collection end iterator
+/// @param pred - predicate to be used for search
+template<class BidirectionalIterator1, class ForwardIterator2, class Predicate>
+inline BidirectionalIterator1
+find_last_not_of( BidirectionalIterator1 first1, BidirectionalIterator1 last1,
+ ForwardIterator2 first2, ForwardIterator2 last2,
+ Predicate pred )
+{
+ if( first1 == last1 || first2 == last2 )
+ return last1;
+
+ BidirectionalIterator1 it1 = last1;
+ while( --it1 != first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) != last2 ) {}
+
+ return it1 == first1 && std::find_if( first2, last2, std::bind1st( pred, *it1 ) ) == last2 ? last1 : it1;
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_ALGORITHM_HPP_062304GER
+
+
diff --git a/ndnboost/test/utils/assign_op.hpp b/ndnboost/test/utils/assign_op.hpp
new file mode 100644
index 0000000..b3d7ca0
--- /dev/null
+++ b/ndnboost/test/utils/assign_op.hpp
@@ -0,0 +1,41 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : overloadable assignment
+// ***************************************************************************
+
+#ifndef BOOST_TEST_ASSIGN_OP_033005GER
+#define BOOST_TEST_ASSIGN_OP_033005GER
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** generic assign operator ************** //
+// ************************************************************************** //
+
+// generic
+template<typename T,typename S>
+inline void
+assign_op( T& t, S const& s, long )
+{
+ t = s;
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#endif // BOOST_TEST_ASSIGN_OP_033005GER
+
diff --git a/ndnboost/test/utils/basic_cstring/basic_cstring.hpp b/ndnboost/test/utils/basic_cstring/basic_cstring.hpp
new file mode 100644
index 0000000..b3982df
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/basic_cstring.hpp
@@ -0,0 +1,731 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : class basic_cstring wraps C string and provide std_string like
+// interface
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BASIC_CSTRING_HPP_071894GER
+#define BOOST_TEST_BASIC_CSTRING_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp>
+#include <ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp>
+
+// STL
+#include <string>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** basic_cstring ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+class basic_cstring {
+ typedef basic_cstring<CharT> self_type;
+public:
+ // Subtypes
+ typedef ut_detail::bcs_char_traits<CharT> traits_type;
+ typedef typename ut_detail::bcs_char_traits<CharT>::std_string std_string;
+
+ typedef CharT value_type;
+ typedef value_type* pointer;
+ typedef value_type const* const_pointer;
+ typedef value_type& reference;
+ typedef const value_type& const_reference;
+ typedef std::size_t size_type;
+ typedef std::ptrdiff_t difference_type;
+
+ typedef value_type const* const_iterator;
+ typedef value_type* iterator;
+
+ // !! should also present reverse_iterator, const_reverse_iterator
+
+#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+ enum npos_type { npos = static_cast<size_type>(-1) };
+#else
+ // IBM/VisualAge version 6 is not able to handle enums larger than 4 bytes.
+ // But size_type is 8 bytes in 64bit mode.
+ static const size_type npos = -1 ;
+#endif
+
+ static pointer null_str();
+
+ // Constructors; default copy constructor is generated by compiler
+ basic_cstring();
+ basic_cstring( std_string const& s );
+ basic_cstring( pointer s );
+ basic_cstring( pointer s, size_type arg_size );
+ basic_cstring( pointer first, pointer last );
+
+ // data access methods
+ value_type operator[]( size_type index ) const;
+ value_type at( size_type index ) const;
+
+ // size operators
+ size_type size() const;
+ bool is_empty() const;
+ void clear();
+ void resize( size_type new_len );
+
+ // !! only for STL container conformance use is_empty instead
+ bool empty() const;
+
+ // Trimming
+ self_type& trim_right( size_type trim_size );
+ self_type& trim_left( size_type trim_size );
+ self_type& trim_right( iterator it );
+ self_type& trim_left( iterator it );
+#ifndef __IBMCPP__
+ self_type& trim_left( self_type exclusions = self_type() ) ;
+ self_type& trim_right( self_type exclusions = self_type() ) ;
+ self_type& trim( self_type exclusions = self_type() ) ;
+#else
+ // VisualAge version 6 has in this case a problem with the default arguments.
+ self_type& trim_left( self_type exclusions ) ;
+ self_type& trim_right( self_type exclusions ) ;
+ self_type& trim( self_type exclusions ) ;
+ self_type& trim_left() { trim_left( self_type() ) ; }
+ self_type& trim_right() { trim_right( self_type() ) ; }
+ self_type& trim() { trim( self_type() ) ; }
+#endif
+
+ // Assignment operators
+ basic_cstring& operator=( self_type const& s );
+ basic_cstring& operator=( std_string const& s );
+ basic_cstring& operator=( pointer s );
+
+ template<typename CharT2>
+ basic_cstring& assign( basic_cstring<CharT2> const& s ) { *this = basic_cstring<CharT>( s.begin(), s.end() ); return *this; }
+ basic_cstring& assign( self_type const& s, size_type pos, size_type len );
+ basic_cstring& assign( std_string const& s );
+ basic_cstring& assign( std_string const& s, size_type pos, size_type len );
+ basic_cstring& assign( pointer s );
+ basic_cstring& assign( pointer s, size_type len );
+ basic_cstring& assign( pointer f, pointer l );
+
+ // swapping
+ void swap( self_type& s );
+
+ // Iterators
+ iterator begin();
+ const_iterator begin() const;
+ iterator end();
+ const_iterator end() const;
+
+ // !! should have rbegin, rend
+
+ // substring search operation
+ size_type find( basic_cstring ) const;
+ size_type rfind( basic_cstring ) const;
+ self_type substr( size_type beg_index, size_type end_index = npos ) const;
+
+private:
+ static self_type default_trim_ex();
+
+ // Data members
+ iterator m_begin;
+ iterator m_end;
+};
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::pointer
+basic_cstring<CharT>::null_str()
+{
+ static CharT null = 0;
+ return &null;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring()
+: m_begin( null_str() )
+, m_end( m_begin )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( std_string const& s )
+: m_begin( s.c_str() )
+, m_end( m_begin + s.size() )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( pointer s )
+: m_begin( s ? s : null_str() )
+, m_end ( m_begin + (s ? traits_type::length( s ) : 0 ) )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( pointer s, size_type arg_size )
+: m_begin( s ), m_end( m_begin + arg_size )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline
+basic_cstring<CharT>::basic_cstring( pointer first, pointer last )
+: m_begin( first )
+, m_end( last )
+{
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+basic_cstring<CharT>::operator[]( size_type index ) const
+{
+ return m_begin[index];
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+basic_cstring<CharT>::at( size_type index ) const
+{
+ if( m_begin + index >= m_end )
+ return static_cast<value_type>(0);
+
+ return m_begin[index];
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::size_type
+basic_cstring<CharT>::size() const
+{
+ return m_end - m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+basic_cstring<CharT>::is_empty() const
+{
+ return m_end == m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+basic_cstring<CharT>::empty() const
+{
+ return is_empty();
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline void
+basic_cstring<CharT>::clear()
+{
+ m_begin = m_end;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline void
+basic_cstring<CharT>::resize( size_type new_len )
+{
+ if( m_begin + new_len < m_end )
+ m_end = m_begin + new_len;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_left( size_type trim_size )
+{
+ m_begin += trim_size;
+ if( m_end <= m_begin )
+ clear();
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_left( iterator it )
+{
+ m_begin = it;
+ if( m_end <= m_begin )
+ clear();
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_left( basic_cstring exclusions )
+{
+ if( exclusions.is_empty() )
+ exclusions = default_trim_ex();
+
+ iterator it;
+ for( it = begin(); it != end(); ++it ) {
+ if( traits_type::find( exclusions.begin(), exclusions.size(), *it ) == reinterpret_cast<pointer>(0) )
+ break;
+ }
+
+ return trim_left( it );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_right( size_type trim_size )
+{
+ m_end -= trim_size;
+ if( m_end <= m_begin )
+ clear();
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_right( iterator it )
+{
+ m_end = it;
+ if( m_end <= m_begin )
+ clear();
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim_right( basic_cstring exclusions )
+{
+ if( exclusions.is_empty() )
+ exclusions = default_trim_ex();
+
+ iterator it;
+
+ for( it = end()-1; it != begin()-1; --it ) {
+ if( self_type::traits_type::find( exclusions.begin(), exclusions.size(), *it ) == reinterpret_cast<pointer>(0) )
+ break;
+ }
+
+ return trim_right( it+1 );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::trim( basic_cstring exclusions )
+{
+ trim_left( exclusions );
+ trim_right( exclusions );
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::operator=( basic_cstring<CharT> const& s )
+{
+ m_begin = s.m_begin;
+ m_end = s.m_end;
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::operator=( std_string const& s )
+{
+ return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::operator=( pointer s )
+{
+ return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( basic_cstring<CharT> const& s, size_type pos, size_type len )
+{
+ return *this = self_type( s.m_begin + pos, len );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( std_string const& s )
+{
+ return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( std_string const& s, size_type pos, size_type len )
+{
+ return *this = self_type( s.c_str() + pos, len );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( pointer s )
+{
+ return *this = self_type( s );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( pointer s, size_type len )
+{
+ return *this = self_type( s, len );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>&
+basic_cstring<CharT>::assign( pointer f, pointer l )
+{
+ return *this = self_type( f, l );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline void
+basic_cstring<CharT>::swap( basic_cstring<CharT>& s )
+{
+ // do not want to include alogrithm
+ pointer tmp1 = m_begin;
+ pointer tmp2 = m_end;
+
+ m_begin = s.m_begin;
+ m_end = s.m_end;
+
+ s.m_begin = tmp1;
+ s.m_end = tmp2;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::iterator
+basic_cstring<CharT>::begin()
+{
+ return m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::const_iterator
+basic_cstring<CharT>::begin() const
+{
+ return m_begin;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::iterator
+basic_cstring<CharT>::end()
+{
+ return m_end;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::const_iterator
+basic_cstring<CharT>::end() const
+{
+ return m_end;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::size_type
+basic_cstring<CharT>::find( basic_cstring<CharT> str ) const
+{
+ if( str.is_empty() || str.size() > size() )
+ return static_cast<size_type>(npos);
+
+ const_iterator it = begin();
+ const_iterator last = end() - str.size() + 1;
+
+ while( it != last ) {
+ if( traits_type::compare( it, str.begin(), str.size() ) == 0 )
+ break;
+
+ ++it;
+ }
+
+ return it == last ? static_cast<size_type>(npos) : it - begin();
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::size_type
+basic_cstring<CharT>::rfind( basic_cstring<CharT> str ) const
+{
+ if( str.is_empty() || str.size() > size() )
+ return static_cast<size_type>(npos);
+
+ const_iterator it = end() - str.size();
+ const_iterator last = begin()-1;
+
+ while( it != last ) {
+ if( traits_type::compare( it, str.begin(), str.size() ) == 0 )
+ break;
+
+ --it;
+ }
+
+ return it == last ? static_cast<size_type>(npos) : static_cast<size_type>(it - begin());
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>
+basic_cstring<CharT>::substr( size_type beg_index, size_type end_index ) const
+{
+ return beg_index > size()
+ ? self_type()
+ : end_index > size()
+ ? self_type( m_begin + beg_index, m_end )
+ : self_type( m_begin + beg_index, m_begin + end_index );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline basic_cstring<CharT>
+basic_cstring<CharT>::default_trim_ex()
+{
+ static CharT ws[3] = { CharT(' '), CharT('\t'), CharT('\n') }; // !! wide case
+
+ return self_type( ws, 3 );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** comparison operators ************** //
+// ************************************************************************** //
+
+template<typename CharT1,typename CharT2>
+inline bool
+operator==( basic_cstring<CharT1> const& s1, basic_cstring<CharT2> const& s2 )
+{
+ typedef typename basic_cstring<CharT1>::traits_type traits_type;
+ return s1.size() == s2.size() &&
+ traits_type::compare( s1.begin(), s2.begin(), s1.size() ) == 0;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT1,typename CharT2>
+inline bool
+operator==( basic_cstring<CharT1> const& s1, CharT2* s2 )
+{
+#if !defined(__DMC__)
+ return s1 == basic_cstring<CharT2>( s2 );
+#else
+ return s1 == basic_cstring<CharT2 const>( s2 );
+#endif
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator==( basic_cstring<CharT> const& s1, typename basic_cstring<CharT>::std_string const& s2 )
+{
+ return s1 == basic_cstring<CharT>( s2 );
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT1,typename CharT2>
+inline bool
+operator==( CharT1* s2, basic_cstring<CharT2> const& s1 )
+{
+ return s1 == s2;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator==( typename basic_cstring<CharT>::std_string const& s2, basic_cstring<CharT> const& s1 )
+{
+ return s1 == s2;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( basic_cstring<CharT> const& s1, CharT* s2 )
+{
+ return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( CharT* s2, basic_cstring<CharT> const& s1 )
+{
+ return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( basic_cstring<CharT> const& s1, basic_cstring<CharT> const& s2 )
+{
+ return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( basic_cstring<CharT> const& s1, typename basic_cstring<CharT>::std_string const& s2 )
+{
+ return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT>
+inline bool
+operator!=( typename basic_cstring<CharT>::std_string const& s2, basic_cstring<CharT> const& s1 )
+{
+ return !(s1 == s2);
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** first_char ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+first_char( basic_cstring<CharT> source )
+{
+ typedef typename basic_cstring<CharT>::value_type string_value_type;
+
+ return source.is_empty() ? static_cast<string_value_type>(0) : *source.begin();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** last_char ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+inline typename basic_cstring<CharT>::value_type
+last_char( basic_cstring<CharT> source )
+{
+ typedef typename basic_cstring<CharT>::value_type string_value_type;
+
+ return source.is_empty() ? static_cast<string_value_type>(0) : *(source.end()-1);
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** assign_op ************** //
+// ************************************************************************** //
+
+template<typename CharT1, typename CharT2>
+inline void
+assign_op( std::basic_string<CharT1>& target, basic_cstring<CharT2> src, int )
+{
+ target.assign( src.begin(), src.size() );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BASIC_CSTRING_HPP_071894GER
diff --git a/ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp b/ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp
new file mode 100644
index 0000000..14cb33b
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/basic_cstring_fwd.hpp
@@ -0,0 +1,40 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : basic_cstring class wrap C string and provide std_string like
+// interface
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BASIC_CSTRING_FWD_HPP_071894GER
+#define BOOST_TEST_BASIC_CSTRING_FWD_HPP_071894GER
+
+#include <ndnboost/detail/workaround.hpp>
+
+namespace ndnboost {
+
+namespace unit_test {
+
+template<typename CharT> class basic_cstring;
+typedef basic_cstring<char const> const_string;
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590041))
+typedef const_string literal_string;
+#else
+typedef const_string const literal_string;
+#endif
+
+typedef char const* const c_literal_string;
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#endif // BOOST_TEST_BASIC_CSTRING_FWD_HPP_071894GER
+
diff --git a/ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp b/ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp
new file mode 100644
index 0000000..d6571f7
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/bcs_char_traits.hpp
@@ -0,0 +1,150 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : generic char traits class; wraps std::char_traits
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BCS_CHAR_TRAITS_HPP_071894GER
+#define BOOST_TEST_BCS_CHAR_TRAITS_HPP_071894GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/type_traits/add_const.hpp>
+
+// STL
+#include <string> // std::char_traits
+#include <cstddef> // std::size_t
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace ut_detail {
+
+template<typename CharT> struct bcs_base_char { typedef CharT type; };
+
+template<> struct bcs_base_char<char const> { typedef char type; };
+template<> struct bcs_base_char<unsigned char> { typedef char type; };
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+template<> struct bcs_base_char<unsigned char const> { typedef char type; };
+#endif
+
+template<> struct bcs_base_char<wchar_t const> { typedef wchar_t type; };
+
+// ************************************************************************** //
+// ************** bcs_char_traits ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+struct bcs_char_traits_impl
+{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
+ typedef CharT const const_char;
+#else
+ typedef typename ndnboost::add_const<CharT>::type const_char;
+#endif
+ static bool eq( CharT c1, CharT c2 )
+ {
+ return c1 == c2;
+ }
+ static bool lt( CharT c1, CharT c2 )
+ {
+ return c1 < c2;
+ }
+
+ static int compare( const_char* cstr1, const_char* cstr2, std::size_t n )
+ {
+ while( n > 0 ) {
+ if( !eq( *cstr1, *cstr2 ) )
+ return lt( *cstr1, *cstr2 ) ? -1 : 1;
+ ++cstr1;
+ ++cstr2;
+ --n;
+ }
+
+ return 0;
+ }
+
+ static std::size_t length( const_char* cstr )
+ {
+ const_char null_char = CharT();
+
+ const_char* ptr = cstr;
+ while( !eq( *ptr, null_char ) )
+ ++ptr;
+
+ return ptr - cstr;
+ }
+
+ static const_char* find( const_char* s, std::size_t n, CharT c )
+ {
+ while( n > 0 ) {
+ if( eq( *s, c ) )
+ return s;
+
+ ++s;
+ --n;
+ }
+ return 0;
+ }
+};
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+template<typename CharT>
+struct char_traits_with_find : std::string_char_traits<CharT> {
+ static CharT const* find( CharT const* s, std::size_t n, CharT c )
+ {
+ while( n > 0 ) {
+ if( eq( *s, c ) )
+ return s;
+
+ ++s;
+ --n;
+ }
+ return 0;
+ }
+};
+
+template<> struct bcs_char_traits_impl<char> : char_traits_with_find<char> {};
+template<> struct bcs_char_traits_impl<wchar_t> : char_traits_with_find<wchar_t> {};
+#else
+template<> struct bcs_char_traits_impl<char> : std::char_traits<char> {};
+template<> struct bcs_char_traits_impl<wchar_t> : std::char_traits<wchar_t> {};
+#endif
+
+template<typename CharT>
+class bcs_char_traits : public bcs_char_traits_impl<CharT> {
+ typedef typename ut_detail::bcs_base_char<CharT>::type the_base_char;
+public:
+#ifdef BOOST_CLASSIC_IOSTREAMS
+ typedef std::basic_string<the_base_char, std::string_char_traits<the_base_char> > std_string;
+#else
+ typedef std::basic_string<the_base_char, std::char_traits<the_base_char> > std_string;
+#endif
+};
+
+} // namespace ut_detail
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BCS_CHAR_TRAITS_HPP_071894GER
diff --git a/ndnboost/test/utils/basic_cstring/compare.hpp b/ndnboost/test/utils/basic_cstring/compare.hpp
new file mode 100644
index 0000000..db9c854
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/compare.hpp
@@ -0,0 +1,115 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : class basic_cstring comparisons implementation
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BASIC_CSTRING_COMPARE_HPP_071894GER
+#define BOOST_TEST_BASIC_CSTRING_COMPARE_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+
+// STL
+#include <functional>
+#include <cctype>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+# if defined(BOOST_NO_STDC_NAMESPACE) && !BOOST_WORKAROUND(__BORLANDC__, <= 0x570)
+namespace std { using ::toupper; }
+# endif
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** case_ins_compare ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<class CharT>
+struct case_ins
+{
+ static bool eq( CharT c1, CharT c2 ) { return (std::toupper)( c1 ) == (std::toupper)( c2 ); }
+ static bool lt( CharT c1, CharT c2 ) { return (std::toupper)( c1 ) < (std::toupper)( c2 ); }
+
+ static int compare( CharT const* s1, CharT const* s2, std::size_t n )
+ {
+ for( std::size_t i = 0; i < n; ++i ) {
+ if( !eq( s1[i], s2[i] ) )
+ return lt( s1[i], s2[i] ) ? -1 : 1;
+ }
+ return 0;
+ }
+};
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** case_ins_eq ************** //
+// ************************************************************************** //
+
+template<class CharT>
+inline bool
+case_ins_eq( basic_cstring<CharT> x, basic_cstring<CharT> y )
+{
+ return x.size() == y.size() && ut_detail::case_ins<CharT>::compare( x.begin(), y.begin(), x.size() ) == 0;
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** case_ins_less ************** //
+// ************************************************************************** //
+
+template<class CharT>
+class case_ins_less : public std::binary_function<basic_cstring<CharT>,basic_cstring<CharT>,bool>
+{
+public:
+ bool operator()( basic_cstring<CharT> x, basic_cstring<CharT> y ) const
+ {
+ return x.size() != y.size()
+ ? x.size() < y.size()
+ : ut_detail::case_ins<CharT>::compare( x.begin(), y.begin(), x.size() ) < 0;
+ }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** operator < ************** //
+// ************************************************************************** //
+
+template<class CharT>
+inline bool
+operator <( ndnboost::unit_test::basic_cstring<CharT> const& x,
+ ndnboost::unit_test::basic_cstring<CharT> const& y )
+{
+ typedef typename ndnboost::unit_test::basic_cstring<CharT>::traits_type traits_type;
+ return x.size() != y.size()
+ ? x.size() < y.size()
+ : traits_type::compare( x.begin(), y.begin(), x.size() ) < 0;
+}
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BASIC_CSTRING_COMPARE_HPP_071894GER
diff --git a/ndnboost/test/utils/basic_cstring/io.hpp b/ndnboost/test/utils/basic_cstring/io.hpp
new file mode 100644
index 0000000..adb6d1e
--- /dev/null
+++ b/ndnboost/test/utils/basic_cstring/io.hpp
@@ -0,0 +1,73 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : basic_cstring i/o implementation
+// ***************************************************************************
+
+#ifndef BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER
+#define BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+
+// STL
+#include <iosfwd>
+#include <string>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+
+template<typename CharT>
+inline std::ostream&
+operator<<( std::ostream& os, basic_cstring<CharT> const& str )
+{
+ typedef typename ut_detail::bcs_base_char<CharT>::type char_type;
+ char_type const* const beg = reinterpret_cast<char_type const* const>( str.begin() );
+ char_type const* const end = reinterpret_cast<char_type const* const>( str.end() );
+ os << std::basic_string<char_type>( beg, end - beg );
+
+ return os;
+}
+
+#else
+
+template<typename CharT1, typename Tr,typename CharT2>
+inline std::basic_ostream<CharT1,Tr>&
+operator<<( std::basic_ostream<CharT1,Tr>& os, basic_cstring<CharT2> const& str )
+{
+ CharT1 const* const beg = reinterpret_cast<CharT1 const*>( str.begin() ); // !!
+ CharT1 const* const end = reinterpret_cast<CharT1 const*>( str.end() );
+ os << std::basic_string<CharT1,Tr>( beg, end - beg );
+
+ return os;
+}
+
+#endif
+
+//____________________________________________________________________________//
+
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_BASIC_CSTRING_IO_HPP_071894GER
diff --git a/ndnboost/test/utils/callback.hpp b/ndnboost/test/utils/callback.hpp
new file mode 100644
index 0000000..91e23f3
--- /dev/null
+++ b/ndnboost/test/utils/callback.hpp
@@ -0,0 +1,310 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description :
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CALLBACK_020505GER
+#define BOOST_TEST_CALLBACK_020505GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/shared_ptr.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(BOOST_INTEL, <= 700)
+# define BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+#endif
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace ut_detail {
+
+struct unused {};
+
+template<typename R>
+struct invoker {
+ template<typename Functor>
+ R invoke( Functor& f ) { return f(); }
+ template<typename Functor, typename T1>
+ R invoke( Functor& f, T1 t1 ) { return f( t1 ); }
+ template<typename Functor, typename T1, typename T2>
+ R invoke( Functor& f, T1 t1, T2 t2 ) { return f( t1, t2 ); }
+ template<typename Functor, typename T1, typename T2, typename T3>
+ R invoke( Functor& f, T1 t1, T2 t2, T3 t3 ) { return f( t1, t2, t3 ); }
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct invoker<unused> {
+ template<typename Functor>
+ unused invoke( Functor& f ) { f(); return unused(); }
+ template<typename Functor, typename T1>
+ unused invoke( Functor& f, T1 t1 ) { f( t1 ); return unused(); }
+ template<typename Functor, typename T1, typename T2>
+ unused invoke( Functor& f, T1 t1, T2 t2 ) { f( t1, t2 ); return unused(); }
+ template<typename Functor, typename T1, typename T2, typename T3>
+ unused invoke( Functor& f, T1 t1, T2 t2, T3 t3 ) { f( t1, t2, t3 ); return unused(); }
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** unit_test::callback0 ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R>
+struct callback0_impl {
+ virtual ~callback0_impl() {}
+
+ virtual R invoke() = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename Functor>
+struct callback0_impl_t : callback0_impl<R> {
+ // Constructor
+ explicit callback0_impl_t( Functor f ) : m_f( f ) {}
+
+ virtual R invoke() { return invoker<R>().invoke( m_f ); }
+
+private:
+ // Data members
+ Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename R = ut_detail::unused>
+class callback0 {
+public:
+ // Constructors
+ callback0() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+ callback0( callback0 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+ template<typename Functor>
+ callback0( Functor f )
+ : m_impl( new ut_detail::callback0_impl_t<R,Functor>( f ) ) {}
+
+ void operator=( callback0 const& rhs ) { m_impl = rhs.m_impl; }
+
+ template<typename Functor>
+ void operator=( Functor f ) { m_impl.reset( new ut_detail::callback0_impl_t<R,Functor>( f ) ); }
+
+ R operator()() const { return m_impl->invoke(); }
+
+ bool operator!() const { return !m_impl; }
+
+private:
+ // Data members
+ ndnboost::shared_ptr<ut_detail::callback0_impl<R> > m_impl;
+};
+
+// ************************************************************************** //
+// ************** unit_test::callback1 ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R, typename T1>
+struct callback1_impl {
+ virtual ~callback1_impl() {}
+
+ virtual R invoke( T1 t1 ) = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename T1,typename Functor>
+struct callback1_impl_t : callback1_impl<R,T1> {
+ // Constructor
+ explicit callback1_impl_t( Functor f ) : m_f( f ) {}
+
+ virtual R invoke( T1 t1 ) { return invoker<R>().invoke( m_f, t1 ); }
+
+private:
+ // Data members
+ Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename T1,typename R = ut_detail::unused>
+class callback1 {
+public:
+ // Constructors
+ callback1() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+ callback1( callback1 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+ template<typename Functor>
+ callback1( Functor f )
+ : m_impl( new ut_detail::callback1_impl_t<R,T1,Functor>( f ) ) {}
+
+ void operator=( callback1 const& rhs ) { m_impl = rhs.m_impl; }
+
+ template<typename Functor>
+ void operator=( Functor f ) { m_impl.reset( new ut_detail::callback1_impl_t<R,T1,Functor>( f ) ); }
+
+ R operator()( T1 t1 ) const { return m_impl->invoke( t1 ); }
+
+ bool operator!() const { return !m_impl; }
+
+private:
+ // Data members
+ ndnboost::shared_ptr<ut_detail::callback1_impl<R,T1> > m_impl;
+};
+
+// ************************************************************************** //
+// ************** unit_test::callback2 ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R, typename T1,typename T2>
+struct callback2_impl {
+ virtual ~callback2_impl() {}
+
+ virtual R invoke( T1 t1, T2 t2 ) = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename T1, typename T2, typename Functor>
+struct callback2_impl_t : callback2_impl<R,T1,T2> {
+ // Constructor
+ explicit callback2_impl_t( Functor f ) : m_f( f ) {}
+
+ virtual R invoke( T1 t1, T2 t2 ) { return invoker<R>().template invoke<Functor,T1,T2>( m_f, t1, t2 ); }
+
+private:
+ // Data members
+ Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename T1,typename T2, typename R = ut_detail::unused>
+class callback2 {
+public:
+ // Constructors
+ callback2() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+ callback2( callback2 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+ template<typename Functor>
+ callback2( Functor f ) : m_impl( new ut_detail::callback2_impl_t<R,T1,T2,Functor>( f ) ) {}
+
+ void operator=( callback2 const& rhs ) { m_impl = rhs.m_impl; }
+
+ template<typename Functor>
+ void operator=( Functor f ) { m_impl.reset( new ut_detail::callback2_impl_t<R,T1,T2,Functor>( f ) ); }
+
+ R operator()( T1 t1, T2 t2 ) const { return m_impl->invoke( t1, t2 ); }
+
+ bool operator!() const { return !m_impl; }
+
+private:
+ // Data members
+ ndnboost::shared_ptr<ut_detail::callback2_impl<R,T1,T2> > m_impl;
+};
+
+// ************************************************************************** //
+// ************** unit_test::callback3 ************** //
+// ************************************************************************** //
+
+namespace ut_detail {
+
+template<typename R, typename T1, typename T2, typename T3>
+struct callback3_impl {
+ virtual ~callback3_impl() {}
+
+ virtual R invoke( T1 t1, T2 t2, T3 t3 ) = 0;
+};
+
+//____________________________________________________________________________//
+
+template<typename R, typename T1, typename T2, typename T3, typename Functor>
+struct callback3_impl_t : callback3_impl<R,T1,T2,T3> {
+ // Constructor
+ explicit callback3_impl_t( Functor f ) : m_f( f ) {}
+
+ virtual R invoke( T1 t1, T2 t2, T3 t3 ) { return invoker<R>().invoke( m_f, t1, t2, t3 ); }
+
+private:
+ // Data members
+ Functor m_f;
+};
+
+//____________________________________________________________________________//
+
+} // namespace ut_detail
+
+template<typename T1,typename T2, typename T3, typename R = ut_detail::unused>
+class callback3 {
+public:
+ // Constructors
+ callback3() {}
+#ifdef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+ callback3( callback3 const& rhs ) : m_impl( rhs.m_impl ) {}
+#endif
+
+ template<typename Functor>
+ callback3( Functor f )
+ : m_impl( new ut_detail::callback3_impl_t<R,T1,T2,T3,Functor>( f ) ) {}
+
+ void operator=( callback3 const& rhs ) { m_impl = rhs.m_impl; }
+
+ template<typename Functor>
+ void operator=( Functor f ) { m_impl.reset( new ut_detail::callback3_impl_t<R,T1,T2,T3,Functor>( f ) ); }
+
+ R operator()( T1 t1, T2 t2, T3 t3 ) const { return m_impl->invoke( t1, t2, t3 ); }
+
+ bool operator!() const { return !m_impl; }
+
+private:
+ // Data members
+ ndnboost::shared_ptr<ut_detail::callback3_impl<R,T1,T2,T3> > m_impl;
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+#undef BOOST_CALLBACK_EXPLICIT_COPY_CONSTRUCTOR
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_CALLBACK_020505GER
diff --git a/ndnboost/test/utils/class_properties.hpp b/ndnboost/test/utils/class_properties.hpp
new file mode 100644
index 0000000..8da1f45
--- /dev/null
+++ b/ndnboost/test/utils/class_properties.hpp
@@ -0,0 +1,221 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : simple facility that mimmic notion of read-only read-write
+// properties in C++ classes. Original idea by Henrik Ravn.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
+#define BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// Boost
+#if !BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+#include <ndnboost/preprocessor/seq/for_each.hpp>
+#endif
+#include <ndnboost/call_traits.hpp>
+#include <ndnboost/type_traits/add_pointer.hpp>
+#include <ndnboost/type_traits/add_const.hpp>
+#include <ndnboost/utility/addressof.hpp>
+
+// STL
+#include <iosfwd>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** class_property ************** //
+// ************************************************************************** //
+
+template<class PropertyType>
+class class_property {
+protected:
+ typedef typename call_traits<PropertyType>::const_reference read_access_t;
+ typedef typename call_traits<PropertyType>::param_type write_param_t;
+ typedef typename add_pointer<typename add_const<PropertyType>::type>::type address_res_t;
+public:
+ // Constructor
+ class_property() : value( PropertyType() ) {}
+ explicit class_property( write_param_t init_value )
+ : value( init_value ) {}
+
+ // Access methods
+ operator read_access_t() const { return value; }
+ read_access_t get() const { return value; }
+ bool operator!() const { return !value; }
+ address_res_t operator&() const { return &value; }
+
+ // Data members
+#ifndef BOOST_TEST_NO_PROTECTED_USING
+protected:
+#endif
+ PropertyType value;
+};
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+
+template<class PropertyType>
+inline std::ostream&
+operator<<( std::ostream& os, class_property<PropertyType> const& p )
+
+#else
+
+template<typename CharT1, typename Tr,class PropertyType>
+inline std::basic_ostream<CharT1,Tr>&
+operator<<( std::basic_ostream<CharT1,Tr>& os, class_property<PropertyType> const& p )
+
+#endif
+{
+ return os << p.get();
+}
+
+//____________________________________________________________________________//
+
+#define DEFINE_PROPERTY_FREE_BINARY_OPERATOR( op ) \
+template<class PropertyType> \
+inline bool \
+operator op( PropertyType const& lhs, class_property<PropertyType> const& rhs ) \
+{ \
+ return lhs op rhs.get(); \
+} \
+template<class PropertyType> \
+inline bool \
+operator op( class_property<PropertyType> const& lhs, PropertyType const& rhs ) \
+{ \
+ return lhs.get() op rhs; \
+} \
+template<class PropertyType> \
+inline bool \
+operator op( class_property<PropertyType> const& lhs, \
+ class_property<PropertyType> const& rhs ) \
+{ \
+ return lhs.get() op rhs.get(); \
+} \
+/**/
+
+DEFINE_PROPERTY_FREE_BINARY_OPERATOR( == )
+DEFINE_PROPERTY_FREE_BINARY_OPERATOR( != )
+
+#undef DEFINE_PROPERTY_FREE_BINARY_OPERATOR
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
+
+#define DEFINE_PROPERTY_LOGICAL_OPERATOR( op ) \
+template<class PropertyType> \
+inline bool \
+operator op( bool b, class_property<PropertyType> const& p ) \
+{ \
+ return b op p.get(); \
+} \
+template<class PropertyType> \
+inline bool \
+operator op( class_property<PropertyType> const& p, bool b ) \
+{ \
+ return b op p.get(); \
+} \
+/**/
+
+DEFINE_PROPERTY_LOGICAL_OPERATOR( && )
+DEFINE_PROPERTY_LOGICAL_OPERATOR( || )
+
+#endif
+
+// ************************************************************************** //
+// ************** readonly_property ************** //
+// ************************************************************************** //
+
+template<class PropertyType>
+class readonly_property : public class_property<PropertyType> {
+ typedef class_property<PropertyType> base_prop;
+ typedef typename base_prop::address_res_t arrow_res_t;
+protected:
+ typedef typename base_prop::write_param_t write_param_t;
+public:
+ // Constructor
+ readonly_property() {}
+ explicit readonly_property( write_param_t init_value ) : base_prop( init_value ) {}
+
+ // access methods
+ arrow_res_t operator->() const { return ndnboost::addressof( base_prop::value ); }
+};
+
+//____________________________________________________________________________//
+
+#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600))
+
+#define BOOST_READONLY_PROPERTY( property_type, friends ) ndnboost::unit_test::readwrite_property<property_type >
+
+#else
+
+#define BOOST_READONLY_PROPERTY_DECLARE_FRIEND(r, data, elem) friend class elem;
+
+#define BOOST_READONLY_PROPERTY( property_type, friends ) \
+class BOOST_JOIN( readonly_property, __LINE__ ) \
+: public ndnboost::unit_test::readonly_property<property_type > { \
+ typedef ndnboost::unit_test::readonly_property<property_type > base_prop; \
+ BOOST_PP_SEQ_FOR_EACH( BOOST_READONLY_PROPERTY_DECLARE_FRIEND, ' ', friends ) \
+ typedef base_prop::write_param_t write_param_t; \
+public: \
+ BOOST_JOIN( readonly_property, __LINE__ )() {} \
+ explicit BOOST_JOIN( readonly_property, __LINE__ )( write_param_t init_v ) \
+ : base_prop( init_v ) {} \
+} \
+/**/
+
+#endif
+
+// ************************************************************************** //
+// ************** readwrite_property ************** //
+// ************************************************************************** //
+
+template<class PropertyType>
+class readwrite_property : public class_property<PropertyType> {
+ typedef class_property<PropertyType> base_prop;
+ typedef typename add_pointer<PropertyType>::type arrow_res_t;
+ typedef typename base_prop::address_res_t const_arrow_res_t;
+ typedef typename base_prop::write_param_t write_param_t;
+public:
+ readwrite_property() : base_prop() {}
+ explicit readwrite_property( write_param_t init_value ) : base_prop( init_value ) {}
+
+ // access methods
+ void set( write_param_t v ) { base_prop::value = v; }
+ arrow_res_t operator->() { return ndnboost::addressof( base_prop::value ); }
+ const_arrow_res_t operator->() const { return ndnboost::addressof( base_prop::value ); }
+
+#ifndef BOOST_TEST_NO_PROTECTED_USING
+ using base_prop::value;
+#endif
+};
+
+//____________________________________________________________________________//
+
+} // unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#undef BOOST_TEST_NO_PROTECTED_USING
+
+#endif // BOOST_TEST_CLASS_PROPERTIES_HPP_071894GER
diff --git a/ndnboost/test/utils/custom_manip.hpp b/ndnboost/test/utils/custom_manip.hpp
new file mode 100644
index 0000000..cf5d76d
--- /dev/null
+++ b/ndnboost/test/utils/custom_manip.hpp
@@ -0,0 +1,63 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : simple helpers for creating cusom output manipulators
+// ***************************************************************************
+
+#ifndef BOOST_TEST_CUSTOM_MANIP_HPP_071894GER
+#define BOOST_TEST_CUSTOM_MANIP_HPP_071894GER
+
+// STL
+#include <iosfwd>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** custom manipulators helpers ************** //
+// ************************************************************************** //
+
+template<typename Manip>
+struct custom_printer {
+ explicit custom_printer( std::ostream& ostr ) : m_ostr( &ostr ) {}
+
+ std::ostream& operator*() const { return *m_ostr; }
+
+private:
+ std::ostream* const m_ostr;
+};
+
+//____________________________________________________________________________//
+
+template<typename Uniq> struct custom_manip {};
+
+//____________________________________________________________________________//
+
+template<typename Uniq>
+inline custom_printer<custom_manip<Uniq> >
+operator<<( std::ostream& ostr, custom_manip<Uniq> const& ) { return custom_printer<custom_manip<Uniq> >( ostr ); }
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_CUSTOM_MANIP_HPP_071894GER
diff --git a/ndnboost/test/utils/fixed_mapping.hpp b/ndnboost/test/utils/fixed_mapping.hpp
new file mode 100644
index 0000000..dc08593
--- /dev/null
+++ b/ndnboost/test/utils/fixed_mapping.hpp
@@ -0,0 +1,124 @@
+// (C) Copyright Gennadiy Rozental 2001-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : fixed sized mapping with specified invalid value
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FIXED_MAPPING_HPP_071894GER
+#define BOOST_TEST_FIXED_MAPPING_HPP_071894GER
+
+// Boost
+#include <ndnboost/preprocessor/repetition/repeat.hpp>
+#include <ndnboost/preprocessor/arithmetic/add.hpp>
+#include <ndnboost/call_traits.hpp>
+#include <ndnboost/detail/binary_search.hpp>
+
+// STL
+#include <vector>
+#include <functional>
+#include <algorithm>
+#include <utility>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// configurable maximum fixed sized mapping size supported by this header.
+// You can redefine it before inclusion of this file.
+#ifndef MAX_MAP_SIZE
+#define MAX_MAP_SIZE 20
+#endif
+
+#define CONSTR_DECL_MID( z, i, dummy1 ) key_param_type key##i, value_param_type v##i,
+#define CONSTR_BODY_MID( z, i, dummy1 ) add_pair( key##i, v##i );
+
+#define CONSTR_DECL( z, n, dummy1 ) \
+ fixed_mapping( BOOST_PP_REPEAT_ ## z( n, CONSTR_DECL_MID, "" ) \
+ value_param_type invalid_value ) \
+ : m_invalid_value( invalid_value ) \
+ { \
+ BOOST_PP_REPEAT_ ## z( n, CONSTR_BODY_MID, "" ) \
+ init(); \
+ } \
+/**/
+
+#define CONTRUCTORS( n ) BOOST_PP_REPEAT( n, CONSTR_DECL, "" )
+
+template<typename Key, typename Value, typename Compare = std::less<Key> >
+class fixed_mapping
+{
+ typedef std::pair<Key,Value> elem_type;
+ typedef std::vector<elem_type> map_type;
+ typedef typename std::vector<elem_type>::const_iterator iterator;
+
+ typedef typename call_traits<Key>::param_type key_param_type;
+ typedef typename call_traits<Value>::param_type value_param_type;
+ typedef typename call_traits<Value>::const_reference value_ref_type;
+
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
+ struct p1; friend struct p1;
+ struct p2; friend struct p2;
+#endif
+
+ // bind( Compare(), bind(select1st<elem_type>(), _1), bind(identity<Key>(), _2) )
+ struct p1 : public std::binary_function<elem_type,Key,bool>
+ {
+ bool operator()( elem_type const& x, Key const& y ) const { return Compare()( x.first, y ); }
+ };
+
+ // bind( Compare(), bind(select1st<elem_type>(), _1), bind(select1st<elem_type>(), _2) )
+ struct p2 : public std::binary_function<elem_type,elem_type,bool>
+ {
+ bool operator()( elem_type const& x, elem_type const& y ) const { return Compare()( x.first, y.first ); }
+ };
+
+public:
+ // Constructors
+ CONTRUCTORS( BOOST_PP_ADD( MAX_MAP_SIZE, 1 ) )
+
+ // key -> value access
+ value_ref_type operator[]( key_param_type key ) const
+ {
+ iterator it = ndnboost::detail::lower_bound( m_map.begin(), m_map.end(), key, p1() );
+
+ return (it == m_map.end() || Compare()( key, it->first ) ) ? m_invalid_value : it->second;
+ }
+
+private:
+ // Implementation
+ void init() { std::sort( m_map.begin(), m_map.end(), p2() ); }
+ void add_pair( key_param_type key, value_param_type value ) { m_map.push_back( elem_type( key, value ) ); }
+
+ // Data members
+ Value m_invalid_value;
+ map_type m_map;
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#undef MAX_MAP_SIZE
+#undef CONSTR_DECL_MID
+#undef CONSTR_BODY_MID
+#undef CONSTR_DECL
+#undef CONTRUCTORS
+
+#endif // BOOST_TEST_FIXED_MAPPING_HPP_071894GER
+
diff --git a/ndnboost/test/utils/foreach.hpp b/ndnboost/test/utils/foreach.hpp
new file mode 100644
index 0000000..8404e72
--- /dev/null
+++ b/ndnboost/test/utils/foreach.hpp
@@ -0,0 +1,281 @@
+// (C) Copyright Eric Niebler 2004-2005
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : this is an abridged version of an excelent BOOST_FOREACH facility
+// presented by Eric Niebler. I am so fond of it so I can't wait till it
+// going to be accepted into Boost. Also I need version with less number of dependencies
+// and more portable. This version doesn't support rvalues and will reeveluate it's
+// parameters, but should be good enough for my purposes.
+// ***************************************************************************
+
+#ifndef BOOST_TEST_FOREACH_HPP_021005GER
+#define BOOST_TEST_FOREACH_HPP_021005GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// Boost
+#include <ndnboost/type.hpp>
+#include <ndnboost/mpl/bool.hpp>
+#include <ndnboost/test/detail/workaround.hpp>
+
+#include <ndnboost/type_traits/is_const.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+namespace for_each {
+
+// ************************************************************************** //
+// ************** static_any ************** //
+// ************************************************************************** //
+
+struct static_any_base
+{
+ operator bool() const { return false; }
+};
+
+//____________________________________________________________________________//
+
+template<typename Iter>
+struct static_any : static_any_base
+{
+ static_any( Iter const& t ) : m_it( t ) {}
+
+ mutable Iter m_it;
+};
+
+//____________________________________________________________________________//
+
+typedef static_any_base const& static_any_t;
+
+//____________________________________________________________________________//
+
+template<typename Iter>
+inline Iter&
+static_any_cast( static_any_t a, Iter* = 0 )
+{
+ return static_cast<Iter&>( static_cast<static_any<Iter> const&>( a ).m_it );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** is_const ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline is_const<C>
+is_const_coll( C& )
+{
+ return is_const<C>();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** begin ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
+begin( C& t, mpl::false_ )
+{
+ return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.begin() );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
+begin( C const& t, mpl::true_ )
+{
+ return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.begin() );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** end ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::iterator>
+end( C& t, mpl::false_ )
+{
+ return static_any<BOOST_DEDUCED_TYPENAME C::iterator>( t.end() );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>
+end( C const& t, mpl::true_ )
+{
+ return static_any<BOOST_DEDUCED_TYPENAME C::const_iterator>( t.end() );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** done ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline bool
+done( static_any_t cur, static_any_t end, C&, mpl::false_ )
+{
+ return static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur ) ==
+ static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( end );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline bool
+done( static_any_t cur, static_any_t end, C const&, mpl::true_ )
+{
+ return static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur ) ==
+ static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( end );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** next ************** //
+// ************************************************************************** //
+
+template<typename C>
+inline void
+next( static_any_t cur, C&, mpl::false_ )
+{
+ ++static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+template<typename C>
+inline void
+next( static_any_t cur, C const&, mpl::true_ )
+{
+ ++static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** deref ************** //
+// ************************************************************************** //
+
+template<class RefType,typename C>
+inline RefType
+deref( static_any_t cur, C&, ::ndnboost::type<RefType>, mpl::false_ )
+{
+ return *static_any_cast<BOOST_DEDUCED_TYPENAME C::iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+template<class RefType,typename C>
+inline RefType
+deref( static_any_t cur, C const&, ::ndnboost::type<RefType>, mpl::true_ )
+{
+ return *static_any_cast<BOOST_DEDUCED_TYPENAME C::const_iterator>( cur );
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** BOOST_TEST_FOREACH ************** //
+// ************************************************************************** //
+
+#define BOOST_TEST_FE_ANY ::ndnboost::unit_test::for_each::static_any_t
+#define BOOST_TEST_FE_IS_CONST( COL ) ::ndnboost::unit_test::for_each::is_const_coll( COL )
+
+#define BOOST_TEST_FE_BEG( COL ) \
+ ::ndnboost::unit_test::for_each::begin( \
+ COL, \
+ BOOST_TEST_FE_IS_CONST( COL ) ) \
+/**/
+
+#define BOOST_TEST_FE_END( COL ) \
+ ::ndnboost::unit_test::for_each::end( \
+ COL, \
+ BOOST_TEST_FE_IS_CONST( COL ) ) \
+/**/
+
+#define BOOST_TEST_FE_DONE( COL ) \
+ ::ndnboost::unit_test::for_each::done( \
+ BOOST_TEST_FE_CUR_VAR, \
+ BOOST_TEST_FE_END_VAR, \
+ COL, \
+ BOOST_TEST_FE_IS_CONST( COL ) ) \
+/**/
+
+#define BOOST_TEST_FE_NEXT( COL ) \
+ ::ndnboost::unit_test::for_each::next( \
+ BOOST_TEST_FE_CUR_VAR, \
+ COL, \
+ BOOST_TEST_FE_IS_CONST( COL ) ) \
+/**/
+
+#define BOOST_FOREACH_NOOP(COL) \
+ ((void)&(COL))
+
+#define BOOST_TEST_FE_DEREF( COL, RefType ) \
+ ::ndnboost::unit_test::for_each::deref( \
+ BOOST_TEST_FE_CUR_VAR, \
+ COL, \
+ ::ndnboost::type<RefType >(), \
+ BOOST_TEST_FE_IS_CONST( COL ) ) \
+/**/
+
+#if BOOST_WORKAROUND( BOOST_MSVC, == 1310 )
+#define BOOST_TEST_LINE_NUM
+#else
+#define BOOST_TEST_LINE_NUM __LINE__
+#endif
+
+#define BOOST_TEST_FE_CUR_VAR BOOST_JOIN( _fe_cur_, BOOST_TEST_LINE_NUM )
+#define BOOST_TEST_FE_END_VAR BOOST_JOIN( _fe_end_, BOOST_TEST_LINE_NUM )
+#define BOOST_TEST_FE_CON_VAR BOOST_JOIN( _fe_con_, BOOST_TEST_LINE_NUM )
+
+#define BOOST_TEST_FOREACH( RefType, var, COL ) \
+if( BOOST_TEST_FE_ANY BOOST_TEST_FE_CUR_VAR = BOOST_TEST_FE_BEG( COL ) ) {} else \
+if( BOOST_TEST_FE_ANY BOOST_TEST_FE_END_VAR = BOOST_TEST_FE_END( COL ) ) {} else \
+for( bool BOOST_TEST_FE_CON_VAR = true; \
+ BOOST_TEST_FE_CON_VAR && !BOOST_TEST_FE_DONE( COL ); \
+ BOOST_TEST_FE_CON_VAR ? BOOST_TEST_FE_NEXT( COL ) : BOOST_FOREACH_NOOP( COL )) \
+ \
+ if( (BOOST_TEST_FE_CON_VAR = false, false) ) {} else \
+ for( RefType var = BOOST_TEST_FE_DEREF( COL, RefType ); \
+ !BOOST_TEST_FE_CON_VAR; BOOST_TEST_FE_CON_VAR = true ) \
+/**/
+
+//____________________________________________________________________________//
+
+} // namespace for_each
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_FOREACH_HPP_021005GER
diff --git a/ndnboost/test/utils/iterator/input_iterator_facade.hpp b/ndnboost/test/utils/iterator/input_iterator_facade.hpp
new file mode 100644
index 0000000..92968ac
--- /dev/null
+++ b/ndnboost/test/utils/iterator/input_iterator_facade.hpp
@@ -0,0 +1,109 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : Input iterator facade
+// ***************************************************************************
+
+#ifndef BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER
+#define BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER
+
+// Boost
+#include <ndnboost/iterator/iterator_facade.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** input_iterator_core_access ************** //
+// ************************************************************************** //
+
+class input_iterator_core_access
+{
+#if defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
+public:
+#else
+ template <class I, class V, class R, class TC> friend class input_iterator_facade;
+#endif
+
+ template <class Facade>
+ static bool get( Facade& f )
+ {
+ return f.get();
+ }
+
+private:
+ // objects of this class are useless
+ input_iterator_core_access(); //undefined
+};
+
+// ************************************************************************** //
+// ************** input_iterator_facade ************** //
+// ************************************************************************** //
+
+template<typename Derived,
+ typename ValueType,
+ typename Reference = ValueType const&,
+ typename Traversal = single_pass_traversal_tag>
+class input_iterator_facade : public iterator_facade<Derived,ValueType,Traversal,Reference>
+{
+public:
+ // Constructor
+ input_iterator_facade() : m_valid( false ), m_value() {}
+
+protected: // provide access to the Derived
+ void init()
+ {
+ m_valid = true;
+ increment();
+ }
+
+ // Data members
+ mutable bool m_valid;
+ ValueType m_value;
+
+private:
+ friend class ndnboost::iterator_core_access;
+
+ // iterator facade interface implementation
+ void increment()
+ {
+ // we make post-end incrementation indefinetly safe
+ if( m_valid )
+ m_valid = input_iterator_core_access::get( *static_cast<Derived*>(this) );
+ }
+ Reference dereference() const
+ {
+ return m_value;
+ }
+
+ // iterator facade interface implementation
+ bool equal( input_iterator_facade const& rhs ) const
+ {
+ // two invalid iterator equals, inequal otherwise
+ return !m_valid && !rhs.m_valid;
+ }
+};
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_INPUT_ITERATOR_FACADE_HPP_071894GER
+
diff --git a/ndnboost/test/utils/iterator/token_iterator.hpp b/ndnboost/test/utils/iterator/token_iterator.hpp
new file mode 100644
index 0000000..c1b2dbc
--- /dev/null
+++ b/ndnboost/test/utils/iterator/token_iterator.hpp
@@ -0,0 +1,418 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : token iterator for string and range tokenization
+// ***************************************************************************
+
+#ifndef BOOST_TOKEN_ITERATOR_HPP_071894GER
+#define BOOST_TOKEN_ITERATOR_HPP_071894GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#include <ndnboost/iterator/iterator_categories.hpp>
+#include <ndnboost/iterator/iterator_traits.hpp>
+
+#include <ndnboost/test/utils/iterator/input_iterator_facade.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/named_params.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+
+// STL
+#include <iosfwd>
+#include <cctype>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std{ using ::ispunct; using ::isspace; }
+#endif
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** ti_delimeter_type ************** //
+// ************************************************************************** //
+
+enum ti_delimeter_type {
+ dt_char, // character is delimeter if it among explicit list of some characters
+ dt_ispunct, // character is delimeter if it satisfies ispunct functor
+ dt_isspace, // character is delimeter if it satisfies isspace functor
+ dt_none // no character is delimeter
+};
+
+namespace ut_detail {
+
+// ************************************************************************** //
+// ************** default_char_compare ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+class default_char_compare {
+public:
+ bool operator()( CharT c1, CharT c2 )
+ {
+#ifdef BOOST_CLASSIC_IOSTREAMS
+ return std::string_char_traits<CharT>::eq( c1, c2 );
+#else
+ return std::char_traits<CharT>::eq( c1, c2 );
+#endif
+ }
+};
+
+// ************************************************************************** //
+// ************** delim_policy ************** //
+// ************************************************************************** //
+
+template<typename CharT,typename CharCompare>
+class delim_policy {
+ typedef basic_cstring<CharT const> cstring;
+public:
+ // Constructor
+ explicit delim_policy( ti_delimeter_type t = dt_char, cstring d = cstring() )
+ : m_type( t )
+ {
+ set_delimeters( d );
+ }
+
+ void set_delimeters( ti_delimeter_type t ) { m_type = t; }
+ template<typename Src>
+ void set_delimeters( Src d )
+ {
+ nfp::optionally_assign( m_delimeters, d );
+
+ if( !m_delimeters.is_empty() )
+ m_type = dt_char;
+ }
+
+ bool operator()( CharT c )
+ {
+ switch( m_type ) {
+ case dt_char: {
+ BOOST_TEST_FOREACH( CharT, delim, m_delimeters )
+ if( CharCompare()( delim, c ) )
+ return true;
+
+ return false;
+ }
+ case dt_ispunct:
+ return (std::ispunct)( c ) != 0;
+ case dt_isspace:
+ return (std::isspace)( c ) != 0;
+ case dt_none:
+ return false;
+ }
+
+ return false;
+ }
+
+private:
+ // Data members
+ cstring m_delimeters;
+ ti_delimeter_type m_type;
+};
+
+// ************************************************************************** //
+// ************** token_assigner ************** //
+// ************************************************************************** //
+
+template<typename TraversalTag>
+struct token_assigner {
+#if BOOST_WORKAROUND( BOOST_DINKUMWARE_STDLIB, < 306 )
+ template<typename Iterator, typename C, typename T>
+ static void assign( Iterator b, Iterator e, std::basic_string<C,T>& t )
+ { for( ; b != e; ++b ) t += *b; }
+
+ template<typename Iterator, typename C>
+ static void assign( Iterator b, Iterator e, basic_cstring<C>& t ) { t.assign( b, e ); }
+#else
+ template<typename Iterator, typename Token>
+ static void assign( Iterator b, Iterator e, Token& t ) { t.assign( b, e ); }
+#endif
+ template<typename Iterator, typename Token>
+ static void append_move( Iterator& b, Token& ) { ++b; }
+};
+
+//____________________________________________________________________________//
+
+template<>
+struct token_assigner<single_pass_traversal_tag> {
+ template<typename Iterator, typename Token>
+ static void assign( Iterator b, Iterator e, Token& t ) {}
+
+ template<typename Iterator, typename Token>
+ static void append_move( Iterator& b, Token& t ) { t += *b; ++b; }
+};
+
+} // namespace ut_detail
+
+// ************************************************************************** //
+// ************** modifiers ************** //
+// ************************************************************************** //
+
+namespace {
+nfp::keyword<struct dropped_delimeters_t > dropped_delimeters;
+nfp::keyword<struct kept_delimeters_t > kept_delimeters;
+nfp::typed_keyword<bool,struct keep_empty_tokens_t > keep_empty_tokens;
+nfp::typed_keyword<std::size_t,struct max_tokens_t > max_tokens;
+}
+
+// ************************************************************************** //
+// ************** token_iterator_base ************** //
+// ************************************************************************** //
+
+template<typename Derived,
+ typename CharT,
+ typename CharCompare = ut_detail::default_char_compare<CharT>,
+ typename ValueType = basic_cstring<CharT const>,
+ typename Reference = basic_cstring<CharT const>,
+ typename Traversal = forward_traversal_tag>
+class token_iterator_base
+: public input_iterator_facade<Derived,ValueType,Reference,Traversal> {
+ typedef basic_cstring<CharT const> cstring;
+ typedef ut_detail::delim_policy<CharT,CharCompare> delim_policy;
+ typedef input_iterator_facade<Derived,ValueType,Reference,Traversal> base;
+
+protected:
+ // Constructor
+ explicit token_iterator_base()
+ : m_is_dropped( dt_isspace )
+ , m_is_kept( dt_ispunct )
+ , m_keep_empty_tokens( false )
+ , m_tokens_left( static_cast<std::size_t>(-1) )
+ , m_token_produced( false )
+ {
+ }
+
+ template<typename Modifier>
+ void
+ apply_modifier( Modifier const& m )
+ {
+ if( m.has( dropped_delimeters ) )
+ m_is_dropped.set_delimeters( m[dropped_delimeters] );
+
+ if( m.has( kept_delimeters ) )
+ m_is_kept.set_delimeters( m[kept_delimeters] );
+
+ if( m.has( keep_empty_tokens ) )
+ m_keep_empty_tokens = true;
+
+ nfp::optionally_assign( m_tokens_left, m, max_tokens );
+ }
+
+ template<typename Iter>
+ bool get( Iter& begin, Iter end )
+ {
+ typedef ut_detail::token_assigner<BOOST_DEDUCED_TYPENAME iterator_traversal<Iter>::type> Assigner;
+ Iter check_point;
+
+ this->m_value.clear();
+
+ if( !m_keep_empty_tokens ) {
+ while( begin != end && m_is_dropped( *begin ) )
+ ++begin;
+
+ if( begin == end )
+ return false;
+
+ check_point = begin;
+
+ if( m_tokens_left == 1 )
+ while( begin != end )
+ Assigner::append_move( begin, this->m_value );
+ else if( m_is_kept( *begin ) )
+ Assigner::append_move( begin, this->m_value );
+ else
+ while( begin != end && !m_is_dropped( *begin ) && !m_is_kept( *begin ) )
+ Assigner::append_move( begin, this->m_value );
+
+ --m_tokens_left;
+ }
+ else { // m_keep_empty_tokens is true
+ check_point = begin;
+
+ if( begin == end ) {
+ if( m_token_produced )
+ return false;
+
+ m_token_produced = true;
+ }
+ if( m_is_kept( *begin ) ) {
+ if( m_token_produced )
+ Assigner::append_move( begin, this->m_value );
+
+ m_token_produced = !m_token_produced;
+ }
+ else if( !m_token_produced && m_is_dropped( *begin ) )
+ m_token_produced = true;
+ else {
+ if( m_is_dropped( *begin ) )
+ check_point = ++begin;
+
+ while( begin != end && !m_is_dropped( *begin ) && !m_is_kept( *begin ) )
+ Assigner::append_move( begin, this->m_value );
+
+ m_token_produced = true;
+ }
+ }
+
+ Assigner::assign( check_point, begin, this->m_value );
+
+ return true;
+ }
+
+private:
+ // Data members
+ delim_policy m_is_dropped;
+ delim_policy m_is_kept;
+ bool m_keep_empty_tokens;
+ std::size_t m_tokens_left;
+ bool m_token_produced;
+};
+
+// ************************************************************************** //
+// ************** basic_string_token_iterator ************** //
+// ************************************************************************** //
+
+template<typename CharT,
+ typename CharCompare = ut_detail::default_char_compare<CharT> >
+class basic_string_token_iterator
+: public token_iterator_base<basic_string_token_iterator<CharT,CharCompare>,CharT,CharCompare> {
+ typedef basic_cstring<CharT const> cstring;
+ typedef token_iterator_base<basic_string_token_iterator<CharT,CharCompare>,CharT,CharCompare> base;
+public:
+ explicit basic_string_token_iterator() {}
+ explicit basic_string_token_iterator( cstring src )
+ : m_src( src )
+ {
+ this->init();
+ }
+
+ template<typename Src, typename Modifier>
+ basic_string_token_iterator( Src src, Modifier const& m )
+ : m_src( src )
+ {
+ this->apply_modifier( m );
+
+ this->init();
+ }
+
+private:
+ friend class input_iterator_core_access;
+
+ // input iterator implementation
+ bool get()
+ {
+ typename cstring::iterator begin = m_src.begin();
+ bool res = base::get( begin, m_src.end() );
+
+ m_src.assign( begin, m_src.end() );
+
+ return res;
+ }
+
+ // Data members
+ cstring m_src;
+};
+
+typedef basic_string_token_iterator<char> string_token_iterator;
+typedef basic_string_token_iterator<wchar_t> wstring_token_iterator;
+
+// ************************************************************************** //
+// ************** range_token_iterator ************** //
+// ************************************************************************** //
+
+template<typename Iter,
+ typename CharCompare = ut_detail::default_char_compare<BOOST_DEDUCED_TYPENAME iterator_value<Iter>::type>,
+ typename ValueType = std::basic_string<BOOST_DEDUCED_TYPENAME iterator_value<Iter>::type>,
+ typename Reference = ValueType const&>
+class range_token_iterator
+: public token_iterator_base<range_token_iterator<Iter,CharCompare,ValueType,Reference>,
+ typename iterator_value<Iter>::type,CharCompare,ValueType,Reference> {
+ typedef basic_cstring<typename ValueType::value_type> cstring;
+ typedef token_iterator_base<range_token_iterator<Iter,CharCompare,ValueType,Reference>,
+ typename iterator_value<Iter>::type,CharCompare,ValueType,Reference> base;
+public:
+ explicit range_token_iterator() {}
+ explicit range_token_iterator( Iter begin, Iter end = Iter() )
+ : m_begin( begin ), m_end( end )
+ {
+ this->init();
+ }
+ range_token_iterator( range_token_iterator const& rhs )
+ : base( rhs )
+ {
+ if( this->m_valid ) {
+ m_begin = rhs.m_begin;
+ m_end = rhs.m_end;
+ }
+ }
+
+ template<typename Modifier>
+ range_token_iterator( Iter begin, Iter end, Modifier const& m )
+ : m_begin( begin ), m_end( end )
+ {
+ this->apply_modifier( m );
+
+ this->init();
+ }
+
+private:
+ friend class input_iterator_core_access;
+
+ // input iterator implementation
+ bool get()
+ {
+ return base::get( m_begin, m_end );
+ }
+
+ // Data members
+ Iter m_begin;
+ Iter m_end;
+};
+
+// ************************************************************************** //
+// ************** make_range_token_iterator ************** //
+// ************************************************************************** //
+
+template<typename Iter>
+inline range_token_iterator<Iter>
+make_range_token_iterator( Iter begin, Iter end = Iter() )
+{
+ return range_token_iterator<Iter>( begin, end );
+}
+
+//____________________________________________________________________________//
+
+template<typename Iter,typename Modifier>
+inline range_token_iterator<Iter>
+make_range_token_iterator( Iter begin, Iter end, Modifier const& m )
+{
+ return range_token_iterator<Iter>( begin, end, m );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TOKEN_ITERATOR_HPP_071894GER
+
diff --git a/ndnboost/test/utils/lazy_ostream.hpp b/ndnboost/test/utils/lazy_ostream.hpp
new file mode 100644
index 0000000..4b9a0a3
--- /dev/null
+++ b/ndnboost/test/utils/lazy_ostream.hpp
@@ -0,0 +1,114 @@
+// (C) Copyright Gennadiy Rozental 2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : contains definition for all test tools in test toolbox
+// ***************************************************************************
+
+#ifndef BOOST_TEST_LAZY_OSTREAM_HPP_070708GER
+#define BOOST_TEST_LAZY_OSTREAM_HPP_070708GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// STL
+#include <iosfwd>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** lazy_ostream ************** //
+// ************************************************************************** //
+
+namespace ndnboost {
+
+namespace unit_test {
+
+class lazy_ostream {
+public:
+ static lazy_ostream& instance() { static lazy_ostream inst; return inst; }
+
+ friend std::ostream& operator<<( std::ostream& ostr, lazy_ostream const& o ) { return o( ostr ); }
+
+ // access method
+ bool empty() const { return m_empty; }
+
+ // actual printing interface; to be accessed only by this class and children
+ virtual std::ostream& operator()( std::ostream& ostr ) const { return ostr; }
+protected:
+ explicit lazy_ostream( bool empty = true ) : m_empty( empty ) {}
+
+ // protected destructor to make sure right one is called
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+public:
+#endif
+ BOOST_TEST_PROTECTED_VIRTUAL ~lazy_ostream() {}
+
+private:
+ // Data members
+ bool m_empty;
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+class lazy_ostream_impl : public lazy_ostream {
+public:
+ lazy_ostream_impl( lazy_ostream const& prev, T value )
+ : lazy_ostream( false )
+ , m_prev( prev )
+ , m_value( value )
+ {}
+private:
+ virtual std::ostream& operator()( std::ostream& ostr ) const
+ {
+ return m_prev(ostr) << m_value;
+ }
+
+ // Data members
+ lazy_ostream const& m_prev;
+ T m_value;
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline lazy_ostream_impl<T const&>
+operator<<( lazy_ostream const& prev, T const& v )
+{
+ return lazy_ostream_impl<T const&>( prev, v );
+}
+
+//____________________________________________________________________________//
+
+#if BOOST_TEST_USE_STD_LOCALE
+
+template<typename R,typename S>
+inline lazy_ostream_impl<R& (BOOST_TEST_CALL_DECL *)(S&)>
+operator<<( lazy_ostream const& prev, R& (BOOST_TEST_CALL_DECL *man)(S&) )
+{
+ return lazy_ostream_impl<R& (BOOST_TEST_CALL_DECL *)(S&)>( prev, man );
+}
+
+//____________________________________________________________________________//
+
+#endif
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_LAZY_OSTREAM_HPP_070708GER
diff --git a/ndnboost/test/utils/named_params.hpp b/ndnboost/test/utils/named_params.hpp
new file mode 100644
index 0000000..371d594
--- /dev/null
+++ b/ndnboost/test/utils/named_params.hpp
@@ -0,0 +1,329 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : facilities for named function parameters support
+// ***************************************************************************
+
+#ifndef BOOST_TEST_NAMED_PARAM_022505GER
+#define BOOST_TEST_NAMED_PARAM_022505GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+#include <ndnboost/test/utils/assign_op.hpp>
+
+#include <ndnboost/type_traits/remove_reference.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace nfp { // named function parameters
+
+// ************************************************************************** //
+// ************** forward declarations ************** //
+// ************************************************************************** //
+
+template<typename T, typename unique_id,typename RefType> struct named_parameter;
+template<typename unique_id,bool required> struct keyword;
+
+namespace nfp_detail {
+
+template<typename NP1,typename NP2> struct named_parameter_combine;
+
+// ************************************************************************** //
+// ************** access_to_invalid_parameter ************** //
+// ************************************************************************** //
+
+struct access_to_invalid_parameter {};
+
+//____________________________________________________________________________//
+
+inline void
+report_access_to_invalid_parameter()
+{
+ throw access_to_invalid_parameter();
+}
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** nil ************** //
+// ************************************************************************** //
+
+struct nil {
+ template<typename T>
+#if defined(__GNUC__) || defined(__HP_aCC) || defined(__EDG__) || defined(__SUNPRO_CC)
+ operator T() const
+#else
+ operator T const&() const
+#endif
+ { report_access_to_invalid_parameter(); static T* v = 0; return *v; }
+
+ template<typename T>
+ T any_cast() const
+ { report_access_to_invalid_parameter(); static typename remove_reference<T>::type* v = 0; return *v; }
+
+ template<typename Arg1>
+ nil operator()( Arg1 const& )
+ { report_access_to_invalid_parameter(); return nil(); }
+
+ template<typename Arg1,typename Arg2>
+ nil operator()( Arg1 const&, Arg2 const& )
+ { report_access_to_invalid_parameter(); return nil(); }
+
+ template<typename Arg1,typename Arg2,typename Arg3>
+ nil operator()( Arg1 const&, Arg2 const&, Arg3 const& )
+ { report_access_to_invalid_parameter(); return nil(); }
+
+ // Visitation support
+ template<typename Visitor>
+ void apply_to( Visitor& V ) const {}
+
+ static nil& inst() { static nil s_inst; return s_inst; }
+private:
+ nil() {}
+};
+
+// ************************************************************************** //
+// ************** named_parameter_base ************** //
+// ************************************************************************** //
+
+template<typename Derived>
+struct named_parameter_base {
+ template<typename NP>
+ named_parameter_combine<NP,Derived>
+ operator,( NP const& np ) const { return named_parameter_combine<NP,Derived>( np, *static_cast<Derived const*>(this) ); }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** named_parameter_combine ************** //
+// ************************************************************************** //
+
+template<typename NP, typename Rest = nil>
+struct named_parameter_combine
+: Rest
+, named_parameter_base<named_parameter_combine<NP,Rest> > {
+ typedef typename NP::ref_type res_type;
+ typedef named_parameter_combine<NP,Rest> self_type;
+
+ // Constructor
+ named_parameter_combine( NP const& np, Rest const& r )
+ : Rest( r )
+ , m_param( np )
+ {}
+
+ // Access methods
+ res_type operator[]( keyword<typename NP::id,true> kw ) const { return m_param[kw]; }
+ res_type operator[]( keyword<typename NP::id,false> kw ) const { return m_param[kw]; }
+ using Rest::operator[];
+
+ bool has( keyword<typename NP::id,false> kw ) const { return m_param.has( kw ); }
+ using Rest::has;
+
+ void erase( keyword<typename NP::id,false> kw ) const { m_param.erase( kw ); }
+ using Rest::erase;
+
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) || \
+ BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0610))
+ template<typename NP>
+ named_parameter_combine<NP,self_type> operator,( NP const& np ) const
+ { return named_parameter_combine<NP,self_type>( np, *this ); }
+#else
+ using named_parameter_base<named_parameter_combine<NP,Rest> >::operator,;
+#endif
+
+ // Visitation support
+ template<typename Visitor>
+ void apply_to( Visitor& V ) const
+ {
+ m_param.apply_to( V );
+
+ Rest::apply_to( V );
+ }
+private:
+ // Data members
+ NP m_param;
+};
+
+} // namespace nfp_detail
+
+// ************************************************************************** //
+// ************** named_parameter ************** //
+// ************************************************************************** //
+
+template<typename T, typename unique_id,typename ReferenceType=T&>
+struct named_parameter
+: nfp_detail::named_parameter_base<named_parameter<T, unique_id,ReferenceType> >
+{
+ typedef nfp_detail::nil nil_t;
+ typedef T data_type;
+ typedef ReferenceType ref_type;
+ typedef unique_id id;
+
+ // Constructor
+ explicit named_parameter( ref_type v )
+ : m_value( v )
+ , m_erased( false )
+ {}
+ named_parameter( named_parameter const& np )
+ : m_value( np.m_value )
+ , m_erased( np.m_erased )
+ {}
+
+ // Access methods
+ ref_type operator[]( keyword<unique_id,true> ) const { return m_erased ? nil_t::inst().template any_cast<ref_type>() : m_value; }
+ ref_type operator[]( keyword<unique_id,false> ) const { return m_erased ? nil_t::inst().template any_cast<ref_type>() : m_value; }
+ template<typename UnknownId>
+ nil_t operator[]( keyword<UnknownId,false> ) const { return nil_t::inst(); }
+
+ bool has( keyword<unique_id,false> ) const { return !m_erased; }
+ template<typename UnknownId>
+ bool has( keyword<UnknownId,false> ) const { return false; }
+
+ void erase( keyword<unique_id,false> ) const { m_erased = true; }
+ template<typename UnknownId>
+ void erase( keyword<UnknownId,false> ) const {}
+
+ // Visitation support
+ template<typename Visitor>
+ void apply_to( Visitor& V ) const
+ {
+ V.set_parameter( rtti::type_id<unique_id>(), m_value );
+ }
+
+private:
+ // Data members
+ ref_type m_value;
+ mutable bool m_erased;
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** no_params ************** //
+// ************************************************************************** //
+
+namespace nfp_detail {
+typedef named_parameter<char, struct no_params_type_t,char> no_params_type;
+} // namespace nfp_detail
+
+namespace {
+nfp_detail::no_params_type no_params( '\0' );
+} // local namespace
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** keyword ************** //
+// ************************************************************************** //
+
+template<typename unique_id, bool required = false>
+struct keyword {
+ typedef unique_id id;
+
+ template<typename T>
+ named_parameter<T const,unique_id>
+ operator=( T const& t ) const { return named_parameter<T const,unique_id>( t ); }
+
+ template<typename T>
+ named_parameter<T,unique_id>
+ operator=( T& t ) const { return named_parameter<T,unique_id>( t ); }
+
+ named_parameter<char const*,unique_id,char const*>
+ operator=( char const* t ) const { return named_parameter<char const*,unique_id,char const*>( t ); }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** typed_keyword ************** //
+// ************************************************************************** //
+
+template<typename T, typename unique_id, bool required = false>
+struct typed_keyword : keyword<unique_id,required> {
+ named_parameter<T const,unique_id>
+ operator=( T const& t ) const { return named_parameter<T const,unique_id>( t ); }
+
+ named_parameter<T,unique_id>
+ operator=( T& t ) const { return named_parameter<T,unique_id>( t ); }
+};
+
+//____________________________________________________________________________//
+
+template<typename unique_id>
+struct typed_keyword<bool,unique_id,false>
+: keyword<unique_id,false>
+, named_parameter<bool,unique_id,bool> {
+ typedef unique_id id;
+
+ typed_keyword() : named_parameter<bool,unique_id,bool>( true ) {}
+
+ named_parameter<bool,unique_id,bool>
+ operator!() const { return named_parameter<bool,unique_id,bool>( false ); }
+};
+
+//____________________________________________________________________________//
+
+// ************************************************************************** //
+// ************** optionally_assign ************** //
+// ************************************************************************** //
+
+template<typename T>
+inline void
+optionally_assign( T&, nfp_detail::nil )
+{
+ nfp_detail::report_access_to_invalid_parameter();
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename Source>
+inline void
+#if BOOST_WORKAROUND( __MWERKS__, BOOST_TESTED_AT( 0x3003 ) ) \
+ || BOOST_WORKAROUND( __DECCXX_VER, BOOST_TESTED_AT(60590042) )
+optionally_assign( T& target, Source src )
+#else
+optionally_assign( T& target, Source const& src )
+#endif
+{
+ using namespace unit_test;
+
+ assign_op( target, src, static_cast<int>(0) );
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename Params, typename Keyword>
+inline void
+optionally_assign( T& target, Params const& p, Keyword k )
+{
+ if( p.has(k) )
+ optionally_assign( target, p[k] );
+}
+
+//____________________________________________________________________________//
+
+} // namespace nfp
+
+} // namespace ndnboost
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_NAMED_PARAM_022505GER
+
diff --git a/ndnboost/test/utils/rtti.hpp b/ndnboost/test/utils/rtti.hpp
new file mode 100644
index 0000000..2413106
--- /dev/null
+++ b/ndnboost/test/utils/rtti.hpp
@@ -0,0 +1,64 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : simple facilities for accessing type information at runtime
+// ***************************************************************************
+
+#ifndef BOOST_TEST_RTTI_HPP_062604GER
+#define BOOST_TEST_RTTI_HPP_062604GER
+
+#include <cstddef>
+
+namespace ndnboost {
+
+namespace rtti {
+
+// ************************************************************************** //
+// ************** rtti::type_id ************** //
+// ************************************************************************** //
+
+typedef std::ptrdiff_t id_t;
+
+namespace rtti_detail {
+
+template<typename T>
+struct rttid_holder {
+ static id_t id() { return reinterpret_cast<id_t>( &inst() ); }
+
+private:
+ struct rttid {};
+
+ static rttid const& inst() { static rttid s_inst; return s_inst; }
+};
+
+} // namespace rtti_detail
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline id_t
+type_id()
+{
+ return rtti_detail::rttid_holder<T>::id();
+}
+
+//____________________________________________________________________________//
+
+#define BOOST_RTTI_SWITCH( type_id_ ) if( ::ndnboost::rtti::id_t switch_by_id = type_id_ )
+#define BOOST_RTTI_CASE( type ) if( switch_by_id == ::ndnboost::rtti::type_id<type>() )
+
+//____________________________________________________________________________//
+
+} // namespace rtti
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_RTTI_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/argument.hpp b/ndnboost/test/utils/runtime/argument.hpp
new file mode 100644
index 0000000..c14956c
--- /dev/null
+++ b/ndnboost/test/utils/runtime/argument.hpp
@@ -0,0 +1,112 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : model of actual argument (both typed and abstract interface)
+// ***************************************************************************
+
+#ifndef BOOST_RT_ARGUMENT_HPP_062604GER
+#define BOOST_RT_ARGUMENT_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/rtti.hpp>
+
+// STL
+#include <cassert>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// ************** runtime::argument ************** //
+// ************************************************************************** //
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4244)
+#endif
+
+class argument {
+public:
+ // Constructor
+ argument( parameter const& p, rtti::id_t value_type )
+ : p_formal_parameter( p )
+ , p_value_type( value_type )
+ {}
+
+ // Destructor
+ virtual ~argument() {}
+
+ // Public properties
+ unit_test::readonly_property<parameter const&> p_formal_parameter;
+ unit_test::readonly_property<rtti::id_t> p_value_type;
+};
+
+// ************************************************************************** //
+// ************** runtime::typed_argument ************** //
+// ************************************************************************** //
+
+template<typename T>
+class typed_argument : public argument {
+public:
+ // Constructor
+ explicit typed_argument( parameter const& p )
+ : argument( p, rtti::type_id<T>() )
+ {}
+ typed_argument( parameter const& p, T const& t )
+ : argument( p, rtti::type_id<T>() )
+ , p_value( t )
+ {}
+
+ unit_test::readwrite_property<T> p_value;
+};
+
+// ************************************************************************** //
+// ************** runtime::arg_value ************** //
+// ************************************************************************** //
+
+template<typename T>
+inline T const&
+arg_value( argument const& arg_ )
+{
+ assert( arg_.p_value_type == rtti::type_id<T>() ); // detect logic error
+
+ return static_cast<typed_argument<T> const&>( arg_ ).p_value.value;
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline T&
+arg_value( argument& arg_ )
+{
+ assert( arg_.p_value_type == rtti::type_id<T>() ); // detect logic error
+
+ return static_cast<typed_argument<T>&>( arg_ ).p_value.value;
+}
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ARGUMENT_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/argument_factory.hpp b/ndnboost/test/utils/runtime/cla/argument_factory.hpp
new file mode 100644
index 0000000..4f6709b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/argument_factory.hpp
@@ -0,0 +1,218 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : generic typed_argument_factory implementation
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER
+#define BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+#include <ndnboost/test/utils/runtime/trace.hpp>
+#include <ndnboost/test/utils/runtime/interpret_argument_value.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/value_generator.hpp>
+#include <ndnboost/test/utils/runtime/cla/value_handler.hpp>
+#include <ndnboost/test/utils/runtime/cla/validation.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+#include <ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/callback.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** default_value_interpreter ************** //
+// ************************************************************************** //
+
+namespace rt_cla_detail {
+
+struct default_value_interpreter {
+ template<typename T>
+ void operator()( argv_traverser& tr, ndnboost::optional<T>& value )
+ {
+ if( interpret_argument_value( tr.token(), value, 0 ) )
+ tr.next_token();
+ }
+};
+
+} // namespace rt_cla_detail
+
+// ************************************************************************** //
+// ************** typed_argument_factory ************** //
+// ************************************************************************** //
+
+template<typename T>
+struct typed_argument_factory : public argument_factory {
+ // Constructor
+ typed_argument_factory()
+ : m_value_interpreter( rt_cla_detail::default_value_interpreter() )
+ {}
+ BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~typed_argument_factory() {}
+
+ // properties modification
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ optionally_assign( m_value_handler, m, handler );
+ optionally_assign( m_value_interpreter, m, interpreter );
+
+ if( m.has( default_value ) ) {
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator,
+ BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) );
+
+ T const& dv_ref = m[default_value];
+ m_value_generator = rt_cla_detail::const_generator<T>( dv_ref );
+ }
+
+ if( m.has( default_refer_to ) ) {
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_generator,
+ BOOST_RT_PARAM_LITERAL( "multiple value generators for parameter" ) );
+
+ cstring ref_id = m[default_refer_to];
+ m_value_generator = rt_cla_detail::ref_generator<T>( ref_id );
+ }
+
+ if( m.has( assign_to ) ) {
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !m_value_handler,
+ BOOST_RT_PARAM_LITERAL( "multiple value handlers for parameter" ) );
+
+ m_value_handler = rt_cla_detail::assigner<T>( m[assign_to] );
+ }
+ }
+
+ // Argument factory implementation
+ virtual argument_ptr produce_using( parameter& p, argv_traverser& tr );
+ virtual argument_ptr produce_using( parameter& p, parser const& );
+ virtual void argument_usage_info( format_stream& fs );
+
+// !! private?
+ // Data members
+ unit_test::callback2<parameter const&,T&> m_value_handler;
+ unit_test::callback2<parser const&,ndnboost::optional<T>&> m_value_generator;
+ unit_test::callback2<argv_traverser&,ndnboost::optional<T>&> m_value_interpreter;
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline argument_ptr
+typed_argument_factory<T>::produce_using( parameter& p, argv_traverser& tr )
+{
+ ndnboost::optional<T> value;
+
+ try {
+ m_value_interpreter( tr, value );
+ }
+ catch( ... ) { // !! should we do that?
+ BOOST_RT_PARAM_TRACE( "Fail to parse argument value" );
+
+ if( !p.p_optional_value )
+ throw;
+ }
+
+ argument_ptr actual_arg = p.actual_argument();
+
+ BOOST_RT_CLA_VALIDATE_INPUT( !!value || p.p_optional_value, tr,
+ BOOST_RT_PARAM_LITERAL( "Argument value missing for parameter " ) << p.id_2_report() );
+
+ BOOST_RT_CLA_VALIDATE_INPUT( !actual_arg || p.p_multiplicable, tr,
+ BOOST_RT_PARAM_LITERAL( "Unexpected repetition of the parameter " ) << p.id_2_report() );
+
+ if( !!value && !!m_value_handler )
+ m_value_handler( p, *value );
+
+ if( !p.p_multiplicable )
+ actual_arg.reset( p.p_optional_value && (rtti::type_id<T>() != rtti::type_id<bool>())
+ ? static_cast<argument*>(new typed_argument<ndnboost::optional<T> >( p, value ))
+ : static_cast<argument*>(new typed_argument<T>( p, *value )) );
+ else {
+ typedef std::list<ndnboost::optional<T> > optional_list;
+
+ if( !actual_arg )
+ actual_arg.reset( p.p_optional_value
+ ? static_cast<argument*>(new typed_argument<optional_list>( p ))
+ : static_cast<argument*>(new typed_argument<std::list<T> >( p )) );
+
+ if( p.p_optional_value ) {
+ optional_list& values = arg_value<optional_list>( *actual_arg );
+
+ values.push_back( value );
+ }
+ else {
+ std::list<T>& values = arg_value<std::list<T> >( *actual_arg );
+
+ values.push_back( *value );
+ }
+ }
+
+ return actual_arg;
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline argument_ptr
+typed_argument_factory<T>::produce_using( parameter& p, parser const& pa )
+{
+ argument_ptr actual_arg;
+
+ if( !m_value_generator )
+ return actual_arg;
+
+ ndnboost::optional<T> value;
+ m_value_generator( pa, value );
+
+ if( !value )
+ return actual_arg;
+
+ if( !!m_value_handler )
+ m_value_handler( p, *value );
+
+ actual_arg.reset( new typed_argument<T>( p, *value ) );
+
+ return actual_arg;
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline void
+typed_argument_factory<T>::argument_usage_info( format_stream& fs )
+{
+ rt_cla_detail::argument_value_usage( fs, 0, reinterpret_cast<T*>(0) );
+}
+
+//____________________________________________________________________________//
+
+} // namespace ndnboost
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace cla
+
+#endif // BOOST_RT_CLA_ARGUMENT_FACTORY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/argv_traverser.hpp b/ndnboost/test/utils/runtime/cla/argv_traverser.hpp
new file mode 100644
index 0000000..8674bd2
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/argv_traverser.hpp
@@ -0,0 +1,98 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : defines facility to hide input traversing details
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER
+#define BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+
+// Boost
+#include <ndnboost/noncopyable.hpp>
+#include <ndnboost/shared_array.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::argv_traverser ************** //
+// ************************************************************************** //
+
+class argv_traverser : noncopyable {
+ class parser;
+public:
+ // Constructor
+ argv_traverser();
+
+ // public_properties
+ unit_test::readwrite_property<bool> p_ignore_mismatch;
+ unit_test::readwrite_property<char_type> p_separator;
+
+ // argc+argv <-> internal buffer exchange
+ void init( int argc, char_type** argv );
+ void remainder( int& argc, char_type** argv );
+
+ // token based parsing
+ cstring token() const;
+ void next_token();
+
+ // whole input parsing
+ cstring input() const;
+ void trim( std::size_t size );
+ bool match_front( cstring );
+ bool match_front( char_type c );
+ bool eoi() const;
+
+ // transaction logic support
+ void commit();
+ void rollback();
+
+ // current position access; used to save some reference points in input
+ std::size_t input_pos() const;
+
+ // returns true if mismatch detected during input parsing handled successfully
+ bool handle_mismatch();
+
+private:
+ // Data members
+ dstring m_buffer;
+ cstring m_work_buffer;
+
+ cstring m_token;
+ cstring::iterator m_commited_end;
+
+ shared_array<char_type> m_remainder;
+ std::size_t m_remainder_size;
+};
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/argv_traverser.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_ARGV_TRAVERSER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/argv_traverser.ipp b/ndnboost/test/utils/runtime/cla/argv_traverser.ipp
new file mode 100644
index 0000000..da03cd9
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/argv_traverser.ipp
@@ -0,0 +1,209 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : implements facility to hide input traversing details
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER
+#define BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/trace.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+// STL
+#include <memory>
+#include <cstring>
+
+#ifdef BOOST_NO_STDC_NAMESPACE
+namespace std { using ::memcpy; }
+#endif
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::argv_traverser ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+argv_traverser::argv_traverser()
+: p_ignore_mismatch( false ), p_separator( BOOST_RT_PARAM_LITERAL( ' ' ) )
+{
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::init( int argc, char_type** argv )
+{
+ for( int index = 1; index < argc; ++index ) {
+ m_buffer += argv[index];
+ if( index != argc-1 )
+ m_buffer += BOOST_RT_PARAM_LITERAL( ' ' );
+ }
+
+ m_remainder.reset( new char_type[m_buffer.size()+1] );
+ m_remainder_size = 0;
+ m_work_buffer = m_buffer;
+ m_commited_end = m_work_buffer.begin();
+
+ BOOST_RT_PARAM_TRACE( "Input buffer: " << m_buffer );
+
+ next_token();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::remainder( int& argc, char_type** argv )
+{
+ argc = 1;
+ std::size_t pos = 0;
+ while(pos < m_remainder_size ) {
+ argv[argc++] = m_remainder.get() + pos;
+
+ pos = std::find( m_remainder.get() + pos, m_remainder.get() + m_remainder_size,
+ BOOST_RT_PARAM_LITERAL( ' ' ) ) - m_remainder.get();
+ m_remainder[pos++] = BOOST_RT_PARAM_LITERAL( '\0' );
+ }
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE cstring
+argv_traverser::token() const
+{
+ return m_token;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::next_token()
+{
+ if( m_work_buffer.is_empty() )
+ return;
+
+ m_work_buffer.trim_left( m_token.size() ); // skip remainder of current token
+
+ if( m_work_buffer.size() != m_buffer.size() ) // !! is there a better way to identify first token
+ m_work_buffer.trim_left( 1 ); // skip separator if not first token;
+
+ m_token.assign( m_work_buffer.begin(),
+ std::find( m_work_buffer.begin(), m_work_buffer.end(), p_separator ) );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE cstring
+argv_traverser::input() const
+{
+ return m_work_buffer;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::trim( std::size_t size )
+{
+ m_work_buffer.trim_left( size );
+
+ if( size <= m_token.size() )
+ m_token.trim_left( size );
+ else {
+ m_token.assign( m_work_buffer.begin(),
+ std::find( m_work_buffer.begin(), m_work_buffer.end(), p_separator ) );
+ }
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::match_front( cstring str )
+{
+ return m_work_buffer.size() < str.size() ? false : m_work_buffer.substr( 0, str.size() ) == str;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::match_front( char_type c )
+{
+ return first_char( m_work_buffer ) == c;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::eoi() const
+{
+ return m_work_buffer.is_empty();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::commit()
+{
+ m_commited_end = m_work_buffer.begin();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+argv_traverser::rollback()
+{
+ m_work_buffer.assign( m_commited_end, m_work_buffer.end() );
+ m_token.assign( m_work_buffer.begin(),
+ std::find( m_work_buffer.begin(), m_work_buffer.end(), p_separator ) );
+
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE std::size_t
+argv_traverser::input_pos() const
+{
+ return m_work_buffer.begin() - m_commited_end;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+argv_traverser::handle_mismatch()
+{
+ if( !p_ignore_mismatch )
+ return false;
+
+ std::memcpy( m_remainder.get() + m_remainder_size, token().begin(), token().size() );
+ m_remainder_size += token().size();
+ m_remainder[m_remainder_size++] = p_separator;
+
+ next_token();
+ commit();
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_ARGV_TRAVERSER_IPP_070604GER
diff --git a/ndnboost/test/utils/runtime/cla/basic_parameter.hpp b/ndnboost/test/utils/runtime/cla/basic_parameter.hpp
new file mode 100644
index 0000000..39ebb72
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/basic_parameter.hpp
@@ -0,0 +1,85 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : generic custom parameter generator
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/typed_parameter.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+
+// Boost
+#include <ndnboost/utility/base_from_member.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::basic_parameter ************** //
+// ************************************************************************** //
+
+template<typename T, typename IdPolicy>
+class basic_parameter : private base_from_member<IdPolicy>, public typed_parameter<T> {
+public:
+ // Constructors
+ explicit basic_parameter( cstring n )
+ : base_from_member<IdPolicy>()
+ , typed_parameter<T>( base_from_member<IdPolicy>::member )
+ {
+ this->accept_modifier( name = n );
+ }
+
+ // parameter properties modification
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ typed_parameter<T>::accept_modifier( m );
+
+ base_from_member<IdPolicy>::member.accept_modifier( m );
+ }
+};
+
+//____________________________________________________________________________//
+
+#define BOOST_RT_CLA_NAMED_PARAM_GENERATORS( param_type ) \
+template<typename T> \
+inline shared_ptr<param_type ## _t<T> > \
+param_type( cstring name = cstring() ) \
+{ \
+ return shared_ptr<param_type ## _t<T> >( new param_type ## _t<T>( name ) ); \
+} \
+ \
+inline shared_ptr<param_type ## _t<cstring> > \
+param_type( cstring name = cstring() ) \
+{ \
+ return shared_ptr<param_type ## _t<cstring> >( new param_type ## _t<cstring>( name ) ); \
+} \
+/**/
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_BASIC_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/char_parameter.hpp b/ndnboost/test/utils/runtime/cla/char_parameter.hpp
new file mode 100644
index 0000000..d95b95b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/char_parameter.hpp
@@ -0,0 +1,98 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines model of parameter with single char name
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/basic_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/id_policy.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** char_name_policy ************** //
+// ************************************************************************** //
+
+class char_name_policy : public basic_naming_policy {
+public:
+ // Constructor
+ char_name_policy();
+ BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~char_name_policy() {}
+
+ // policy interface
+ virtual bool conflict_with( identification_policy const& ) const;
+
+ // Accept modifier
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ basic_naming_policy::accept_modifier( m );
+
+ BOOST_RT_PARAM_VALIDATE_LOGIC( p_name->size() <= 1, "Invalid parameter name " << p_name );
+ }
+};
+
+// ************************************************************************** //
+// ************** runtime::cla::char_parameter ************** //
+// ************************************************************************** //
+
+template<typename T>
+class char_parameter_t : public basic_parameter<T,char_name_policy> {
+ typedef basic_parameter<T,char_name_policy> base;
+public:
+ // Constructors
+ explicit char_parameter_t( char_type name ) : base( cstring( &name, 1 ) ) {}
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline shared_ptr<char_parameter_t<T> >
+char_parameter( char_type name )
+{
+ return shared_ptr<char_parameter_t<T> >( new char_parameter_t<T>( name ) );
+}
+
+//____________________________________________________________________________//
+
+inline shared_ptr<char_parameter_t<cstring> >
+char_parameter( char_type name )
+{
+ return shared_ptr<char_parameter_t<cstring> >( new char_parameter_t<cstring>( name ) );
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/char_parameter.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_CHAR_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/char_parameter.ipp b/ndnboost/test/utils/runtime/cla/char_parameter.ipp
new file mode 100644
index 0000000..5922902
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/char_parameter.ipp
@@ -0,0 +1,57 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : implements model of parameter with single char name
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER
+#define BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/char_parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** char_name_policy ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+char_name_policy::char_name_policy()
+: basic_naming_policy( rtti::type_id<char_name_policy>() )
+{
+ assign_op( p_prefix.value, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+char_name_policy::conflict_with( identification_policy const& id ) const
+{
+ return id.p_type_id == p_type_id &&
+ p_name == static_cast<char_name_policy const&>( id ).p_name;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_CHAR_PARAMETER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp b/ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp
new file mode 100644
index 0000000..b78097b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/detail/argument_value_usage.hpp
@@ -0,0 +1,82 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// Permission to copy, use, modify, sell and distribute this software
+// is granted provided this copyright notice appears in all copies.
+// This software is provided "as is" without express or implied warranty,
+// and with no claim as to its suitability for any purpose.
+
+// See http://www.boost.org for updates, documentation, and revision history.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : argument usage printing helpers
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
+#define BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+
+#include <ndnboost/lexical_cast.hpp>
+
+// STL
+// !! can we eliminate these includes?
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+namespace rt_cla_detail {
+
+// ************************************************************************** //
+// ************** argument_value_usage ************** //
+// ************************************************************************** //
+
+// generic case
+template<typename T>
+inline void
+argument_value_usage( format_stream& fs, long, T* = 0 )
+{
+ fs << BOOST_RT_PARAM_CSTRING_LITERAL( "<value>" );
+}
+
+//____________________________________________________________________________//
+
+// specialization for list of values
+template<typename T>
+inline void
+argument_value_usage( format_stream& fs, int, std::list<T>* = 0 )
+{
+ fs << BOOST_RT_PARAM_CSTRING_LITERAL( "(<value1>, ..., <valueN>)" );
+}
+
+//____________________________________________________________________________//
+
+// specialization for type bool
+inline void
+argument_value_usage( format_stream& fs, int, bool* = 0 )
+{
+ fs << BOOST_RT_PARAM_CSTRING_LITERAL( "yes|y|no|n" );
+}
+
+//____________________________________________________________________________//
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_ARGUMENT_VALUE_USAGE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp b/ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp
new file mode 100644
index 0000000..3adbb85
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp
@@ -0,0 +1,96 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines model of generic parameter with dual naming
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/named_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/char_parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** dual_name_policy ************** //
+// ************************************************************************** //
+
+class dual_name_policy : public dual_id_policy<dual_name_policy,string_name_policy,char_name_policy> {
+public:
+ dual_name_policy();
+
+ // Accept modifier
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ if( m.has( prefix ) ) {
+ set_prefix( m[prefix] );
+ m.erase( prefix );
+ }
+
+ if( m.has( name ) ) {
+ set_name( m[name] );
+ m.erase( name );
+ }
+
+ if( m.has( separator ) ) {
+ set_separator( m[separator] );
+ m.erase( separator );
+ }
+
+ dual_id_policy<dual_name_policy,string_name_policy,char_name_policy>::accept_modifier( m );
+ }
+private:
+ void set_prefix( cstring );
+ void set_name( cstring );
+ void set_separator( cstring );
+};
+
+// ************************************************************************** //
+// ************** runtime::cla::dual_name_parameter ************** //
+// ************************************************************************** //
+
+template<typename T>
+class dual_name_parameter_t : public basic_parameter<T,dual_name_policy> {
+ typedef basic_parameter<T,dual_name_policy> base;
+public:
+ // Constructors
+ explicit dual_name_parameter_t( cstring name ) : base( name ) {}
+};
+
+//____________________________________________________________________________//
+
+BOOST_RT_CLA_NAMED_PARAM_GENERATORS( dual_name_parameter )
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_DUAL_NAME_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp b/ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp
new file mode 100644
index 0000000..8fcb04f
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/dual_name_parameter.ipp
@@ -0,0 +1,90 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : implements model of generic parameter with dual naming
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER
+#define BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/dual_name_parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** dual_name_policy ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+dual_name_policy::dual_name_policy()
+{
+ m_primary.accept_modifier( prefix = BOOST_RT_PARAM_CSTRING_LITERAL( "--" ) );
+ m_secondary.accept_modifier( prefix = BOOST_RT_PARAM_CSTRING_LITERAL( "-" ) );
+}
+
+//____________________________________________________________________________//
+
+namespace {
+
+template<typename K>
+inline void
+split( string_name_policy& snp, char_name_policy& cnp, cstring src, K const& k )
+{
+ cstring::iterator sep = std::find( src.begin(), src.end(), BOOST_RT_PARAM_LITERAL( '|' ) );
+
+ if( sep != src.begin() )
+ snp.accept_modifier( k = cstring( src.begin(), sep ) );
+
+ if( sep != src.end() )
+ cnp.accept_modifier( k = cstring( sep+1, src.end() ) );
+}
+
+} // local namespace
+
+BOOST_RT_PARAM_INLINE void
+dual_name_policy::set_prefix( cstring src )
+{
+ split( m_primary, m_secondary, src, prefix );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+dual_name_policy::set_name( cstring src )
+{
+ split( m_primary, m_secondary, src, name );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+dual_name_policy::set_separator( cstring src )
+{
+ split( m_primary, m_secondary, src, separator );
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_DUAL_NAME_PARAMETER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/fwd.hpp b/ndnboost/test/utils/runtime/cla/fwd.hpp
new file mode 100644
index 0000000..4065e9b
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/fwd.hpp
@@ -0,0 +1,55 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : cla subsystem forward declarations
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_FWD_HPP_062604GER
+#define BOOST_RT_CLA_FWD_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+class parser;
+class parameter;
+typedef shared_ptr<parameter> parameter_ptr;
+class naming_policy;
+typedef shared_ptr<naming_policy> naming_policy_ptr;
+class argv_traverser;
+
+namespace rt_cla_detail {
+
+template<typename T> class const_generator;
+template<typename T> class ref_generator;
+
+template<typename T> class assigner;
+
+class named_parameter_base;
+class positional_parameter_base;
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_FWD_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/id_policy.hpp b/ndnboost/test/utils/runtime/cla/id_policy.hpp
new file mode 100644
index 0000000..fb29cb7
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/id_policy.hpp
@@ -0,0 +1,145 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : some generic identification policies definition
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ID_POLICY_HPP_062604GER
+#define BOOST_RT_CLA_ID_POLICY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/iface/id_policy.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** naming_policy_base ************** //
+// ************************************************************************** //
+// model: <prefix> <name> <separtor>
+
+class basic_naming_policy : public identification_policy {
+public:
+ // Public properties
+ unit_test::readwrite_property<dstring> p_prefix;
+ unit_test::readwrite_property<dstring> p_name;
+ unit_test::readwrite_property<dstring> p_separator;
+
+ // Policy interface
+ virtual bool responds_to( cstring name ) const { return p_name == name; }
+ virtual cstring id_2_report() const { return p_name.get(); }
+ virtual void usage_info( format_stream& fs ) const;
+ virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const;
+
+ // Accept modifier
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ nfp::optionally_assign( p_prefix.value, m, prefix );
+ nfp::optionally_assign( p_name.value, m, name );
+ nfp::optionally_assign( p_separator.value, m, separator );
+ }
+
+protected:
+ explicit basic_naming_policy( rtti::id_t dyn_type )
+ : identification_policy( dyn_type )
+ {}
+ BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~basic_naming_policy() {}
+
+ // Naming policy interface
+ virtual bool match_prefix( argv_traverser& tr ) const;
+ virtual bool match_name( argv_traverser& tr ) const;
+ virtual bool match_separator( argv_traverser& tr, bool optional_value ) const;
+};
+
+// ************************************************************************** //
+// ************** dual_id_policy ************** //
+// ************************************************************************** //
+
+template<typename MostDerived,typename PrimaryId,typename SecondId>
+class dual_id_policy : public identification_policy {
+public:
+ // Constructor
+ dual_id_policy()
+ : identification_policy( rtti::type_id<MostDerived>() )
+ , m_primary()
+ , m_secondary()
+ {}
+
+ // Policy interface
+ virtual bool responds_to( cstring name ) const
+ {
+ return m_primary.responds_to( name ) || m_secondary.responds_to( name );
+ }
+ virtual bool conflict_with( identification_policy const& id_p ) const
+ {
+ return id_p.conflict_with( m_primary ) || id_p.conflict_with( m_secondary );
+ }
+ virtual cstring id_2_report() const
+ {
+ return m_primary.id_2_report();
+ }
+ virtual void usage_info( format_stream& fs ) const
+ {
+ fs << BOOST_RT_PARAM_LITERAL( '{' );
+ m_primary.usage_info( fs );
+ fs << BOOST_RT_PARAM_LITERAL( '|' );
+ m_secondary.usage_info( fs );
+ fs << BOOST_RT_PARAM_LITERAL( '}' );
+ }
+ virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const
+ {
+ return m_primary.matching( p, tr, primary ) || m_secondary.matching( p, tr, primary );
+ }
+
+ // Accept modifier
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ m_primary.accept_modifier( m );
+ m_secondary.accept_modifier( m );
+ }
+
+protected:
+ BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~dual_id_policy() {}
+
+ // Data members
+ PrimaryId m_primary;
+ SecondId m_secondary;
+};
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/id_policy.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_ID_POLICY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/id_policy.ipp b/ndnboost/test/utils/runtime/cla/id_policy.ipp
new file mode 100644
index 0000000..6d2c2f4
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/id_policy.ipp
@@ -0,0 +1,118 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : some generic identification policies implementation
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_ID_POLICY_IPP_062904GER
+#define BOOST_RT_CLA_ID_POLICY_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/id_policy.hpp>
+#include <ndnboost/test/utils/runtime/cla/parameter.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** basic_naming_policy ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE void
+basic_naming_policy::usage_info( format_stream& fs ) const
+{
+ fs << p_prefix << p_name << p_separator;
+
+ if( p_separator->empty() )
+ fs << BOOST_RT_PARAM_LITERAL( ' ' );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::match_prefix( argv_traverser& tr ) const
+{
+ if( !tr.match_front( p_prefix.get() ) )
+ return false;
+
+ tr.trim( p_prefix->size() );
+ return true;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::match_name( argv_traverser& tr ) const
+{
+ if( !tr.match_front( p_name.get() ) )
+ return false;
+
+ tr.trim( p_name->size() );
+ return true;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::match_separator( argv_traverser& tr, bool optional_value ) const
+{
+ if( p_separator->empty() ) {
+ if( !tr.token().is_empty() )
+ return false;
+
+ tr.trim( 1 );
+ }
+ else {
+ if( !tr.match_front( p_separator.get() ) ) {
+ // if parameter has optional value separator is optional as well
+ if( optional_value && ( tr.eoi() || tr.match_front( ' ' ) ) ) {
+ return true;
+ }
+ return false;
+ }
+
+ tr.trim( p_separator->size() );
+ }
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+basic_naming_policy::matching( parameter const& p, argv_traverser& tr, bool ) const
+{
+ if( !match_prefix( tr ) )
+ return false;
+
+ if( !match_name( tr ) )
+ return false;
+
+ if( !match_separator( tr, p.p_optional_value ) )
+ return false;
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_ID_POLICY_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp b/ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp
new file mode 100644
index 0000000..84c1e40
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp
@@ -0,0 +1,51 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines interface for argument_factory
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER
+#define BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** argument_factory ************** //
+// ************************************************************************** //
+// another name can be argument production policy
+
+class argument_factory {
+public:
+ // Argument factory interface
+ virtual argument_ptr produce_using( parameter& p, argv_traverser& tr ) = 0; /// produce argument based on input
+ virtual argument_ptr produce_using( parameter& p, parser const& ) = 0; /// produce argument based on internal generator and/or values of other parameters
+ virtual void argument_usage_info( format_stream& fs ) = 0; /// argument value format information
+protected:
+ BOOST_TEST_PROTECTED_VIRTUAL ~argument_factory() {}
+};
+
+} // namespace ndnboost
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace cla
+
+#endif // BOOST_RT_CLA_IFACE_ARGUMENT_FACTORY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/iface/id_policy.hpp b/ndnboost/test/utils/runtime/cla/iface/id_policy.hpp
new file mode 100644
index 0000000..338f8d5
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/iface/id_policy.hpp
@@ -0,0 +1,73 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : defines interface for identification_policy
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
+#define BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** identification_policy ************** //
+// ************************************************************************** //
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4244)
+#endif
+
+class identification_policy {
+public:
+ // Public properties
+ unit_test::readwrite_property<rtti::id_t> p_type_id;
+
+ // Policy interface
+ virtual bool responds_to( cstring name ) const = 0;
+ virtual cstring id_2_report() const = 0;
+ virtual void usage_info( format_stream& fs ) const = 0;
+ virtual bool matching( parameter const& p, argv_traverser& tr, bool primary ) const = 0;
+
+ virtual bool conflict_with( identification_policy const& ) const = 0;
+
+protected:
+ // Constructor
+ explicit identification_policy( rtti::id_t dyn_type )
+ : p_type_id( dyn_type )
+ {}
+ BOOST_TEST_PROTECTED_VIRTUAL ~identification_policy() {}
+};
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_IFACE_ID_POLICY_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/modifier.hpp b/ndnboost/test/utils/runtime/cla/modifier.hpp
new file mode 100644
index 0000000..32719ab
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/modifier.hpp
@@ -0,0 +1,69 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : parameter modifiers
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_MODIFIER_HPP_062604GER
+#define BOOST_RT_CLA_MODIFIER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/named_params.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** environment variable modifiers ************** //
+// ************************************************************************** //
+
+namespace {
+
+nfp::typed_keyword<bool,struct optional_t> optional_m;
+nfp::named_parameter<bool,optional_t,bool> optional( true );
+nfp::typed_keyword<bool,struct required_t> required_m;
+nfp::named_parameter<bool,required_t,bool> required( true );
+nfp::typed_keyword<bool,struct multiplicable_t> multiplicable_m;
+nfp::named_parameter<bool,multiplicable_t,bool> multiplicable( true );
+nfp::typed_keyword<bool,struct guess_name_t> guess_name_m;
+nfp::named_parameter<bool,guess_name_t,bool> guess_name( true );
+nfp::typed_keyword<bool,struct ignore_mismatch_t> ignore_mismatch_m;
+nfp::named_parameter<bool,ignore_mismatch_t,bool> ignore_mismatch( true );
+nfp::typed_keyword<bool,struct optional_value_t> optional_value_m;
+nfp::named_parameter<bool,optional_value_t,bool> optional_value( true );
+
+nfp::typed_keyword<char_type,struct input_separator_t> input_separator;
+nfp::typed_keyword<cstring,struct prefix_t> prefix;
+nfp::typed_keyword<cstring,struct name_t> name;
+nfp::typed_keyword<cstring,struct separator_t> separator;
+nfp::typed_keyword<cstring,struct description_t> description;
+nfp::typed_keyword<cstring,struct refer_to_t> default_refer_to;
+
+nfp::keyword<struct default_value_t> default_value;
+nfp::keyword<struct handler_t> handler;
+nfp::keyword<struct interpreter_t> interpreter;
+nfp::keyword<struct assign_to_t> assign_to;
+
+} // local namespace
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_MODIFIER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/named_parameter.hpp b/ndnboost/test/utils/runtime/cla/named_parameter.hpp
new file mode 100644
index 0000000..28f03b4
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/named_parameter.hpp
@@ -0,0 +1,93 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines model of named parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/basic_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/id_policy.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** string_name_policy ************** //
+// ************************************************************************** //
+
+class string_name_policy : public basic_naming_policy {
+public:
+ // Constructor
+ string_name_policy();
+ BOOST_RT_PARAM_UNNEEDED_VIRTUAL ~string_name_policy() {}
+
+ // policy interface
+ virtual bool responds_to( cstring name ) const;
+ virtual bool conflict_with( identification_policy const& ) const;
+
+ // Accept modifier
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ basic_naming_policy::accept_modifier( m );
+
+ if( m.has( guess_name_m ) )
+ m_guess_name = true;
+ }
+
+private:
+ // Naming policy interface
+ virtual bool match_name( argv_traverser& tr ) const;
+
+ // Data members
+ bool m_guess_name;
+};
+
+// ************************************************************************** //
+// ************** runtime::cla::named_parameter ************** //
+// ************************************************************************** //
+
+template<typename T>
+class named_parameter_t : public basic_parameter<T,string_name_policy> {
+ typedef basic_parameter<T,string_name_policy> base;
+public:
+ // Constructors
+ explicit named_parameter_t( cstring name ) : base( name ) {}
+};
+
+//____________________________________________________________________________//
+
+BOOST_RT_CLA_NAMED_PARAM_GENERATORS( named_parameter )
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/named_parameter.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_NAMED_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/named_parameter.ipp b/ndnboost/test/utils/runtime/cla/named_parameter.ipp
new file mode 100644
index 0000000..1d77018
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/named_parameter.ipp
@@ -0,0 +1,129 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : implements model of named parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER
+#define BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/named_parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/char_parameter.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/algorithm.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** string_name_policy ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+string_name_policy::string_name_policy()
+: basic_naming_policy( rtti::type_id<string_name_policy>() )
+, m_guess_name( false )
+{
+ assign_op( p_prefix.value, BOOST_RT_PARAM_CSTRING_LITERAL( "-" ), 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+string_name_policy::responds_to( cstring name ) const
+{
+ std::pair<cstring::iterator,dstring::const_iterator> mm_pos;
+
+ mm_pos = unit_test::mismatch( name.begin(), name.end(), p_name->begin(), p_name->end() );
+
+ return mm_pos.first == name.end() && (m_guess_name || (mm_pos.second == p_name->end()) );
+}
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_MSVC
+# pragma warning(push)
+# pragma warning(disable:4244)
+#endif
+
+BOOST_RT_PARAM_INLINE bool
+string_name_policy::conflict_with( identification_policy const& id ) const
+{
+ if( id.p_type_id == p_type_id ) {
+ string_name_policy const& snp = static_cast<string_name_policy const&>( id );
+
+ if( p_name->empty() || snp.p_name->empty() )
+ return false;
+
+ if( p_prefix != snp.p_prefix )
+ return false;
+
+ std::pair<dstring::const_iterator,dstring::const_iterator> mm_pos =
+ unit_test::mismatch( p_name->begin(), p_name->end(), snp.p_name->begin(), snp.p_name->end() );
+
+ return mm_pos.first != p_name->begin() && // there is common substring
+ ((m_guess_name && (mm_pos.second == snp.p_name->end()) ) || // that match other guy and I am guessing
+ (snp.m_guess_name && (mm_pos.first == p_name->end()) )); // or me and the other guy is
+ }
+
+ if( id.p_type_id == rtti::type_id<char_name_policy>() ) {
+ char_name_policy const& cnp = static_cast<char_name_policy const&>( id );
+
+ return m_guess_name &&
+ (p_prefix == cnp.p_prefix) &&
+ unit_test::first_char( cstring( p_name ) ) == unit_test::first_char( cstring( cnp.p_name ) );
+ }
+
+ return false;
+}
+
+#ifdef BOOST_MSVC
+# pragma warning(pop)
+#endif
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE bool
+string_name_policy::match_name( argv_traverser& tr ) const
+{
+ if( !m_guess_name )
+ return basic_naming_policy::match_name( tr );
+
+ cstring in = tr.input();
+
+ std::pair<cstring::iterator,dstring::const_iterator> mm_pos;
+
+ mm_pos = unit_test::mismatch( in.begin(), in.end(), p_name->begin(), p_name->end() );
+
+ if( mm_pos.first == in.begin() )
+ return false;
+
+ tr.trim( mm_pos.first - in.begin() );
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_NAMED_PARAMETER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/parameter.hpp b/ndnboost/test/utils/runtime/cla/parameter.hpp
new file mode 100644
index 0000000..36edbb6
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/parameter.hpp
@@ -0,0 +1,150 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 81913 $
+//
+// Description : defines model of formal parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/parameter.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/iface/argument_factory.hpp>
+#include <ndnboost/test/utils/runtime/cla/iface/id_policy.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::parameter ************** //
+// ************************************************************************** //
+
+class parameter : public BOOST_RT_PARAM_NAMESPACE::parameter {
+public:
+ parameter( identification_policy& ID, argument_factory& F, bool optional_value = false )
+ : p_optional( false )
+ , p_multiplicable( false )
+ , p_optional_value( optional_value )
+ , m_id_policy( ID )
+ , m_arg_factory( F )
+ {}
+
+ // Destructor
+ virtual ~parameter() {}
+
+ unit_test::readwrite_property<bool> p_optional;
+ unit_test::readwrite_property<bool> p_multiplicable;
+ unit_test::readwrite_property<bool> p_optional_value;
+ unit_test::readwrite_property<dstring> p_description;
+
+ // parameter properties modification
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ if( m.has( optional_m ) )
+ p_optional.value = true;
+
+ if( m.has( required_m ) )
+ p_optional.value = false;
+
+ if( m.has( multiplicable_m ) )
+ p_multiplicable.value = true;
+
+ if( m.has( optional_value_m ) )
+ p_optional_value.value = true;
+
+ nfp::optionally_assign( p_description.value, m, description );
+ }
+
+ // access methods
+ bool has_argument() const { return m_actual_argument!=0; }
+ argument const& actual_argument() const { return *m_actual_argument; }
+ argument_ptr actual_argument() { return m_actual_argument; }
+
+
+ // identification interface
+ bool responds_to( cstring name ) const { return m_id_policy.responds_to( name ); }
+ bool conflict_with( parameter const& p ) const
+ {
+ return (id_2_report() == p.id_2_report() && !id_2_report().is_empty()) ||
+ m_id_policy.conflict_with( p.m_id_policy ) ||
+ ((m_id_policy.p_type_id != p.m_id_policy.p_type_id) && p.m_id_policy.conflict_with( m_id_policy ));
+ }
+ cstring id_2_report() const { return m_id_policy.id_2_report(); }
+ void usage_info( format_stream& fs ) const
+ {
+ m_id_policy.usage_info( fs );
+ if( p_optional_value )
+ fs << BOOST_RT_PARAM_LITERAL( '[' );
+
+ m_arg_factory.argument_usage_info( fs );
+
+ if( p_optional_value )
+ fs << BOOST_RT_PARAM_LITERAL( ']' );
+ }
+
+ // argument match/produce based on input
+ bool matching( argv_traverser& tr, bool primary ) const
+ {
+ return m_id_policy.matching( *this, tr, primary );
+ }
+
+ // argument production based on different source
+ void produce_argument( argv_traverser& tr )
+ {
+ m_id_policy.matching( *this, tr, true ); // !! can we save this position somehow
+ m_actual_argument = m_arg_factory.produce_using( *this, tr );
+ }
+ void produce_argument( parser const& p )
+ {
+ m_actual_argument = m_arg_factory.produce_using( *this, p );
+ }
+
+private:
+ //Data members
+ identification_policy& m_id_policy;
+ argument_factory& m_arg_factory;
+ argument_ptr m_actual_argument;
+};
+
+//____________________________________________________________________________//
+
+template<typename Parameter,typename Modifier>
+inline shared_ptr<Parameter>
+operator-( shared_ptr<Parameter> p, Modifier const& m )
+{
+ p->accept_modifier( m );
+
+ return p;
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/parser.hpp b/ndnboost/test/utils/runtime/cla/parser.hpp
new file mode 100644
index 0000000..d98625c
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/parser.hpp
@@ -0,0 +1,153 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : defines parser - public interface for CLA parsing and accessing
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_PARSER_HPP_062604GER
+#define BOOST_RT_CLA_PARSER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+// STL
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::parser ************** //
+// ************************************************************************** //
+
+namespace cla_detail {
+
+template<typename Modifier>
+class global_mod_parser {
+public:
+ global_mod_parser( parser& p, Modifier const& m )
+ : m_parser( p )
+ , m_modifiers( m )
+ {}
+
+ template<typename Param>
+ global_mod_parser const&
+ operator<<( shared_ptr<Param> param ) const
+ {
+ param->accept_modifier( m_modifiers );
+
+ m_parser << param;
+
+ return *this;
+ }
+
+private:
+ // Data members;
+ parser& m_parser;
+ Modifier const& m_modifiers;
+};
+
+}
+
+// ************************************************************************** //
+// ************** runtime::cla::parser ************** //
+// ************************************************************************** //
+
+class parser {
+public:
+ typedef std::list<parameter_ptr>::const_iterator param_iterator;
+
+ // Constructor
+ explicit parser( cstring program_name = cstring() );
+
+ // parameter list construction interface
+ parser& operator<<( parameter_ptr param );
+
+ // parser and global parameters modifiers
+ template<typename Modifier>
+ cla_detail::global_mod_parser<Modifier>
+ operator-( Modifier const& m )
+ {
+ nfp::optionally_assign( m_traverser.p_separator.value, m, input_separator );
+ nfp::optionally_assign( m_traverser.p_ignore_mismatch.value, m, ignore_mismatch_m );
+
+ return cla_detail::global_mod_parser<Modifier>( *this, m );
+ }
+
+ // input processing method
+ void parse( int& argc, char_type** argv );
+
+ // parameters access
+ param_iterator first_param() const;
+ param_iterator last_param() const;
+
+ // arguments access
+ const_argument_ptr operator[]( cstring string_id ) const;
+ cstring get( cstring string_id ) const;
+
+ template<typename T>
+ T const& get( cstring string_id ) const
+ {
+ return arg_value<T>( valid_argument( string_id ) );
+ }
+
+ template<typename T>
+ void get( cstring string_id, ndnboost::optional<T>& res ) const
+ {
+ const_argument_ptr actual_arg = (*this)[string_id];
+
+ if( actual_arg )
+ res = arg_value<T>( *actual_arg );
+ else
+ res.reset();
+ }
+
+ // help/usage
+ void usage( out_stream& ostr );
+ void help( out_stream& ostr );
+
+private:
+ argument const& valid_argument( cstring string_id ) const;
+
+ // Data members
+ argv_traverser m_traverser;
+ std::list<parameter_ptr> m_parameters;
+ dstring m_program_name;
+};
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/parser.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_PARSER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/parser.ipp b/ndnboost/test/utils/runtime/cla/parser.ipp
new file mode 100644
index 0000000..5be8503
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/parser.ipp
@@ -0,0 +1,258 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : implements parser - public interface for CLA parsing and accessing
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_PARSER_IPP_062904GER
+#define BOOST_RT_CLA_PARSER_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/trace.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+#include <ndnboost/test/utils/runtime/cla/parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/modifier.hpp>
+#include <ndnboost/test/utils/runtime/cla/validation.hpp>
+#include <ndnboost/test/utils/runtime/cla/parser.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+
+// Boost
+#include <ndnboost/lexical_cast.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::parser ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE
+parser::parser( cstring program_name )
+{
+ assign_op( m_program_name, program_name, 0 );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE parser::param_iterator
+parser::first_param() const
+{
+ return m_parameters.begin();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE parser::param_iterator
+parser::last_param() const
+{
+ return m_parameters.end();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE argument const&
+parser::valid_argument( cstring string_id ) const
+{
+ const_argument_ptr arg = (*this)[string_id];
+
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !!arg, "Actual argument for parameter " << string_id << " is not present" );
+
+ return *arg;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE parser&
+parser::operator<<( parameter_ptr new_param )
+{
+ BOOST_TEST_FOREACH( parameter_ptr, old_param, m_parameters ) {
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !old_param->conflict_with( *new_param ),
+ BOOST_RT_PARAM_LITERAL( "Definition of parameter " ) << new_param->id_2_report() <<
+ BOOST_RT_PARAM_LITERAL( " conflicts with defintion of parameter " ) << old_param->id_2_report() );
+ }
+
+ m_parameters.push_back( new_param );
+
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+parser::parse( int& argc, char_type** argv )
+{
+ if( m_program_name.empty() ) {
+ m_program_name.assign( argv[0] );
+ dstring::size_type pos = m_program_name.find_last_of( BOOST_RT_PARAM_LITERAL( "/\\" ) );
+
+ if( pos != static_cast<dstring::size_type>(cstring::npos) )
+ m_program_name.erase( 0, pos+1 );
+ }
+
+ m_traverser.init( argc, argv );
+
+ try {
+ while( !m_traverser.eoi() ) {
+ parameter_ptr found_param;
+
+ BOOST_RT_PARAM_TRACE( "Total " << m_parameters.size() << " parameters registered" );
+
+ BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+ BOOST_RT_PARAM_TRACE( "Try parameter " << curr_param->id_2_report() );
+
+ if( curr_param->matching( m_traverser, !found_param ) ) {
+ BOOST_RT_PARAM_TRACE( "Match found" );
+ BOOST_RT_CLA_VALIDATE_INPUT( !found_param, (m_traverser.rollback(),m_traverser), "Ambiguous input" );
+
+ found_param = curr_param;
+ }
+
+ m_traverser.rollback();
+ }
+
+ if( !found_param ) {
+ BOOST_RT_PARAM_TRACE( "No match found" );
+ BOOST_RT_CLA_VALIDATE_INPUT( m_traverser.handle_mismatch(), m_traverser,
+ BOOST_RT_PARAM_LITERAL( "Unexpected input" ) );
+
+ continue;
+ }
+
+ BOOST_RT_PARAM_TRACE( "Parse argument value" );
+ found_param->produce_argument( m_traverser );
+
+ m_traverser.commit();
+ }
+
+ BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+ if( !curr_param->p_optional && !curr_param->actual_argument() ) {
+ curr_param->produce_argument( *this );
+
+ BOOST_RT_PARAM_VALIDATE_LOGIC( curr_param->actual_argument(),
+ BOOST_RT_PARAM_LITERAL( "Required argument for parameter " ) << curr_param->id_2_report()
+ << BOOST_RT_PARAM_LITERAL( " is missing" ) );
+ }
+ }
+ }
+ catch( bad_lexical_cast const& ) {
+ BOOST_RT_PARAM_REPORT_LOGIC_ERROR(
+ BOOST_RT_PARAM_LITERAL( "String to value convertion error during input parsing" ) );
+ }
+
+ m_traverser.remainder( argc, argv );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE const_argument_ptr
+parser::operator[]( cstring string_id ) const
+{
+ parameter_ptr found_param;
+
+ BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+ if( curr_param->responds_to( string_id ) ) {
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !found_param,
+ BOOST_RT_PARAM_LITERAL( "Ambiguous parameter string id: " ) << string_id );
+
+ found_param = curr_param;
+ }
+ }
+
+ return found_param ? found_param->actual_argument() : argument_ptr();
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE cstring
+parser::get( cstring string_id ) const
+{
+ return get<cstring>( string_id );
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+parser::usage( out_stream& ostr )
+{
+ if( m_program_name.empty() )
+ assign_op( m_program_name, BOOST_RT_PARAM_CSTRING_LITERAL( "<program>" ), 0 );
+
+ format_stream fs;
+
+ fs << m_program_name;
+
+ BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+ fs << BOOST_RT_PARAM_LITERAL( ' ' );
+
+ if( curr_param->p_optional )
+ fs << BOOST_RT_PARAM_LITERAL( '[' );
+
+ curr_param->usage_info( fs );
+
+ if( curr_param->p_optional )
+ fs << BOOST_RT_PARAM_LITERAL( ']' );
+
+ if( curr_param->p_multiplicable ) {
+ fs << BOOST_RT_PARAM_CSTRING_LITERAL( " ... " );
+
+ if( curr_param->p_optional )
+ fs << BOOST_RT_PARAM_LITERAL( '[' );
+
+ curr_param->usage_info( fs );
+
+ if( curr_param->p_optional )
+ fs << BOOST_RT_PARAM_LITERAL( ']' );
+ }
+ }
+
+ ostr << BOOST_RT_PARAM_CSTRING_LITERAL( "Usage:\n" ) << fs.str() << std::endl;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+parser::help( out_stream& ostr )
+{
+ usage( ostr );
+
+ bool need_where = true;
+
+ BOOST_TEST_FOREACH( parameter_ptr const&, curr_param, m_parameters ) {
+ if( curr_param->p_description->empty() )
+ continue;
+
+ if( need_where ) {
+ ostr << BOOST_RT_PARAM_CSTRING_LITERAL( "where:\n" );
+ need_where = false;
+ }
+
+ ostr << curr_param->id_2_report() << BOOST_RT_PARAM_CSTRING_LITERAL( " - " ) << curr_param->p_description << std::endl;
+ }
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_PARSER_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/cla/typed_parameter.hpp b/ndnboost/test/utils/runtime/cla/typed_parameter.hpp
new file mode 100644
index 0000000..b8ad9e4
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/typed_parameter.hpp
@@ -0,0 +1,70 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : generic typed parameter model
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
+#define BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/parameter.hpp>
+#include <ndnboost/test/utils/runtime/cla/argument_factory.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/rtti.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::typed_parameter ************** //
+// ************************************************************************** //
+
+template<typename T>
+class typed_parameter : public cla::parameter {
+public:
+ explicit typed_parameter( identification_policy& ID )
+ : cla::parameter( ID, m_arg_factory, rtti::type_id<T>() == rtti::type_id<bool>() )
+ {}
+
+ // parameter properties modification
+ template<typename Modifier>
+ void accept_modifier( Modifier const& m )
+ {
+ cla::parameter::accept_modifier( m );
+
+ m_arg_factory.accept_modifier( m );
+
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !p_optional || !m_arg_factory.m_value_generator,
+ BOOST_RT_PARAM_LITERAL( "can't define a value generator for optional parameter " ) << id_2_report() );
+ }
+
+private:
+ // Data members
+ typed_argument_factory<T> m_arg_factory;
+};
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_TYPED_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/validation.hpp b/ndnboost/test/utils/runtime/cla/validation.hpp
new file mode 100644
index 0000000..18c9b77
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/validation.hpp
@@ -0,0 +1,55 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : input validation helpers definition
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALIDATION_HPP_062604GER
+#define BOOST_RT_CLA_VALIDATION_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::report_input_error ************** //
+// ************************************************************************** //
+
+void report_input_error( argv_traverser const& tr, format_stream& msg );
+
+//____________________________________________________________________________//
+
+#define BOOST_RT_CLA_VALIDATE_INPUT( b, tr, msg ) \
+ if( b ) ; else ::ndnboost::BOOST_RT_PARAM_NAMESPACE::cla::report_input_error( tr, format_stream().ref() << msg )
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+# define BOOST_RT_PARAM_INLINE inline
+# include <ndnboost/test/utils/runtime/cla/validation.ipp>
+
+#endif
+
+#endif // BOOST_RT_CLA_VALIDATION_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/validation.ipp b/ndnboost/test/utils/runtime/cla/validation.ipp
new file mode 100644
index 0000000..5d295d7
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/validation.ipp
@@ -0,0 +1,65 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : input validation helpers implementation
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALIDATION_IPP_070604GER
+#define BOOST_RT_CLA_VALIDATION_IPP_070604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/argv_traverser.hpp>
+#include <ndnboost/test/utils/runtime/cla/validation.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp> // BOOST_RT_PARAM_NAMESPACE::logic_error
+
+// Boost
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// STL
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+// ************************************************************************** //
+// ************** runtime::cla::validation ************** //
+// ************************************************************************** //
+
+BOOST_RT_PARAM_INLINE void
+report_input_error( argv_traverser const& tr, format_stream& msg )
+{
+ if( tr.eoi() )
+ msg << BOOST_RT_PARAM_LITERAL( " at the end of input" );
+ else {
+ msg << BOOST_RT_PARAM_LITERAL( " in the following position: " );
+
+ if( tr.input().size() > 5 )
+ msg << tr.input().substr( 0, 5 ) << BOOST_RT_PARAM_LITERAL( "..." );
+ else
+ msg << tr.input();
+ }
+
+ throw BOOST_RT_PARAM_NAMESPACE::logic_error( msg.str() );
+}
+
+//____________________________________________________________________________//
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_VALIDATION_IPP_070604GER
diff --git a/ndnboost/test/utils/runtime/cla/value_generator.hpp b/ndnboost/test/utils/runtime/cla/value_generator.hpp
new file mode 100644
index 0000000..d402977
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/value_generator.hpp
@@ -0,0 +1,81 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : specific value generators
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER
+#define BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+#include <ndnboost/test/utils/runtime/cla/parser.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+namespace rt_cla_detail {
+
+// ************************************************************************** //
+// ************** runtime::cla::const_generator ************** //
+// ************************************************************************** //
+
+template<typename T>
+class const_generator {
+public:
+ // Constructor
+ explicit const_generator( T const& t ) : m_const_value( t ) {}
+
+ // generator interface
+ void operator()( parser const&, ndnboost::optional<T>& t ) const { t = m_const_value; }
+
+private:
+ // Data members
+ T m_const_value;
+};
+
+// ************************************************************************** //
+// ************** runtime::cla::ref_generator ************** //
+// ************************************************************************** //
+
+template<typename T>
+class ref_generator {
+public:
+ // Constructor
+ explicit ref_generator( cstring ref_id ) : m_ref_id( ref_id ) {}
+
+ // generator interface
+ void operator()( parser const& p, ndnboost::optional<T>& t ) const
+ {
+ p.get( m_ref_id, t );
+ }
+
+private:
+ // Data members
+ cstring m_ref_id;
+};
+
+//____________________________________________________________________________//
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_VALUE_GENERATOR_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/cla/value_handler.hpp b/ndnboost/test/utils/runtime/cla/value_handler.hpp
new file mode 100644
index 0000000..1d792ba
--- /dev/null
+++ b/ndnboost/test/utils/runtime/cla/value_handler.hpp
@@ -0,0 +1,57 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : specific value handlers
+// ***************************************************************************
+
+#ifndef BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
+#define BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#include <ndnboost/test/utils/runtime/cla/fwd.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace cla {
+
+namespace rt_cla_detail {
+
+// ************************************************************************** //
+// ************** runtime::cla::assigner ************** //
+// ************************************************************************** //
+
+template<typename T>
+class assigner {
+public:
+ // Constructor
+ explicit assigner( T& loc ) : m_target( loc ) {}
+
+ // value handler implementation
+ void operator()( parameter const&, T& t ) { m_target = t; }
+
+private:
+ // Data members
+ T& m_target;
+};
+
+} // namespace rt_cla_detail
+
+} // namespace cla
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CLA_VALUE_HANDLER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/config.hpp b/ndnboost/test/utils/runtime/config.hpp
new file mode 100644
index 0000000..8067a96
--- /dev/null
+++ b/ndnboost/test/utils/runtime/config.hpp
@@ -0,0 +1,156 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : Runtime.Param library configuration
+// ***************************************************************************
+
+#ifndef BOOST_RT_CONFIG_HPP_062604GER
+#define BOOST_RT_CONFIG_HPP_062604GER
+
+// Boost
+#include <ndnboost/config.hpp>
+#ifdef BOOST_MSVC
+# pragma warning(disable: 4511) // copy constructor could not be generated
+# pragma warning(disable: 4512) // assignment operator could not be generated
+# pragma warning(disable: 4181) // qualifier applied to reference type; ignored
+# pragma warning(disable: 4675) // resolved overload was found by argument-dependent lookup
+#endif
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/wrap_stringstream.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp> // operator<<(ndnboost::runtime::cstring)
+
+// STL
+#include <string>
+#include <cstdlib>
+
+//____________________________________________________________________________//
+
+#ifndef BOOST_RT_PARAM_CUSTOM_STRING
+# ifndef BOOST_RT_PARAM_WIDE_STRING
+# define BOOST_RT_PARAM_NAMESPACE runtime
+# else
+# define BOOST_RT_PARAM_NAMESPACE wide_runtime
+# endif
+#endif
+
+#ifdef __SUNPRO_CC
+extern int putenv(char*);
+#endif
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+#ifndef BOOST_RT_PARAM_CUSTOM_STRING
+# ifndef BOOST_RT_PARAM_WIDE_STRING
+
+typedef char char_type;
+typedef std::string dstring;
+typedef unit_test::const_string cstring;
+typedef unit_test::literal_string literal_cstring;
+typedef wrap_stringstream format_stream;
+
+#ifdef BOOST_CLASSIC_IOSTREAMS
+typedef std::ostream out_stream;
+#else
+typedef std::basic_ostream<char_type> out_stream;
+#endif
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996) // putenv
+#endif
+
+#ifndef UNDER_CE
+#if defined(__COMO__) && 0
+inline void
+putenv_impl( cstring name, cstring value )
+{
+ using namespace std;
+ // !! this may actually fail. What should we do?
+ setenv( name.begin(), value.begin(), 1 );
+}
+#else
+inline void
+putenv_impl( cstring name, cstring value )
+{
+ format_stream fs;
+
+ fs << name << '=' << value;
+
+ // !! this may actually fail. What should we do?
+ // const_cast is used to satisfy putenv interface
+ using namespace std;
+ putenv( const_cast<char*>( fs.str().c_str() ) );
+}
+#endif
+#endif
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+#define BOOST_RT_PARAM_LITERAL( l ) l
+#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 )
+#define BOOST_RT_PARAM_GETENV getenv
+#define BOOST_RT_PARAM_PUTENV ::ndnboost::BOOST_RT_PARAM_NAMESPACE::putenv_impl
+#define BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
+
+//____________________________________________________________________________//
+
+# else
+
+typedef wchar_t char_type;
+typedef std::basic_string<char_type> dstring;
+typedef unit_test::basic_cstring<wchar_t const> cstring;
+typedef const unit_test::basic_cstring<wchar_t const> literal_cstring;
+typedef wrap_wstringstream format_stream;
+typedef std::wostream out_stream;
+
+#ifndef UNDER_CE
+inline void
+putenv_impl( cstring name, cstring value )
+{
+ format_stream fs;
+
+ fs << name << '=' << value;
+
+ // !! this may actually fail. What should we do?
+ // const_cast is used to satisfy putenv interface
+ using namespace std;
+ wputenv( const_cast<wchar_t*>( fs.str().c_str() ) );
+}
+#endif
+
+#define BOOST_RT_PARAM_LITERAL( l ) L ## l
+#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( L ## l, sizeof( L ## l )/sizeof(wchar_t) - 1 )
+#define BOOST_RT_PARAM_GETENV wgetenv
+#define BOOST_RT_PARAM_PUTENV putenv_impl
+
+# endif
+#endif
+
+#ifdef __GNUC__
+#define BOOST_RT_PARAM_UNNEEDED_VIRTUAL virtual
+#else
+#define BOOST_RT_PARAM_UNNEEDED_VIRTUAL
+#endif
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_CONFIG_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/environment.hpp b/ndnboost/test/utils/runtime/env/environment.hpp
new file mode 100644
index 0000000..b45f10f
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/environment.hpp
@@ -0,0 +1,172 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : defines and implements inline model of program environment
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
+#define BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
+
+#ifdef UNDER_CE
+#error Windows CE does not support environment variables.
+#endif
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+#include <ndnboost/test/utils/runtime/interpret_argument_value.hpp>
+
+#include <ndnboost/test/utils/runtime/env/fwd.hpp>
+#include <ndnboost/test/utils/runtime/env/modifier.hpp>
+#include <ndnboost/test/utils/runtime/env/variable.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/callback.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// ************** runtime::environment implementation ************** //
+// ************************************************************************** //
+
+namespace environment {
+
+namespace rt_env_detail {
+
+template<typename T, typename Modifiers>
+variable_data&
+init_new_var( cstring var_name, Modifiers m = nfp::no_params )
+{
+ rt_env_detail::variable_data& new_vd = new_var_record( var_name );
+
+ cstring str_value = sys_read_var( new_vd.m_var_name );
+
+ if( !str_value.is_empty() ) {
+ try {
+ ndnboost::optional<T> value;
+
+ if( m.has( interpreter ) )
+ m[interpreter]( str_value, value );
+ else
+ interpret_argument_value( str_value, value, 0 );
+
+ if( !!value ) {
+ new_vd.m_value.reset( new typed_argument<T>( new_vd ) );
+
+ arg_value<T>( *new_vd.m_value ) = *value;
+ }
+ }
+ catch( ... ) { // !! could we do that
+ // !! should we report an error?
+ }
+ }
+
+ if( !new_vd.m_value && m.has( default_value ) ) {
+ new_vd.m_value.reset( new typed_argument<T>( new_vd ) );
+
+ nfp::optionally_assign( arg_value<T>( *new_vd.m_value ), m[default_value] );
+ }
+
+ nfp::optionally_assign( new_vd.m_global_id, m, global_id );
+
+ return new_vd;
+}
+
+//____________________________________________________________________________//
+
+} // namespace rt_env_detail
+
+} // namespace environment
+
+// ************************************************************************** //
+// ************** runtime::environment ************** //
+// ************************************************************************** //
+
+namespace environment {
+
+ // variable access
+ variable_base
+ var( cstring var_name );
+
+ //________________________________________________________________________//
+
+ template<typename T>
+ inline variable<T>
+ var( cstring var_name )
+ {
+ rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name );
+
+ return environment::variable<T>( !vd ? rt_env_detail::init_new_var<T>( var_name, nfp::no_params ) : *vd );
+ }
+
+ //________________________________________________________________________//
+
+ template<typename T, typename Modifiers>
+ inline variable<T>
+ var( cstring var_name, Modifiers const& m )
+ {
+ rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name );
+
+ return environment::variable<T>( !vd ? rt_env_detail::init_new_var<T>( var_name, m ) : *vd );
+ }
+
+ //________________________________________________________________________//
+
+ // direct variable value access
+ inline cstring
+ get( cstring var_name )
+ {
+ return environment::var<cstring>( var_name ).value();
+ }
+
+ //________________________________________________________________________//
+
+ template<typename T>
+ inline T const&
+ get( cstring var_name )
+ {
+ return environment::var<T>( var_name ).value();
+ }
+
+ //________________________________________________________________________//
+
+ template<typename T>
+ inline void
+ get( cstring var_name, ndnboost::optional<T>& res )
+ {
+ variable<T> const& v = environment::var<T>( var_name );
+ v.value( res );
+ }
+
+ //________________________________________________________________________//
+
+} // namespace environment
+
+namespace env = environment;
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#ifndef BOOST_RT_PARAM_OFFLINE
+
+#define BOOST_RT_PARAM_INLINE inline
+#include <ndnboost/test/utils/runtime/env/environment.ipp>
+
+#endif
+
+#endif // BOOST_RT_ENV_ENVIRONMENT_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/environment.ipp b/ndnboost/test/utils/runtime/env/environment.ipp
new file mode 100644
index 0000000..f2929de
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/environment.ipp
@@ -0,0 +1,125 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : implements model of program environment
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_ENVIRONMENT_IPP_062904GER
+#define BOOST_RT_ENV_ENVIRONMENT_IPP_062904GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/validation.hpp>
+
+#include <ndnboost/test/utils/runtime/env/variable.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// STL
+#include <map>
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+// ************************************************************************** //
+// ************** runtime::environment ************** //
+// ************************************************************************** //
+
+namespace rt_env_detail {
+
+typedef std::map<cstring,rt_env_detail::variable_data> registry;
+typedef std::list<dstring> keys;
+
+BOOST_RT_PARAM_INLINE registry& s_registry() { static registry instance; return instance; }
+BOOST_RT_PARAM_INLINE keys& s_keys() { static keys instance; return instance; }
+
+BOOST_RT_PARAM_INLINE variable_data&
+new_var_record( cstring var_name )
+{
+ // save the name in list of keys
+ s_keys().push_back( dstring() );
+ dstring& key = s_keys().back();
+ assign_op( key, var_name, 0 );
+
+ // create and return new record
+ variable_data& new_var_data = s_registry()[key];
+
+ new_var_data.m_var_name = key;
+
+ return new_var_data;
+}
+
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE variable_data*
+find_var_record( cstring var_name )
+{
+ registry::iterator it = s_registry().find( var_name );
+
+ return it == s_registry().end() ? 0 : &(it->second);
+}
+
+//____________________________________________________________________________//
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4996) // getenv
+#endif
+
+BOOST_RT_PARAM_INLINE cstring
+sys_read_var( cstring var_name )
+{
+ using namespace std;
+ return BOOST_RT_PARAM_GETENV( var_name.begin() );
+}
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+//____________________________________________________________________________//
+
+BOOST_RT_PARAM_INLINE void
+sys_write_var( cstring var_name, format_stream& var_value )
+{
+ BOOST_RT_PARAM_PUTENV( var_name, cstring( var_value.str() ) );
+}
+
+//____________________________________________________________________________//
+
+} // namespace rt_env_detail
+
+BOOST_RT_PARAM_INLINE variable_base
+var( cstring var_name )
+{
+ rt_env_detail::variable_data* vd = rt_env_detail::find_var_record( var_name );
+
+ BOOST_RT_PARAM_VALIDATE_LOGIC( !!vd,
+ BOOST_RT_PARAM_LITERAL( "First access to the environment variable " )
+ << var_name << BOOST_RT_PARAM_LITERAL( " should be typed" ) );
+
+ return variable_base( *vd );
+}
+
+//____________________________________________________________________________//
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_ENVIRONMENT_IPP_062904GER
diff --git a/ndnboost/test/utils/runtime/env/fwd.hpp b/ndnboost/test/utils/runtime/env/fwd.hpp
new file mode 100644
index 0000000..b869605
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/fwd.hpp
@@ -0,0 +1,54 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 54633 $
+//
+// Description : environment subsystem forward declarations
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_FWD_HPP_062604GER
+#define BOOST_RT_ENV_FWD_HPP_062604GER
+
+#ifdef UNDER_CE
+#error Windows CE does not support environment variables.
+#endif
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+class variable_base;
+variable_base var( cstring var_name );
+
+namespace rt_env_detail {
+
+struct variable_data;
+
+variable_data& new_var_record( cstring var_name );
+variable_data* find_var_record( cstring var_name );
+
+cstring sys_read_var( cstring var_name );
+void sys_write_var( cstring var_name, format_stream& var_value );
+
+}
+
+template <typename T> class variable;
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_FWD_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/modifier.hpp b/ndnboost/test/utils/runtime/env/modifier.hpp
new file mode 100644
index 0000000..a760368
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/modifier.hpp
@@ -0,0 +1,47 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines variable modifiers
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_MODIFIER_HPP_062604GER
+#define BOOST_RT_ENV_MODIFIER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/named_params.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+// ************************************************************************** //
+// ************** environment variable modifiers ************** //
+// ************************************************************************** //
+
+namespace {
+
+nfp::typed_keyword<cstring,struct global_id_t> global_id;
+nfp::keyword<struct default_value_t> default_value;
+nfp::keyword<struct interpreter_t> interpreter;
+
+} // local namespace
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_MODIFIER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/env/variable.hpp b/ndnboost/test/utils/runtime/env/variable.hpp
new file mode 100644
index 0000000..17a4f39
--- /dev/null
+++ b/ndnboost/test/utils/runtime/env/variable.hpp
@@ -0,0 +1,223 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 81913 $
+//
+// Description : defines model of program environment variable
+// ***************************************************************************
+
+#ifndef BOOST_RT_ENV_VARIABLE_HPP_062604GER
+#define BOOST_RT_ENV_VARIABLE_HPP_062604GER
+
+#ifdef UNDER_CE
+#error Windows CE does not support environment variables.
+#endif
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/fwd.hpp>
+#include <ndnboost/test/utils/runtime/parameter.hpp>
+#include <ndnboost/test/utils/runtime/argument.hpp>
+
+#include <ndnboost/test/utils/runtime/env/fwd.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+// ************************************************************************** //
+// ************** runtime::environment::variable_data ************** //
+// ************************************************************************** //
+
+namespace rt_env_detail {
+
+struct variable_data : public runtime::parameter {
+ cstring m_var_name;
+ dstring m_global_id;
+ argument_ptr m_value;
+};
+
+} // namespace rt_env_detail
+
+// ************************************************************************** //
+// ************** runtime::environment::variable_base ************** //
+// ************************************************************************** //
+
+class variable_base {
+public:
+ explicit variable_base( rt_env_detail::variable_data& data ) : m_data( &data ) {}
+
+ // arguments access
+ template<typename T>
+ T const& value() const
+ {
+ return arg_value<T>( *m_data->m_value );
+ }
+
+ template<typename T>
+ void value( ndnboost::optional<T>& res ) const
+ {
+ if( has_value() )
+ res = arg_value<T>( *m_data->m_value );
+ else
+ res.reset();
+ }
+
+ bool has_value() const { return m_data->m_value!=0; }
+ cstring name() const { return m_data->m_var_name; }
+
+protected:
+ // Data members
+ rt_env_detail::variable_data* m_data;
+} ;
+
+// ************************************************************************** //
+// ************** runtime::environment::variable ************** //
+// ************************************************************************** //
+
+template<typename T = cstring>
+class variable : public variable_base {
+public:
+ // Constructors
+ explicit variable( cstring var_name );
+
+ template<typename Modifiers>
+ explicit variable( cstring var_name, Modifiers const& m );
+
+ explicit variable( rt_env_detail::variable_data& data )
+ : variable_base( data ) {}
+
+ // other variable assignment
+ void operator=( variable const& v ) { m_data = v.m_data; }
+
+ // access methods
+ T const& value() const { return variable_base::value<T>(); }
+
+#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) || \
+ BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x0593))
+ template<typename T>
+ void value( ndnboost::optional<T>& res ) const { variable_base::value( res ); }
+#else
+ using variable_base::value;
+#endif
+
+ // Value assignment
+ template<typename V>
+ void operator=( V const& v )
+ {
+ if( !has_value() )
+ m_data->m_value.reset( new typed_argument<T>( *m_data ) );
+
+ arg_value<T>( *m_data->m_value ) = v;
+
+ rt_env_detail::sys_write_var( m_data->m_var_name, format_stream().ref() << value() );
+ }
+}; // class variable
+
+//____________________________________________________________________________//
+
+template<typename CharT, typename Tr,typename T>
+inline std::basic_ostream<CharT,Tr>&
+operator<<( std::basic_ostream<CharT,Tr>& os, variable<T> const& v )
+{
+ os << v.name() << '=';
+
+ if( v.has_value() )
+ os << v.value();
+
+ return os;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator==( variable<T> ev, V const& v )
+{
+ return ev.has_value() && ev.value() == v;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator==( V const& v, variable<T> ev )
+{
+ return ev.has_value() && ev.value() == v;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator!=( variable<T> ev, V const& v )
+{
+ return !ev.has_value() || ev.value() != v;
+}
+
+//____________________________________________________________________________//
+
+template<typename T, typename V>
+inline bool
+operator!=( V const& v, variable<T> ev )
+{
+ return !ev.has_value() || ev.value() != v;
+}
+
+//____________________________________________________________________________//
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+// ************************************************************************** //
+// ************************************************************************** //
+// Implementation
+
+#include <ndnboost/test/utils/runtime/env/environment.hpp>
+
+// ************************************************************************** //
+// ************** runtime::environment::variable ************** //
+// ************************************************************************** //
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+namespace environment {
+
+template<typename T>
+variable<T>::variable( cstring var_name )
+: variable_base( environment::var<T>( var_name ) )
+{}
+
+//____________________________________________________________________________//
+
+template<typename T>
+template<typename Modifiers>
+variable<T>::variable( cstring var_name, Modifiers const& m )
+: variable_base( environment::var<T>( var_name, m ) )
+{}
+
+//____________________________________________________________________________//
+
+} // namespace environment
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_ENV_VARIABLE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/fwd.hpp b/ndnboost/test/utils/runtime/fwd.hpp
new file mode 100644
index 0000000..3714bfc
--- /dev/null
+++ b/ndnboost/test/utils/runtime/fwd.hpp
@@ -0,0 +1,41 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : global framework level forward declaration
+// ***************************************************************************
+
+#ifndef BOOST_RT_FWD_HPP_062604GER
+#define BOOST_RT_FWD_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+class parameter;
+
+class argument;
+typedef shared_ptr<argument> argument_ptr;
+typedef shared_ptr<argument const> const_argument_ptr;
+
+template<typename T> class value_interpreter;
+template<typename T> class typed_argument;
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_FWD_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/interpret_argument_value.hpp b/ndnboost/test/utils/runtime/interpret_argument_value.hpp
new file mode 100644
index 0000000..4f5a214
--- /dev/null
+++ b/ndnboost/test/utils/runtime/interpret_argument_value.hpp
@@ -0,0 +1,163 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : default algorithms for string to specific type convertions
+// ***************************************************************************
+
+#ifndef BOOST_RT_INTERPRET_ARGUMENT_VALUE_HPP_062604GER
+#define BOOST_RT_INTERPRET_ARGUMENT_VALUE_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+#include <ndnboost/test/utils/runtime/trace.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+#include <ndnboost/test/utils/basic_cstring/compare.hpp>
+
+// Boost
+#include <ndnboost/optional.hpp>
+#include <ndnboost/lexical_cast.hpp>
+
+// STL
+// !! could we eliminate these includes?
+#include <list>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// ************** runtime::interpret_argument_value ************** //
+// ************************************************************************** //
+// returns true if source is used false otherwise
+
+// generic case
+template<typename T>
+struct interpret_argument_value_impl {
+ static bool _( cstring source, ndnboost::optional<T>& res )
+ {
+ BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<" << typeid(T).name() << ">" );
+
+ res = lexical_cast<T>( source );
+
+ BOOST_RT_PARAM_TRACE( "String " << source << " is interpreted as " << *res );
+ return true;
+ }
+};
+
+
+//____________________________________________________________________________//
+
+// dstring case
+template<>
+struct interpret_argument_value_impl<dstring> {
+ static bool _( cstring source, ndnboost::optional<dstring>& res )
+ {
+ BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<dstring>" );
+
+ res = dstring();
+ assign_op( *res, source, 0 );
+
+ return true;
+ }
+};
+
+//____________________________________________________________________________//
+
+// cstring case
+template<>
+struct interpret_argument_value_impl<cstring> {
+ static bool _( cstring source, ndnboost::optional<cstring>& res )
+ {
+ BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<cstring>" );
+
+ res = source;
+
+ return true;
+ }
+};
+
+//____________________________________________________________________________//
+
+// specialization for type bool
+template<>
+struct interpret_argument_value_impl<bool> {
+ static bool _( cstring source, ndnboost::optional<bool>& res )
+ {
+ BOOST_RT_PARAM_TRACE( "In interpret_argument_value_impl<bool>" );
+
+ static literal_cstring YES( BOOST_RT_PARAM_CSTRING_LITERAL( "YES" ) );
+ static literal_cstring Y( BOOST_RT_PARAM_CSTRING_LITERAL( "Y" ) );
+ static literal_cstring NO( BOOST_RT_PARAM_CSTRING_LITERAL( "NO" ) );
+ static literal_cstring N( BOOST_RT_PARAM_CSTRING_LITERAL( "N" ) );
+ static literal_cstring one( BOOST_RT_PARAM_CSTRING_LITERAL( "1" ) );
+ static literal_cstring zero( BOOST_RT_PARAM_CSTRING_LITERAL( "0" ) );
+
+ source.trim();
+
+ if( case_ins_eq( source, YES ) || case_ins_eq( source, Y ) || case_ins_eq( source, one ) ) {
+ res = true;
+ return true;
+ }
+ else if( case_ins_eq( source, NO ) || case_ins_eq( source, N ) || case_ins_eq( source, zero ) ) {
+ res = false;
+ return true;
+ }
+ else {
+ res = true;
+ return false;
+ }
+ }
+};
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline bool
+interpret_argument_value( cstring source, ndnboost::optional<T>& res, long )
+{
+ return interpret_argument_value_impl<T>::_( source, res );
+}
+
+//____________________________________________________________________________//
+
+// specialization for list of values
+template<typename T>
+inline bool
+interpret_argument_value( cstring source, ndnboost::optional<std::list<T> >& res, int )
+{
+ BOOST_RT_PARAM_TRACE( "In interpret_argument_value<std::list<T>>" );
+
+ res = std::list<T>();
+
+ while( !source.is_empty() ) {
+ // !! should we use token_iterator
+ cstring::iterator single_value_end = std::find( source.begin(), source.end(), BOOST_RT_PARAM_LITERAL( ',' ) );
+
+ ndnboost::optional<T> value;
+ interpret_argument_value( cstring( source.begin(), single_value_end ), value, 0 );
+
+ res->push_back( *value );
+
+ source.trim_left( single_value_end + 1 );
+ }
+
+ return true;
+}
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_INTERPRET_ARGUMENT_VALUE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/parameter.hpp b/ndnboost/test/utils/runtime/parameter.hpp
new file mode 100644
index 0000000..2f6d1b7
--- /dev/null
+++ b/ndnboost/test/utils/runtime/parameter.hpp
@@ -0,0 +1,38 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : abstract interface for the formal parameter
+// ***************************************************************************
+
+#ifndef BOOST_RT_PARAMETER_HPP_062604GER
+#define BOOST_RT_PARAMETER_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// ************** runtime::parameter ************** //
+// ************************************************************************** //
+
+class parameter {
+public:
+ virtual ~parameter() {}
+};
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_PARAMETER_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/trace.hpp b/ndnboost/test/utils/runtime/trace.hpp
new file mode 100644
index 0000000..c71eb8e
--- /dev/null
+++ b/ndnboost/test/utils/runtime/trace.hpp
@@ -0,0 +1,30 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : optional internal tracing
+// ***************************************************************************
+
+#ifndef BOOST_RT_TRACE_HPP_062604GER
+#define BOOST_RT_TRACE_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+#ifdef BOOST_RT_PARAM_DEBUG
+
+#include <iostream>
+
+# define BOOST_RT_PARAM_TRACE( str ) std::cerr << str << std::endl
+#else
+# define BOOST_RT_PARAM_TRACE( str )
+#endif
+
+#endif // BOOST_RT_TRACE_HPP_062604GER
diff --git a/ndnboost/test/utils/runtime/validation.hpp b/ndnboost/test/utils/runtime/validation.hpp
new file mode 100644
index 0000000..e794df9
--- /dev/null
+++ b/ndnboost/test/utils/runtime/validation.hpp
@@ -0,0 +1,82 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : defines exceptions and validation tools
+// ***************************************************************************
+
+#ifndef BOOST_RT_VALIDATION_HPP_062604GER
+#define BOOST_RT_VALIDATION_HPP_062604GER
+
+// Boost.Runtime.Parameter
+#include <ndnboost/test/utils/runtime/config.hpp>
+
+// Boost.Test
+#include <ndnboost/test/utils/class_properties.hpp>
+
+// Boost
+#include <ndnboost/shared_ptr.hpp>
+
+// STL
+#ifdef BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
+#include <stdexcept>
+#endif
+
+namespace ndnboost {
+
+namespace BOOST_RT_PARAM_NAMESPACE {
+
+// ************************************************************************** //
+// ************** runtime::logic_error ************** //
+// ************************************************************************** //
+
+class logic_error
+#ifdef BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
+: public std::exception
+#endif
+{
+ typedef shared_ptr<dstring> dstring_ptr;
+public:
+ // Constructor // !! could we eliminate shared_ptr
+ explicit logic_error( cstring msg ) : m_msg( new dstring( msg.begin(), msg.size() ) ) {}
+ ~logic_error() throw() {}
+
+ dstring const& msg() const { return *m_msg; }
+ virtual char_type const* what() const throw() { return m_msg->c_str(); }
+
+private:
+ dstring_ptr m_msg;
+};
+
+// ************************************************************************** //
+// ************** runtime::report_logic_error ************** //
+// ************************************************************************** //
+
+inline void
+report_logic_error( format_stream& msg )
+{
+ throw BOOST_RT_PARAM_NAMESPACE::logic_error( msg.str() );
+}
+
+//____________________________________________________________________________//
+
+#define BOOST_RT_PARAM_REPORT_LOGIC_ERROR( msg ) \
+ ndnboost::BOOST_RT_PARAM_NAMESPACE::report_logic_error( format_stream().ref() << msg )
+
+#define BOOST_RT_PARAM_VALIDATE_LOGIC( b, msg ) \
+ if( b ) {} else BOOST_RT_PARAM_REPORT_LOGIC_ERROR( msg )
+
+//____________________________________________________________________________//
+
+} // namespace BOOST_RT_PARAM_NAMESPACE
+
+} // namespace ndnboost
+
+#endif // BOOST_RT_VALIDATION_HPP_062604GER
diff --git a/ndnboost/test/utils/trivial_singleton.hpp b/ndnboost/test/utils/trivial_singleton.hpp
new file mode 100644
index 0000000..6fba5c9
--- /dev/null
+++ b/ndnboost/test/utils/trivial_singleton.hpp
@@ -0,0 +1,74 @@
+// (C) Copyright Gennadiy Rozental 2005-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : simple helpers for creating cusom output manipulators
+// ***************************************************************************
+
+#ifndef BOOST_TEST_TRIVIAL_SIGNLETON_HPP_020505GER
+#define BOOST_TEST_TRIVIAL_SIGNLETON_HPP_020505GER
+
+#include <ndnboost/config.hpp>
+#include <ndnboost/detail/workaround.hpp>
+
+#include <ndnboost/noncopyable.hpp>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** singleton ************** //
+// ************************************************************************** //
+
+template<typename Derived>
+class singleton : private ndnboost::noncopyable {
+public:
+ static Derived& instance() { static Derived the_inst; return the_inst; }
+protected:
+ singleton() {}
+ ~singleton() {}
+};
+
+} // namespace unit_test
+
+#define BOOST_TEST_SINGLETON_CONS( type ) \
+friend class ndnboost::unit_test::singleton<type>; \
+type() {} \
+/**/
+
+#if BOOST_WORKAROUND(__DECCXX_VER, BOOST_TESTED_AT(60590042))
+
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+template class unit_test::singleton< BOOST_JOIN( inst, _t ) > ; \
+namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); }
+
+#elif defined(__APPLE_CC__) && defined(__GNUC__) && __GNUC__ < 4
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+static BOOST_JOIN( inst, _t)& inst = BOOST_JOIN (inst, _t)::instance();
+
+#else
+
+#define BOOST_TEST_SINGLETON_INST( inst ) \
+namespace { BOOST_JOIN( inst, _t)& inst = BOOST_JOIN( inst, _t)::instance(); }
+
+#endif
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_TRIVIAL_SIGNLETON_HPP_020505GER
diff --git a/ndnboost/test/utils/wrap_stringstream.hpp b/ndnboost/test/utils/wrap_stringstream.hpp
new file mode 100644
index 0000000..bd112e9
--- /dev/null
+++ b/ndnboost/test/utils/wrap_stringstream.hpp
@@ -0,0 +1,164 @@
+// (C) Copyright Gennadiy Rozental 2002-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 49312 $
+//
+// Description : wraps strstream and stringstream (depends with one is present)
+// to provide the unified interface
+// ***************************************************************************
+
+#ifndef BOOST_WRAP_STRINGSTREAM_HPP_071894GER
+#define BOOST_WRAP_STRINGSTREAM_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/detail/config.hpp>
+
+// STL
+#ifdef BOOST_NO_STRINGSTREAM
+#include <strstream> // for std::ostrstream
+#else
+#include <sstream> // for std::ostringstream
+#endif // BOOST_NO_STRINGSTREAM
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+// ************************************************************************** //
+// ************** basic_wrap_stringstream ************** //
+// ************************************************************************** //
+
+template<typename CharT>
+class basic_wrap_stringstream {
+public:
+#if defined(BOOST_CLASSIC_IOSTREAMS)
+ typedef std::ostringstream wrapped_stream;
+#elif defined(BOOST_NO_STRINGSTREAM)
+ typedef std::basic_ostrstream<CharT> wrapped_stream;
+#else
+ typedef std::basic_ostringstream<CharT> wrapped_stream;
+#endif // BOOST_NO_STRINGSTREAM
+ // Access methods
+ basic_wrap_stringstream& ref();
+ wrapped_stream& stream();
+ std::basic_string<CharT> const& str();
+
+private:
+ // Data members
+ wrapped_stream m_stream;
+ std::basic_string<CharT> m_str;
+};
+
+//____________________________________________________________________________//
+
+template <typename CharT, typename T>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, T const& t )
+{
+ targ.stream() << t;
+ return targ;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline typename basic_wrap_stringstream<CharT>::wrapped_stream&
+basic_wrap_stringstream<CharT>::stream()
+{
+ return m_stream;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline basic_wrap_stringstream<CharT>&
+basic_wrap_stringstream<CharT>::ref()
+{
+ return *this;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline std::basic_string<CharT> const&
+basic_wrap_stringstream<CharT>::str()
+{
+
+#ifdef BOOST_NO_STRINGSTREAM
+ m_str.assign( m_stream.str(), m_stream.pcount() );
+ m_stream.freeze( false );
+#else
+ m_str = m_stream.str();
+#endif
+
+ return m_str;
+}
+
+//____________________________________________________________________________//
+
+template <typename CharT>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, basic_wrap_stringstream<CharT>& src )
+{
+ targ << src.str();
+ return targ;
+}
+
+//____________________________________________________________________________//
+
+#if BOOST_TEST_USE_STD_LOCALE
+
+template <typename CharT>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, std::ios_base& (BOOST_TEST_CALL_DECL *man)(std::ios_base&) )
+{
+ targ.stream() << man;
+ return targ;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT,typename Elem,typename Tr>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, std::basic_ostream<Elem,Tr>& (BOOST_TEST_CALL_DECL *man)(std::basic_ostream<Elem, Tr>&) )
+{
+ targ.stream() << man;
+ return targ;
+}
+
+//____________________________________________________________________________//
+
+template<typename CharT,typename Elem,typename Tr>
+inline basic_wrap_stringstream<CharT>&
+operator<<( basic_wrap_stringstream<CharT>& targ, std::basic_ios<Elem, Tr>& (BOOST_TEST_CALL_DECL *man)(std::basic_ios<Elem, Tr>&) )
+{
+ targ.stream() << man;
+ return targ;
+}
+
+//____________________________________________________________________________//
+
+#endif
+
+// ************************************************************************** //
+// ************** wrap_stringstream ************** //
+// ************************************************************************** //
+
+typedef basic_wrap_stringstream<char> wrap_stringstream;
+typedef basic_wrap_stringstream<wchar_t> wrap_wstringstream;
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_WRAP_STRINGSTREAM_HPP_071894GER
diff --git a/ndnboost/test/utils/xml_printer.hpp b/ndnboost/test/utils/xml_printer.hpp
new file mode 100644
index 0000000..58ecc6b
--- /dev/null
+++ b/ndnboost/test/utils/xml_printer.hpp
@@ -0,0 +1,118 @@
+// (C) Copyright Gennadiy Rozental 2004-2008.
+// 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)
+
+// See http://www.boost.org/libs/test for the library home page.
+//
+// File : $RCSfile$
+//
+// Version : $Revision: 57992 $
+//
+// Description : common code used by any agent serving as XML printer
+// ***************************************************************************
+
+#ifndef BOOST_TEST_XML_PRINTER_HPP_071894GER
+#define BOOST_TEST_XML_PRINTER_HPP_071894GER
+
+// Boost.Test
+#include <ndnboost/test/utils/basic_cstring/basic_cstring.hpp>
+#include <ndnboost/test/utils/fixed_mapping.hpp>
+#include <ndnboost/test/utils/custom_manip.hpp>
+#include <ndnboost/test/utils/foreach.hpp>
+#include <ndnboost/test/utils/basic_cstring/io.hpp>
+
+// Boost
+#include <ndnboost/config.hpp>
+
+// STL
+#include <iostream>
+
+#include <ndnboost/test/detail/suppress_warnings.hpp>
+
+//____________________________________________________________________________//
+
+namespace ndnboost {
+
+namespace unit_test {
+
+// ************************************************************************** //
+// ************** xml print helpers ************** //
+// ************************************************************************** //
+
+inline void
+print_escaped( std::ostream& where_to, const_string value )
+{
+ static fixed_mapping<char,char const*> char_type(
+ '<' , "lt",
+ '>' , "gt",
+ '&' , "amp",
+ '\'', "apos" ,
+ '"' , "quot",
+
+ 0
+ );
+
+ BOOST_TEST_FOREACH( char, c, value ) {
+ char const* ref = char_type[c];
+
+ if( ref )
+ where_to << '&' << ref << ';';
+ else
+ where_to << c;
+ }
+}
+
+//____________________________________________________________________________//
+
+inline void
+print_escaped( std::ostream& where_to, std::string const& value )
+{
+ print_escaped( where_to, const_string( value ) );
+}
+
+//____________________________________________________________________________//
+
+template<typename T>
+inline void
+print_escaped( std::ostream& where_to, T const& value )
+{
+ where_to << value;
+}
+
+//____________________________________________________________________________//
+
+typedef custom_manip<struct attr_value_t> attr_value;
+
+template<typename T>
+inline std::ostream&
+operator<<( custom_printer<attr_value> const& p, T const& value )
+{
+ *p << "=\"";
+ print_escaped( *p, value );
+ *p << '"';
+
+ return *p;
+}
+
+//____________________________________________________________________________//
+
+typedef custom_manip<struct cdata_t> cdata;
+
+inline std::ostream&
+operator<<( custom_printer<cdata> const& p, const_string value )
+{
+ return *p << BOOST_TEST_L( "<![CDATA[" ) << value << BOOST_TEST_L( "]]>" );
+}
+
+//____________________________________________________________________________//
+
+} // namespace unit_test
+
+} // namespace ndnboost
+
+//____________________________________________________________________________//
+
+#include <ndnboost/test/detail/enable_warnings.hpp>
+
+#endif // BOOST_TEST_XML_PRINTER_HPP_071894GER
diff --git a/ndnboost/timer.hpp b/ndnboost/timer.hpp
new file mode 100644
index 0000000..95ca7b0
--- /dev/null
+++ b/ndnboost/timer.hpp
@@ -0,0 +1,72 @@
+// boost timer.hpp header file ---------------------------------------------//
+
+// Copyright Beman Dawes 1994-99. 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)
+
+// See http://www.boost.org/libs/timer for documentation.
+
+// Revision History
+// 01 Apr 01 Modified to use new <ndnboost/limits.hpp> header. (JMaddock)
+// 12 Jan 01 Change to inline implementation to allow use without library
+// builds. See docs for more rationale. (Beman Dawes)
+// 25 Sep 99 elapsed_max() and elapsed_min() added (John Maddock)
+// 16 Jul 99 Second beta
+// 6 Jul 99 Initial boost version
+
+#ifndef BOOST_TIMER_HPP
+#define BOOST_TIMER_HPP
+
+#include <ndnboost/config.hpp>
+#include <ctime>
+#include <ndnboost/limits.hpp>
+
+# ifdef BOOST_NO_STDC_NAMESPACE
+ namespace std { using ::clock_t; using ::clock; }
+# endif
+
+
+namespace ndnboost {
+
+// timer -------------------------------------------------------------------//
+
+// A timer object measures elapsed time.
+
+// It is recommended that implementations measure wall clock rather than CPU
+// time since the intended use is performance measurement on systems where
+// total elapsed time is more important than just process or CPU time.
+
+// Warnings: The maximum measurable elapsed time may well be only 596.5+ hours
+// due to implementation limitations. The accuracy of timings depends on the
+// accuracy of timing information provided by the underlying platform, and
+// this varies a great deal from platform to platform.
+
+class timer
+{
+ public:
+ timer() { _start_time = std::clock(); } // postcondition: elapsed()==0
+// timer( const timer& src ); // post: elapsed()==src.elapsed()
+// ~timer(){}
+// timer& operator=( const timer& src ); // post: elapsed()==src.elapsed()
+ void restart() { _start_time = std::clock(); } // post: elapsed()==0
+ double elapsed() const // return elapsed time in seconds
+ { return double(std::clock() - _start_time) / CLOCKS_PER_SEC; }
+
+ double elapsed_max() const // return estimated maximum value for elapsed()
+ // Portability warning: elapsed_max() may return too high a value on systems
+ // where std::clock_t overflows or resets at surprising values.
+ {
+ return (double((std::numeric_limits<std::clock_t>::max)())
+ - double(_start_time)) / double(CLOCKS_PER_SEC);
+ }
+
+ double elapsed_min() const // return minimum value for elapsed()
+ { return double(1)/double(CLOCKS_PER_SEC); }
+
+ private:
+ std::clock_t _start_time;
+}; // timer
+
+} // namespace ndnboost
+
+#endif // BOOST_TIMER_HPP
diff --git a/ndnboost/type_traits/conversion_traits.hpp b/ndnboost/type_traits/conversion_traits.hpp
new file mode 100644
index 0000000..589c617
--- /dev/null
+++ b/ndnboost/type_traits/conversion_traits.hpp
@@ -0,0 +1,17 @@
+
+// Copyright 2000 John Maddock (john@johnmaddock.co.uk)
+// Copyright 2000 Jeremy Siek (jsiek@lsc.nd.edu)
+// Copyright 1999, 2000 Jaakko Jarvi (jaakko.jarvi@cs.utu.fi)
+//
+// 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).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+#ifndef BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED
+#define BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED
+
+#include <ndnboost/type_traits/is_convertible.hpp>
+
+#endif // BOOST_TT_CONVERSION_TRAITS_HPP_INCLUDED
diff --git a/ndnboost/type_traits/object_traits.hpp b/ndnboost/type_traits/object_traits.hpp
new file mode 100644
index 0000000..a13a998
--- /dev/null
+++ b/ndnboost/type_traits/object_traits.hpp
@@ -0,0 +1,33 @@
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// 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).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+//
+// defines object traits classes:
+// is_object, is_scalar, is_class, is_compound, is_pod,
+// has_trivial_constructor, has_trivial_copy, has_trivial_assign,
+// has_trivial_destructor, is_empty.
+//
+
+#ifndef BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED
+#define BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED
+
+#include <ndnboost/type_traits/has_trivial_assign.hpp>
+#include <ndnboost/type_traits/has_trivial_constructor.hpp>
+#include <ndnboost/type_traits/has_trivial_copy.hpp>
+#include <ndnboost/type_traits/has_trivial_destructor.hpp>
+#include <ndnboost/type_traits/has_nothrow_constructor.hpp>
+#include <ndnboost/type_traits/has_nothrow_copy.hpp>
+#include <ndnboost/type_traits/has_nothrow_assign.hpp>
+#include <ndnboost/type_traits/is_base_and_derived.hpp>
+#include <ndnboost/type_traits/is_class.hpp>
+#include <ndnboost/type_traits/is_compound.hpp>
+#include <ndnboost/type_traits/is_empty.hpp>
+#include <ndnboost/type_traits/is_object.hpp>
+#include <ndnboost/type_traits/is_pod.hpp>
+#include <ndnboost/type_traits/is_scalar.hpp>
+#include <ndnboost/type_traits/is_stateless.hpp>
+
+#endif // BOOST_TT_OBJECT_TRAITS_HPP_INLCUDED
diff --git a/ndnboost/type_traits/same_traits.hpp b/ndnboost/type_traits/same_traits.hpp
new file mode 100644
index 0000000..ece4b42
--- /dev/null
+++ b/ndnboost/type_traits/same_traits.hpp
@@ -0,0 +1,15 @@
+// (C) Copyright Steve Cleary, Beman Dawes, Aleksey Gurtovoy, Howard Hinnant & John Maddock 2000.
+// 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).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+//
+// defines is_same:
+
+#ifndef BOOST_TT_SAME_TRAITS_HPP_INCLUDED
+#define BOOST_TT_SAME_TRAITS_HPP_INCLUDED
+
+#include <ndnboost/type_traits/is_same.hpp>
+
+#endif // BOOST_TT_SAME_TRAITS_HPP_INCLUDED
diff --git a/ndnboost/type_traits/transform_traits.hpp b/ndnboost/type_traits/transform_traits.hpp
new file mode 100644
index 0000000..be4ccf5
--- /dev/null
+++ b/ndnboost/type_traits/transform_traits.hpp
@@ -0,0 +1,21 @@
+// (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000.
+// 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).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+//
+// defines traits classes for transforming one type to another:
+// remove_reference, add_reference, remove_bounds, remove_pointer.
+//
+
+#ifndef BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED
+#define BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED
+
+#include <ndnboost/type_traits/add_pointer.hpp>
+#include <ndnboost/type_traits/add_reference.hpp>
+#include <ndnboost/type_traits/remove_bounds.hpp>
+#include <ndnboost/type_traits/remove_pointer.hpp>
+#include <ndnboost/type_traits/remove_reference.hpp>
+
+#endif // BOOST_TT_TRANSFORM_TRAITS_HPP_INCLUDED
diff --git a/ndnboost/typeof/std/memory.hpp b/ndnboost/typeof/std/memory.hpp
deleted file mode 100644
index e002dba..0000000
--- a/ndnboost/typeof/std/memory.hpp
+++ /dev/null
@@ -1,17 +0,0 @@
-// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
-// Use, modification and distribution is subject to the Boost Software
-// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_TYPEOF_STD_memory_hpp_INCLUDED
-#define BOOST_TYPEOF_STD_memory_hpp_INCLUDED
-
-#include <memory>
-#include <ndnboost/typeof/typeof.hpp>
-
-#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::allocator, 1)
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::raw_storage_iterator, 2)
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::auto_ptr, 1)
-
-#endif//BOOST_TYPEOF_STD_memory_hpp_INCLUDED
diff --git a/ndnboost/typeof/std/string.hpp b/ndnboost/typeof/std/string.hpp
deleted file mode 100644
index 210c9e7..0000000
--- a/ndnboost/typeof/std/string.hpp
+++ /dev/null
@@ -1,24 +0,0 @@
-// Copyright (C) 2005 Arkadiy Vertleyb, Peder Holt.
-// Use, modification and distribution is subject to the Boost Software
-// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
-
-#ifndef BOOST_TYPEOF_STD_string_hpp_INCLUDED
-#define BOOST_TYPEOF_STD_string_hpp_INCLUDED
-
-#include <string>
-#include <ndnboost/typeof/typeof.hpp>
-#include <ndnboost/typeof/std/memory.hpp>
-
-#include BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()
-
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::char_traits, 1)
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 1)
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 2)
-BOOST_TYPEOF_REGISTER_TEMPLATE(std::basic_string, 3)
-
-#ifndef __BORLANDC__
-//Borland chokes on this "double definition" of string
-BOOST_TYPEOF_REGISTER_TYPE(std::string)
-#endif
-
-#endif//BOOST_TYPEOF_STD_string_hpp_INCLUDED
diff --git a/ndnboost/units/detail/utility.hpp b/ndnboost/units/detail/utility.hpp
new file mode 100644
index 0000000..47946be
--- /dev/null
+++ b/ndnboost/units/detail/utility.hpp
@@ -0,0 +1,104 @@
+// Boost.Units - A C++ library for zero-overhead dimensional analysis and
+// unit/quantity manipulation and conversion
+//
+// Copyright (C) 2003-2008 Matthias Christian Schabel
+// Copyright (C) 2008 Steven Watanabe
+//
+// 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)
+
+#ifndef BOOST_UNITS_UTILITY_HPP
+#define BOOST_UNITS_UTILITY_HPP
+
+#include <cstdlib>
+#include <typeinfo>
+#include <string>
+
+#if defined(__GLIBCXX__) || defined(__GLIBCPP__)
+#define BOOST_UNITS_USE_DEMANGLING
+#include <cxxabi.h>
+#endif // __GNUC__
+
+#ifdef BOOST_UNITS_USE_DEMANGLING
+
+#include <ndnboost/algorithm/string/replace.hpp>
+
+namespace ndnboost {
+
+namespace units {
+
+namespace detail {
+
+inline
+std::string
+demangle(const char* name)
+{
+ // need to demangle C++ symbols
+ char* realname;
+ std::size_t len;
+ int stat;
+
+ realname = abi::__cxa_demangle(name,NULL,&len,&stat);
+
+ if (realname != NULL)
+ {
+ std::string out(realname);
+
+ std::free(realname);
+
+ ndnboost::replace_all(out,"ndnboost::units::","");
+
+ return out;
+ }
+
+ return std::string("demangle :: error - unable to demangle specified symbol");
+}
+
+} // namespace detail
+
+template<class L>
+std::string simplify_typename(const L& /*source*/)
+{
+ const std::string demangled = detail::demangle(typeid(L).name());
+
+ return demangled;
+}
+
+} // namespace units
+
+} // namespace ndnboost
+
+#else // BOOST_UNITS_USE_DEMANGLING
+
+namespace ndnboost {
+
+namespace units {
+
+namespace detail {
+
+inline
+std::string
+demangle(const char* name)
+{
+ return name;
+}
+
+} // namespace detail
+
+template<class L>
+std::string simplify_typename(const L& /*source*/)
+{
+ return std::string(typeid(L).name());
+}
+
+} // namespace units
+
+} // namespace ndnboost
+
+// To get system-specific predefined macros:
+// gcc -arch ppc -dM -E - < /dev/null | sort
+
+#endif // BOOST_UNITS_USE_DEMANGLING
+
+#endif // BOOST_UNITS_UTILITY_HPP
diff --git a/ndnboost/utility.hpp b/ndnboost/utility.hpp
new file mode 100644
index 0000000..7e3e60e
--- /dev/null
+++ b/ndnboost/utility.hpp
@@ -0,0 +1,21 @@
+// Boost utility.hpp header file -------------------------------------------//
+
+// Copyright 1999-2003 Aleksey Gurtovoy. Use, modification, and distribution are
+// subject to the Boost Software License, Version 1.0. (See accompanying file
+// LICENSE_1_0.txt or a copy at <http://www.boost.org/LICENSE_1_0.txt>.)
+
+// See <http://www.boost.org/libs/utility/> for the library's home page.
+
+#ifndef BOOST_UTILITY_HPP
+#define BOOST_UTILITY_HPP
+
+#include <ndnboost/utility/addressof.hpp>
+#include <ndnboost/utility/base_from_member.hpp>
+#include <ndnboost/utility/binary.hpp>
+#include <ndnboost/utility/enable_if.hpp>
+#include <ndnboost/utility/identity_type.hpp>
+#include <ndnboost/checked_delete.hpp>
+#include <ndnboost/next_prior.hpp>
+#include <ndnboost/noncopyable.hpp>
+
+#endif // BOOST_UTILITY_HPP
diff --git a/ndnboost/utility/base_from_member.hpp b/ndnboost/utility/base_from_member.hpp
new file mode 100644
index 0000000..7091f02
--- /dev/null
+++ b/ndnboost/utility/base_from_member.hpp
@@ -0,0 +1,87 @@
+// boost utility/base_from_member.hpp header file --------------------------//
+
+// Copyright 2001, 2003, 2004 Daryle Walker. Use, modification, and
+// distribution are subject to the Boost Software License, Version 1.0. (See
+// accompanying file LICENSE_1_0.txt or a copy at
+// <http://www.boost.org/LICENSE_1_0.txt>.)
+
+// See <http://www.boost.org/libs/utility/> for the library's home page.
+
+#ifndef BOOST_UTILITY_BASE_FROM_MEMBER_HPP
+#define BOOST_UTILITY_BASE_FROM_MEMBER_HPP
+
+#include <ndnboost/preprocessor/arithmetic/inc.hpp>
+#include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/preprocessor/repetition/repeat_from_to.hpp>
+
+
+// Base-from-member arity configuration macro ------------------------------//
+
+// The following macro determines how many arguments will be in the largest
+// constructor template of base_from_member. Constructor templates will be
+// generated from one argument to this maximum. Code from other files can read
+// this number if they need to always match the exact maximum base_from_member
+// uses. The maximum constructor length can be changed by overriding the
+// #defined constant. Make sure to apply the override, if any, for all source
+// files during project compiling for consistency.
+
+// Contributed by Jonathan Turkanis
+
+#ifndef BOOST_BASE_FROM_MEMBER_MAX_ARITY
+#define BOOST_BASE_FROM_MEMBER_MAX_ARITY 10
+#endif
+
+
+// An iteration of a constructor template for base_from_member -------------//
+
+// A macro that should expand to:
+// template < typename T1, ..., typename Tn >
+// base_from_member( T1 x1, ..., Tn xn )
+// : member( x1, ..., xn )
+// {}
+// This macro should only persist within this file.
+
+#define BOOST_PRIVATE_CTR_DEF( z, n, data ) \
+ template < BOOST_PP_ENUM_PARAMS(n, typename T) > \
+ explicit base_from_member( BOOST_PP_ENUM_BINARY_PARAMS(n, T, x) ) \
+ : member( BOOST_PP_ENUM_PARAMS(n, x) ) \
+ {} \
+ /**/
+
+
+namespace ndnboost
+{
+
+// Base-from-member class template -----------------------------------------//
+
+// Helper to initialize a base object so a derived class can use this
+// object in the initialization of another base class. Used by
+// Dietmar Kuehl from ideas by Ron Klatcho to solve the problem of a
+// base class needing to be initialized by a member.
+
+// Contributed by Daryle Walker
+
+template < typename MemberType, int UniqueID = 0 >
+class base_from_member
+{
+protected:
+ MemberType member;
+
+ base_from_member()
+ : member()
+ {}
+
+ BOOST_PP_REPEAT_FROM_TO( 1, BOOST_PP_INC(BOOST_BASE_FROM_MEMBER_MAX_ARITY),
+ BOOST_PRIVATE_CTR_DEF, _ )
+
+}; // ndnboost::base_from_member
+
+} // namespace ndnboost
+
+
+// Undo any private macros
+#undef BOOST_PRIVATE_CTR_DEF
+
+
+#endif // BOOST_UTILITY_BASE_FROM_MEMBER_HPP
diff --git a/ndnboost/utility/binary.hpp b/ndnboost/utility/binary.hpp
new file mode 100644
index 0000000..4ea209f
--- /dev/null
+++ b/ndnboost/utility/binary.hpp
@@ -0,0 +1,708 @@
+/*=============================================================================
+ Copyright (c) 2005 Matthew Calabrese
+
+ 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)
+==============================================================================*/
+
+#ifndef BOOST_UTILITY_BINARY_HPP
+#define BOOST_UTILITY_BINARY_HPP
+
+/*=============================================================================
+
+ Binary Literal Utility
+ ______________________
+
+
+ The following code works by converting the input bit pattern into a
+ Boost.Preprocessor sequence, then converting groupings of 3 bits each into
+ the corresponding octal digit, and finally concatenating all of the digits
+ together along with a leading zero. This yields a standard octal literal
+ with the desired value as specified in bits.
+
+==============================================================================*/
+
+#include <ndnboost/preprocessor/control/deduce_d.hpp>
+#include <ndnboost/preprocessor/facilities/identity.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/seq/cat.hpp>
+#include <ndnboost/preprocessor/seq/transform.hpp>
+#include <ndnboost/preprocessor/arithmetic/mod.hpp>
+#include <ndnboost/preprocessor/seq/size.hpp>
+#include <ndnboost/preprocessor/facilities/empty.hpp>
+#include <ndnboost/preprocessor/control/while.hpp>
+
+#define BOOST_BINARY( bit_groupings ) \
+ BOOST_BINARY_LITERAL_D( BOOST_PP_DEDUCE_D(), bit_groupings )
+
+#define BOOST_BINARY_U( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, U )
+
+#define BOOST_BINARY_L( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, L )
+
+#define BOOST_BINARY_UL( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, UL )
+
+#define BOOST_BINARY_LU( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, LU )
+
+#define BOOST_BINARY_LL( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, LL )
+
+#define BOOST_BINARY_ULL( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, ULL )
+
+#define BOOST_BINARY_LLU( bit_groupings ) \
+ BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, LLU )
+
+#define BOOST_SUFFIXED_BINARY_LITERAL( bit_groupings, suffix ) \
+ BOOST_SUFFIXED_BINARY_LITERAL_D( BOOST_PP_DEDUCE_D(), bit_groupings, suffix )
+
+#define BOOST_SUFFIXED_BINARY_LITERAL_D( d, bit_groupings, suffix ) \
+ BOOST_PP_CAT( BOOST_BINARY_LITERAL_D( d, bit_groupings ), suffix )
+
+#define BOOST_BINARY_LITERAL_D( d, bit_groupings ) \
+ BOOST_PP_SEQ_CAT \
+ ( (0) BOOST_DETAIL_CREATE_BINARY_LITERAL_OCTAL_SEQUENCE( d, bit_groupings ) \
+ )
+
+#define BOOST_DETAIL_CREATE_BINARY_LITERAL_OCTAL_SEQUENCE( d, bit_groupings ) \
+ BOOST_PP_SEQ_TRANSFORM \
+ ( BOOST_DETAIL_TRIPLE_TO_OCTAL_OPERATION \
+ , BOOST_PP_NIL \
+ , BOOST_PP_IDENTITY( BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_TRIPLE_SEQUENCE )()\
+ ( BOOST_DETAIL_COMPLETE_TRIPLE_SEQUENCE \
+ ( \
+ d \
+ , BOOST_DETAIL_CREATE_BINARY_LITERAL_BIT_SEQUENCE( d, bit_groupings ) \
+ ) \
+ ) \
+ )
+
+#define BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_TRIPLE_SEQUENCE( bit_sequence ) \
+ BOOST_PP_CAT \
+ ( BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_1 bit_sequence \
+ , END_BIT \
+ )
+
+#define BOOST_DETAIL_BITS_PER_OCTIT 3
+
+#define BOOST_DETAIL_COMPLETE_TRIPLE_SEQUENCE( d, incomplete_nibble_sequence ) \
+ BOOST_PP_CAT \
+ ( BOOST_DETAIL_CREATE_TRIPLE_COMPLETION_SEQUENCE_ \
+ , BOOST_PP_MOD_D( d \
+ , BOOST_PP_SEQ_SIZE( incomplete_nibble_sequence ) \
+ , BOOST_DETAIL_BITS_PER_OCTIT \
+ ) \
+ ) \
+ incomplete_nibble_sequence
+
+#define BOOST_DETAIL_FIXED_COMPL( bit ) \
+ BOOST_PP_CAT( BOOST_DETAIL_FIXED_COMPL_, bit )
+
+#define BOOST_DETAIL_FIXED_COMPL_0 1
+
+#define BOOST_DETAIL_FIXED_COMPL_1 0
+
+#define BOOST_DETAIL_CREATE_BINARY_LITERAL_BIT_SEQUENCE( d, bit_groupings ) \
+ BOOST_PP_EMPTY \
+ BOOST_PP_CAT( BOOST_PP_WHILE_, d ) \
+ ( BOOST_DETAIL_BINARY_LITERAL_PREDICATE \
+ , BOOST_DETAIL_BINARY_LITERAL_OPERATION \
+ , bit_groupings () \
+ )
+
+#define BOOST_DETAIL_BINARY_LITERAL_PREDICATE( d, state ) \
+ BOOST_DETAIL_FIXED_COMPL( BOOST_DETAIL_IS_NULLARY_ARGS( state ) )
+
+#define BOOST_DETAIL_BINARY_LITERAL_OPERATION( d, state ) \
+ BOOST_DETAIL_SPLIT_AND_SWAP \
+ ( BOOST_PP_CAT( BOOST_DETAIL_BINARY_LITERAL_ELEMENT_, state ) )
+
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_OPERATION( s, dummy_param, tuple ) \
+ BOOST_DETAIL_TERNARY_TRIPLE_TO_OCTAL tuple
+
+#define BOOST_DETAIL_TERNARY_TRIPLE_TO_OCTAL( bit2, bit1, bit0 ) \
+ BOOST_DETAIL_TRIPLE_TO_OCTAL_ ## bit2 ## bit1 ## bit0
+
+#define BOOST_DETAIL_CREATE_TRIPLE_COMPLETION_SEQUENCE_1 (0)(0)
+#define BOOST_DETAIL_CREATE_TRIPLE_COMPLETION_SEQUENCE_2 (0)
+#define BOOST_DETAIL_CREATE_TRIPLE_COMPLETION_SEQUENCE_0
+
+#define BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_1END_BIT
+
+#define BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_1( bit ) \
+ ( ( bit, BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_2
+
+#define BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_2( bit ) \
+ bit, BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_3
+
+#define BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_3( bit ) \
+ bit ) ) BOOST_DETAIL_CONVERT_BIT_SEQUENCE_TO_PARENTHETIC_TUPLE_1
+
+#define BOOST_DETAIL_SPLIT_AND_SWAP( params ) \
+ BOOST_PP_IDENTITY( BOOST_DETAIL_SPLIT_AND_SWAP_PARAMS )()( params )
+
+#define BOOST_DETAIL_SPLIT_AND_SWAP_PARAMS( first_param, second_param ) \
+ second_param first_param
+
+#define BOOST_DETAIL_LEFT_OF_COMMA( params ) \
+ BOOST_PP_IDENTITY( BOOST_DETAIL_FIRST_MACRO_PARAM )()( params )
+
+#define BOOST_DETAIL_FIRST_MACRO_PARAM( first_param, second_param ) \
+ first_param
+
+/* Begin derived concepts from Chaos by Paul Mensonides */
+
+#define BOOST_DETAIL_IS_NULLARY_ARGS( param ) \
+ BOOST_DETAIL_LEFT_OF_COMMA \
+ ( BOOST_PP_CAT( BOOST_DETAIL_IS_NULLARY_ARGS_R_ \
+ , BOOST_DETAIL_IS_NULLARY_ARGS_C param \
+ ) \
+ )
+
+#define BOOST_DETAIL_IS_NULLARY_ARGS_C() \
+ 1
+
+#define BOOST_DETAIL_IS_NULLARY_ARGS_R_1 \
+ 1, BOOST_PP_NIL
+
+#define BOOST_DETAIL_IS_NULLARY_ARGS_R_BOOST_DETAIL_IS_NULLARY_ARGS_C \
+ 0, BOOST_PP_NIL
+
+/* End derived concepts from Chaos by Paul Mensonides */
+
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_000 0
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_001 1
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_010 2
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_011 3
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_100 4
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_101 5
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_110 6
+#define BOOST_DETAIL_TRIPLE_TO_OCTAL_111 7
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0 (0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1 (1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00 (0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01 (0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10 (1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11 (1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00 (0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01 (0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10 (1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11 (1)(1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000 (0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001 (0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010 (0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011 (0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100 (1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101 (1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110 (1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111 (1)(1)(1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000 (0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001 (0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010 (0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011 (0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100 (0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101 (0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110 (0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111 (0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000 (1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001 (1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010 (1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011 (1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100 (1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101 (1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110 (1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111 (1)(1)(1)(1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000 (0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001 (0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010 (0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011 (0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100 (0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101 (0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110 (0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111 (0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000 (0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001 (0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010 (0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011 (0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100 (0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101 (0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110 (0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111 (0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000 (1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001 (1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010 (1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011 (1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100 (1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101 (1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110 (1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111 (1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000 (1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001 (1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010 (1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011 (1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100 (1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101 (1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110 (1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111 (1)(1)(1)(1)(1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000000 (0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000001 (0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000010 (0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000011 (0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000100 (0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000101 (0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000110 (0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_000111 (0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001000 (0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001001 (0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001010 (0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001011 (0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001100 (0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001101 (0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001110 (0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_001111 (0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010000 (0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010001 (0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010010 (0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010011 (0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010100 (0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010101 (0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010110 (0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_010111 (0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011000 (0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011001 (0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011010 (0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011011 (0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011100 (0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011101 (0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011110 (0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_011111 (0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100000 (1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100001 (1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100010 (1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100011 (1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100100 (1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100101 (1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100110 (1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_100111 (1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101000 (1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101001 (1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101010 (1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101011 (1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101100 (1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101101 (1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101110 (1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_101111 (1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110000 (1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110001 (1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110010 (1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110011 (1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110100 (1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110101 (1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110110 (1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_110111 (1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111000 (1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111001 (1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111010 (1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111011 (1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111100 (1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111101 (1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111110 (1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_111111 (1)(1)(1)(1)(1)(1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000000 (0)(0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000001 (0)(0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000010 (0)(0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000011 (0)(0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000100 (0)(0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000101 (0)(0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000110 (0)(0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0000111 (0)(0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001000 (0)(0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001001 (0)(0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001010 (0)(0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001011 (0)(0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001100 (0)(0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001101 (0)(0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001110 (0)(0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0001111 (0)(0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010000 (0)(0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010001 (0)(0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010010 (0)(0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010011 (0)(0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010100 (0)(0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010101 (0)(0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010110 (0)(0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0010111 (0)(0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011000 (0)(0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011001 (0)(0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011010 (0)(0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011011 (0)(0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011100 (0)(0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011101 (0)(0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011110 (0)(0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0011111 (0)(0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100000 (0)(1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100001 (0)(1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100010 (0)(1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100011 (0)(1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100100 (0)(1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100101 (0)(1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100110 (0)(1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0100111 (0)(1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101000 (0)(1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101001 (0)(1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101010 (0)(1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101011 (0)(1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101100 (0)(1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101101 (0)(1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101110 (0)(1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0101111 (0)(1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110000 (0)(1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110001 (0)(1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110010 (0)(1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110011 (0)(1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110100 (0)(1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110101 (0)(1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110110 (0)(1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0110111 (0)(1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111000 (0)(1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111001 (0)(1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111010 (0)(1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111011 (0)(1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111100 (0)(1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111101 (0)(1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111110 (0)(1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_0111111 (0)(1)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000000 (1)(0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000001 (1)(0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000010 (1)(0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000011 (1)(0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000100 (1)(0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000101 (1)(0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000110 (1)(0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1000111 (1)(0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001000 (1)(0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001001 (1)(0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001010 (1)(0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001011 (1)(0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001100 (1)(0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001101 (1)(0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001110 (1)(0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1001111 (1)(0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010000 (1)(0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010001 (1)(0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010010 (1)(0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010011 (1)(0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010100 (1)(0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010101 (1)(0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010110 (1)(0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1010111 (1)(0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011000 (1)(0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011001 (1)(0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011010 (1)(0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011011 (1)(0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011100 (1)(0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011101 (1)(0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011110 (1)(0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1011111 (1)(0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100000 (1)(1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100001 (1)(1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100010 (1)(1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100011 (1)(1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100100 (1)(1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100101 (1)(1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100110 (1)(1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1100111 (1)(1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101000 (1)(1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101001 (1)(1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101010 (1)(1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101011 (1)(1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101100 (1)(1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101101 (1)(1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101110 (1)(1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1101111 (1)(1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110000 (1)(1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110001 (1)(1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110010 (1)(1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110011 (1)(1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110100 (1)(1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110101 (1)(1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110110 (1)(1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1110111 (1)(1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111000 (1)(1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111001 (1)(1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111010 (1)(1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111011 (1)(1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111100 (1)(1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111101 (1)(1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111110 (1)(1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_1111111 (1)(1)(1)(1)(1)(1)(1),
+
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000000 (0)(0)(0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000001 (0)(0)(0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000010 (0)(0)(0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000011 (0)(0)(0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000100 (0)(0)(0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000101 (0)(0)(0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000110 (0)(0)(0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00000111 (0)(0)(0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001000 (0)(0)(0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001001 (0)(0)(0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001010 (0)(0)(0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001011 (0)(0)(0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001100 (0)(0)(0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001101 (0)(0)(0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001110 (0)(0)(0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00001111 (0)(0)(0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010000 (0)(0)(0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010001 (0)(0)(0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010010 (0)(0)(0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010011 (0)(0)(0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010100 (0)(0)(0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010101 (0)(0)(0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010110 (0)(0)(0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00010111 (0)(0)(0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011000 (0)(0)(0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011001 (0)(0)(0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011010 (0)(0)(0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011011 (0)(0)(0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011100 (0)(0)(0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011101 (0)(0)(0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011110 (0)(0)(0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00011111 (0)(0)(0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100000 (0)(0)(1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100001 (0)(0)(1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100010 (0)(0)(1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100011 (0)(0)(1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100100 (0)(0)(1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100101 (0)(0)(1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100110 (0)(0)(1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00100111 (0)(0)(1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101000 (0)(0)(1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101001 (0)(0)(1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101010 (0)(0)(1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101011 (0)(0)(1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101100 (0)(0)(1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101101 (0)(0)(1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101110 (0)(0)(1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00101111 (0)(0)(1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110000 (0)(0)(1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110001 (0)(0)(1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110010 (0)(0)(1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110011 (0)(0)(1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110100 (0)(0)(1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110101 (0)(0)(1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110110 (0)(0)(1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00110111 (0)(0)(1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111000 (0)(0)(1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111001 (0)(0)(1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111010 (0)(0)(1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111011 (0)(0)(1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111100 (0)(0)(1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111101 (0)(0)(1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111110 (0)(0)(1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_00111111 (0)(0)(1)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000000 (0)(1)(0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000001 (0)(1)(0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000010 (0)(1)(0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000011 (0)(1)(0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000100 (0)(1)(0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000101 (0)(1)(0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000110 (0)(1)(0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01000111 (0)(1)(0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001000 (0)(1)(0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001001 (0)(1)(0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001010 (0)(1)(0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001011 (0)(1)(0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001100 (0)(1)(0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001101 (0)(1)(0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001110 (0)(1)(0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01001111 (0)(1)(0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010000 (0)(1)(0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010001 (0)(1)(0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010010 (0)(1)(0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010011 (0)(1)(0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010100 (0)(1)(0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010101 (0)(1)(0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010110 (0)(1)(0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01010111 (0)(1)(0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011000 (0)(1)(0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011001 (0)(1)(0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011010 (0)(1)(0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011011 (0)(1)(0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011100 (0)(1)(0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011101 (0)(1)(0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011110 (0)(1)(0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01011111 (0)(1)(0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100000 (0)(1)(1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100001 (0)(1)(1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100010 (0)(1)(1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100011 (0)(1)(1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100100 (0)(1)(1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100101 (0)(1)(1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100110 (0)(1)(1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01100111 (0)(1)(1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101000 (0)(1)(1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101001 (0)(1)(1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101010 (0)(1)(1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101011 (0)(1)(1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101100 (0)(1)(1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101101 (0)(1)(1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101110 (0)(1)(1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01101111 (0)(1)(1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110000 (0)(1)(1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110001 (0)(1)(1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110010 (0)(1)(1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110011 (0)(1)(1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110100 (0)(1)(1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110101 (0)(1)(1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110110 (0)(1)(1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01110111 (0)(1)(1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111000 (0)(1)(1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111001 (0)(1)(1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111010 (0)(1)(1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111011 (0)(1)(1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111100 (0)(1)(1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111101 (0)(1)(1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111110 (0)(1)(1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_01111111 (0)(1)(1)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000000 (1)(0)(0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000001 (1)(0)(0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000010 (1)(0)(0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000011 (1)(0)(0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000100 (1)(0)(0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000101 (1)(0)(0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000110 (1)(0)(0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10000111 (1)(0)(0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001000 (1)(0)(0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001001 (1)(0)(0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001010 (1)(0)(0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001011 (1)(0)(0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001100 (1)(0)(0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001101 (1)(0)(0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001110 (1)(0)(0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10001111 (1)(0)(0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010000 (1)(0)(0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010001 (1)(0)(0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010010 (1)(0)(0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010011 (1)(0)(0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010100 (1)(0)(0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010101 (1)(0)(0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010110 (1)(0)(0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10010111 (1)(0)(0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011000 (1)(0)(0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011001 (1)(0)(0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011010 (1)(0)(0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011011 (1)(0)(0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011100 (1)(0)(0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011101 (1)(0)(0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011110 (1)(0)(0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10011111 (1)(0)(0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100000 (1)(0)(1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100001 (1)(0)(1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100010 (1)(0)(1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100011 (1)(0)(1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100100 (1)(0)(1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100101 (1)(0)(1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100110 (1)(0)(1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10100111 (1)(0)(1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101000 (1)(0)(1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101001 (1)(0)(1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101010 (1)(0)(1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101011 (1)(0)(1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101100 (1)(0)(1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101101 (1)(0)(1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101110 (1)(0)(1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10101111 (1)(0)(1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110000 (1)(0)(1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110001 (1)(0)(1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110010 (1)(0)(1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110011 (1)(0)(1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110100 (1)(0)(1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110101 (1)(0)(1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110110 (1)(0)(1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10110111 (1)(0)(1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111000 (1)(0)(1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111001 (1)(0)(1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111010 (1)(0)(1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111011 (1)(0)(1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111100 (1)(0)(1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111101 (1)(0)(1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111110 (1)(0)(1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_10111111 (1)(0)(1)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000000 (1)(1)(0)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000001 (1)(1)(0)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000010 (1)(1)(0)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000011 (1)(1)(0)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000100 (1)(1)(0)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000101 (1)(1)(0)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000110 (1)(1)(0)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11000111 (1)(1)(0)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001000 (1)(1)(0)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001001 (1)(1)(0)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001010 (1)(1)(0)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001011 (1)(1)(0)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001100 (1)(1)(0)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001101 (1)(1)(0)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001110 (1)(1)(0)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11001111 (1)(1)(0)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010000 (1)(1)(0)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010001 (1)(1)(0)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010010 (1)(1)(0)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010011 (1)(1)(0)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010100 (1)(1)(0)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010101 (1)(1)(0)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010110 (1)(1)(0)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11010111 (1)(1)(0)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011000 (1)(1)(0)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011001 (1)(1)(0)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011010 (1)(1)(0)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011011 (1)(1)(0)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011100 (1)(1)(0)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011101 (1)(1)(0)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011110 (1)(1)(0)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11011111 (1)(1)(0)(1)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100000 (1)(1)(1)(0)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100001 (1)(1)(1)(0)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100010 (1)(1)(1)(0)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100011 (1)(1)(1)(0)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100100 (1)(1)(1)(0)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100101 (1)(1)(1)(0)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100110 (1)(1)(1)(0)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11100111 (1)(1)(1)(0)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101000 (1)(1)(1)(0)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101001 (1)(1)(1)(0)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101010 (1)(1)(1)(0)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101011 (1)(1)(1)(0)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101100 (1)(1)(1)(0)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101101 (1)(1)(1)(0)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101110 (1)(1)(1)(0)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11101111 (1)(1)(1)(0)(1)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110000 (1)(1)(1)(1)(0)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110001 (1)(1)(1)(1)(0)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110010 (1)(1)(1)(1)(0)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110011 (1)(1)(1)(1)(0)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110100 (1)(1)(1)(1)(0)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110101 (1)(1)(1)(1)(0)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110110 (1)(1)(1)(1)(0)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11110111 (1)(1)(1)(1)(0)(1)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111000 (1)(1)(1)(1)(1)(0)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111001 (1)(1)(1)(1)(1)(0)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111010 (1)(1)(1)(1)(1)(0)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111011 (1)(1)(1)(1)(1)(0)(1)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111100 (1)(1)(1)(1)(1)(1)(0)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111101 (1)(1)(1)(1)(1)(1)(0)(1),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111110 (1)(1)(1)(1)(1)(1)(1)(0),
+#define BOOST_DETAIL_BINARY_LITERAL_ELEMENT_11111111 (1)(1)(1)(1)(1)(1)(1)(1),
+
+#endif
diff --git a/ndnboost/utility/compare_pointees.hpp b/ndnboost/utility/compare_pointees.hpp
new file mode 100644
index 0000000..6e20bf0
--- /dev/null
+++ b/ndnboost/utility/compare_pointees.hpp
@@ -0,0 +1,68 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
+#define BOOST_UTILITY_COMPARE_POINTEES_25AGO2003_HPP
+
+#include<functional>
+
+namespace ndnboost {
+
+// template<class OP> bool equal_pointees(OP const& x, OP const& y);
+// template<class OP> struct equal_pointees_t;
+//
+// Being OP a model of OptionalPointee (either a pointer or an optional):
+//
+// If both x and y have valid pointees, returns the result of (*x == *y)
+// If only one has a valid pointee, returns false.
+// If none have valid pointees, returns true.
+// No-throw
+template<class OptionalPointee>
+inline
+bool equal_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+{
+ return (!x) != (!y) ? false : ( !x ? true : (*x) == (*y) ) ;
+}
+
+template<class OptionalPointee>
+struct equal_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
+{
+ bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
+ { return equal_pointees(x,y) ; }
+} ;
+
+// template<class OP> bool less_pointees(OP const& x, OP const& y);
+// template<class OP> struct less_pointees_t;
+//
+// Being OP a model of OptionalPointee (either a pointer or an optional):
+//
+// If y has not a valid pointee, returns false.
+// ElseIf x has not a valid pointee, returns true.
+// ElseIf both x and y have valid pointees, returns the result of (*x < *y)
+// No-throw
+template<class OptionalPointee>
+inline
+bool less_pointees ( OptionalPointee const& x, OptionalPointee const& y )
+{
+ return !y ? false : ( !x ? true : (*x) < (*y) ) ;
+}
+
+template<class OptionalPointee>
+struct less_pointees_t : std::binary_function<OptionalPointee,OptionalPointee,bool>
+{
+ bool operator() ( OptionalPointee const& x, OptionalPointee const& y ) const
+ { return less_pointees(x,y) ; }
+} ;
+
+} // namespace ndnboost
+
+#endif
+
diff --git a/ndnboost/utility/detail/in_place_factory_prefix.hpp b/ndnboost/utility/detail/in_place_factory_prefix.hpp
new file mode 100644
index 0000000..17c82e7
--- /dev/null
+++ b/ndnboost/utility/detail/in_place_factory_prefix.hpp
@@ -0,0 +1,36 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+// Copyright (C) 2007, Tobias Schwinger.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
+#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
+
+#include <new>
+#include <cstddef>
+#include <ndnboost/config.hpp>
+#include <ndnboost/preprocessor/cat.hpp>
+#include <ndnboost/preprocessor/punctuation/paren.hpp>
+#include <ndnboost/preprocessor/iteration/iterate.hpp>
+#include <ndnboost/preprocessor/repetition/repeat.hpp>
+#include <ndnboost/preprocessor/repetition/enum.hpp>
+#include <ndnboost/preprocessor/repetition/enum_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_binary_params.hpp>
+#include <ndnboost/preprocessor/repetition/enum_trailing_params.hpp>
+
+#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT(z,n,_) BOOST_PP_CAT(m_a,n) BOOST_PP_LPAREN() BOOST_PP_CAT(a,n) BOOST_PP_RPAREN()
+#define BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL(z,n,_) BOOST_PP_CAT(A,n) const& BOOST_PP_CAT(m_a,n);
+
+#define BOOST_MAX_INPLACE_FACTORY_ARITY 10
+
+#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
+
+#endif
+
diff --git a/ndnboost/utility/detail/in_place_factory_suffix.hpp b/ndnboost/utility/detail/in_place_factory_suffix.hpp
new file mode 100644
index 0000000..58f48c7
--- /dev/null
+++ b/ndnboost/utility/detail/in_place_factory_suffix.hpp
@@ -0,0 +1,23 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+// Copyright (C) 2007, Tobias Schwinger.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
+#define BOOST_UTILITY_DETAIL_INPLACE_FACTORY_SUFFIX_04APR2007_HPP
+
+#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT
+#undef BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL
+#undef BOOST_MAX_INPLACE_FACTORY_ARITY
+
+#undef BOOST_UTILITY_DETAIL_INPLACE_FACTORY_PREFIX_04APR2007_HPP
+
+#endif
+
diff --git a/ndnboost/utility/identity_type.hpp b/ndnboost/utility/identity_type.hpp
new file mode 100644
index 0000000..060ddbd
--- /dev/null
+++ b/ndnboost/utility/identity_type.hpp
@@ -0,0 +1,46 @@
+
+// Copyright (C) 2009-2012 Lorenzo Caminiti
+// Distributed under the Boost Software License, Version 1.0
+// (see accompanying file LICENSE_1_0.txt or a copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+// Home at http://www.boost.org/libs/utility/identity_type
+
+/** @file
+Wrap type expressions with round parenthesis so they can be passed to macros
+even if they contain commas.
+*/
+
+#ifndef BOOST_IDENTITY_TYPE_HPP_
+#define BOOST_IDENTITY_TYPE_HPP_
+
+#include <ndnboost/type_traits/function_traits.hpp>
+
+/**
+@brief This macro allows to wrap the specified type expression within extra
+round parenthesis so the type can be passed as a single macro parameter even if
+it contains commas (not already wrapped within round parenthesis).
+
+@Params
+@Param{parenthesized_type,
+The type expression to be passed as macro parameter wrapped by a single set
+of round parenthesis <c>(...)</c>.
+This type expression can contain an arbitrary number of commas.
+}
+@EndParams
+
+This macro works on any C++03 compiler (it does not use variadic macros).
+
+This macro must be prefixed by <c>typename</c> when used within templates.
+Note that the compiler will not be able to automatically determine function
+template parameters when they are wrapped with this macro (these parameters
+need to be explicitly specified when calling the function template).
+
+On some compilers (like GCC), using this macro on abstract types requires to
+add and remove a reference to the specified type.
+*/
+#define BOOST_IDENTITY_TYPE(parenthesized_type) \
+ /* must NOT prefix this with `::` to work with parenthesized syntax */ \
+ ndnboost::function_traits< void parenthesized_type >::arg1_type
+
+#endif // #include guard
+
diff --git a/ndnboost/utility/in_place_factory.hpp b/ndnboost/utility/in_place_factory.hpp
new file mode 100644
index 0000000..f849649
--- /dev/null
+++ b/ndnboost/utility/in_place_factory.hpp
@@ -0,0 +1,88 @@
+// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+// Copyright (C) 2007, Tobias Schwinger.
+//
+// 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)
+//
+// See http://www.boost.org/libs/optional for documentation.
+//
+// You are welcome to contact the author at:
+// fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP
+#ifndef BOOST_PP_IS_ITERATING
+
+#include <ndnboost/utility/detail/in_place_factory_prefix.hpp>
+
+namespace ndnboost {
+
+class in_place_factory_base {} ;
+
+#define BOOST_PP_ITERATION_LIMITS (0, BOOST_MAX_INPLACE_FACTORY_ARITY)
+#define BOOST_PP_FILENAME_1 <ndnboost/utility/in_place_factory.hpp>
+#include BOOST_PP_ITERATE()
+
+} // namespace ndnboost
+
+#include <ndnboost/utility/detail/in_place_factory_suffix.hpp>
+
+#define BOOST_UTILITY_INPLACE_FACTORY_04APR2007_HPP
+#else
+#define N BOOST_PP_ITERATION()
+
+#if N
+template< BOOST_PP_ENUM_PARAMS(N, class A) >
+#endif
+class BOOST_PP_CAT(in_place_factory,N)
+ :
+ public in_place_factory_base
+{
+public:
+
+ explicit BOOST_PP_CAT(in_place_factory,N)
+ ( BOOST_PP_ENUM_BINARY_PARAMS(N,A,const& a) )
+#if N > 0
+ : BOOST_PP_ENUM(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_INIT, _)
+#endif
+ {}
+
+ template<class T>
+ void* apply(void* address
+ BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) const
+ {
+ return new(address) T( BOOST_PP_ENUM_PARAMS(N, m_a) );
+ }
+
+ template<class T>
+ void* apply(void* address, std::size_t n
+ BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T)) const
+ {
+ for(char* next = address = this->BOOST_NESTED_TEMPLATE apply<T>(address);
+ !! --n;)
+ this->BOOST_NESTED_TEMPLATE apply<T>(next = next+sizeof(T));
+ return address;
+ }
+
+ BOOST_PP_REPEAT(N, BOOST_DEFINE_INPLACE_FACTORY_CLASS_MEMBER_DECL, _)
+};
+
+#if N > 0
+template< BOOST_PP_ENUM_PARAMS(N, class A) >
+inline BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) >
+in_place( BOOST_PP_ENUM_BINARY_PARAMS(N, A, const& a) )
+{
+ return BOOST_PP_CAT(in_place_factory,N)< BOOST_PP_ENUM_PARAMS(N, A) >
+ ( BOOST_PP_ENUM_PARAMS(N, a) );
+}
+#else
+inline in_place_factory0 in_place()
+{
+ return in_place_factory0();
+}
+#endif
+
+#undef N
+#endif
+#endif
+
diff --git a/ndnboost/utility/value_init.hpp b/ndnboost/utility/value_init.hpp
new file mode 100644
index 0000000..6767810
--- /dev/null
+++ b/ndnboost/utility/value_init.hpp
@@ -0,0 +1,258 @@
+// (C) Copyright 2002-2008, Fernando Luis Cacciola Carballal.
+//
+// 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)
+//
+// 21 Ago 2002 (Created) Fernando Cacciola
+// 24 Dec 2007 (Refactored and worked around various compiler bugs) Fernando Cacciola, Niels Dekker
+// 23 May 2008 (Fixed operator= const issue, added initialized_value) Niels Dekker, Fernando Cacciola
+// 21 Ago 2008 (Added swap) Niels Dekker, Fernando Cacciola
+// 20 Feb 2009 (Fixed logical const-ness issues) Niels Dekker, Fernando Cacciola
+// 03 Apr 2010 (Added initialized<T>, suggested by Jeffrey Hellrung, fixing #3472) Niels Dekker
+// 30 May 2010 (Made memset call conditional, fixing #3869) Niels Dekker
+//
+#ifndef BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
+#define BOOST_UTILITY_VALUE_INIT_21AGO2002_HPP
+
+// Note: The implementation of ndnboost::value_initialized had to deal with the
+// fact that various compilers haven't fully implemented value-initialization.
+// The constructor of ndnboost::value_initialized<T> works around these compiler
+// issues, by clearing the bytes of T, before constructing the T object it
+// contains. More details on these issues are at libs/utility/value_init.htm
+
+#include <ndnboost/aligned_storage.hpp>
+#include <ndnboost/config.hpp> // For BOOST_NO_COMPLETE_VALUE_INITIALIZATION.
+#include <ndnboost/detail/workaround.hpp>
+#include <ndnboost/static_assert.hpp>
+#include <ndnboost/type_traits/cv_traits.hpp>
+#include <ndnboost/type_traits/alignment_of.hpp>
+#include <ndnboost/swap.hpp>
+#include <cstring>
+#include <new>
+
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#if _MSC_VER >= 1310
+// It is safe to ignore the following warning from MSVC 7.1 or higher:
+// "warning C4351: new behavior: elements of array will be default initialized"
+#pragma warning(disable: 4351)
+// It is safe to ignore the following MSVC warning, which may pop up when T is
+// a const type: "warning C4512: assignment operator could not be generated".
+#pragma warning(disable: 4512)
+#endif
+#endif
+
+#ifdef BOOST_NO_COMPLETE_VALUE_INITIALIZATION
+ // Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
+ // suggests that a workaround should be applied, because of compiler issues
+ // regarding value-initialization.
+ #define BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
+#endif
+
+// Implementation detail: The macro BOOST_DETAIL_VALUE_INIT_WORKAROUND
+// switches the value-initialization workaround either on or off.
+#ifndef BOOST_DETAIL_VALUE_INIT_WORKAROUND
+ #ifdef BOOST_DETAIL_VALUE_INIT_WORKAROUND_SUGGESTED
+ #define BOOST_DETAIL_VALUE_INIT_WORKAROUND 1
+ #else
+ #define BOOST_DETAIL_VALUE_INIT_WORKAROUND 0
+ #endif
+#endif
+
+namespace ndnboost {
+
+template<class T>
+class initialized
+{
+ private :
+ struct wrapper
+ {
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+ typename
+#endif
+ remove_const<T>::type data;
+
+ wrapper()
+ :
+ data()
+ {
+ }
+
+ wrapper(T const & arg)
+ :
+ data(arg)
+ {
+ }
+ };
+
+ mutable
+#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x592))
+ typename
+#endif
+ aligned_storage<sizeof(wrapper), alignment_of<wrapper>::value>::type x;
+
+ wrapper * wrapper_address() const
+ {
+ return static_cast<wrapper *>( static_cast<void*>(&x));
+ }
+
+ public :
+
+ initialized()
+ {
+#if BOOST_DETAIL_VALUE_INIT_WORKAROUND
+ std::memset(&x, 0, sizeof(x));
+#endif
+ new (wrapper_address()) wrapper();
+ }
+
+ initialized(initialized const & arg)
+ {
+ new (wrapper_address()) wrapper( static_cast<wrapper const &>(*(arg.wrapper_address())));
+ }
+
+ explicit initialized(T const & arg)
+ {
+ new (wrapper_address()) wrapper(arg);
+ }
+
+ initialized & operator=(initialized const & arg)
+ {
+ // Assignment is only allowed when T is non-const.
+ BOOST_STATIC_ASSERT( ! is_const<T>::value );
+ *wrapper_address() = static_cast<wrapper const &>(*(arg.wrapper_address()));
+ return *this;
+ }
+
+ ~initialized()
+ {
+ wrapper_address()->wrapper::~wrapper();
+ }
+
+ T const & data() const
+ {
+ return wrapper_address()->data;
+ }
+
+ T& data()
+ {
+ return wrapper_address()->data;
+ }
+
+ void swap(initialized & arg)
+ {
+ ::ndnboost::swap( this->data(), arg.data() );
+ }
+
+ operator T const &() const
+ {
+ return wrapper_address()->data;
+ }
+
+ operator T&()
+ {
+ return wrapper_address()->data;
+ }
+
+} ;
+
+template<class T>
+T const& get ( initialized<T> const& x )
+{
+ return x.data() ;
+}
+
+template<class T>
+T& get ( initialized<T>& x )
+{
+ return x.data() ;
+}
+
+template<class T>
+void swap ( initialized<T> & lhs, initialized<T> & rhs )
+{
+ lhs.swap(rhs) ;
+}
+
+template<class T>
+class value_initialized
+{
+ private :
+
+ // initialized<T> does value-initialization by default.
+ initialized<T> m_data;
+
+ public :
+
+ value_initialized()
+ :
+ m_data()
+ { }
+
+ T const & data() const
+ {
+ return m_data.data();
+ }
+
+ T& data()
+ {
+ return m_data.data();
+ }
+
+ void swap(value_initialized & arg)
+ {
+ m_data.swap(arg.m_data);
+ }
+
+ operator T const &() const
+ {
+ return m_data;
+ }
+
+ operator T&()
+ {
+ return m_data;
+ }
+} ;
+
+
+template<class T>
+T const& get ( value_initialized<T> const& x )
+{
+ return x.data() ;
+}
+
+template<class T>
+T& get ( value_initialized<T>& x )
+{
+ return x.data() ;
+}
+
+template<class T>
+void swap ( value_initialized<T> & lhs, value_initialized<T> & rhs )
+{
+ lhs.swap(rhs) ;
+}
+
+
+class initialized_value_t
+{
+ public :
+
+ template <class T> operator T() const
+ {
+ return initialized<T>().data();
+ }
+};
+
+initialized_value_t const initialized_value = {} ;
+
+
+} // namespace ndnboost
+
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
+
+#endif
diff --git a/ndnboost/visit_each.hpp b/ndnboost/visit_each.hpp
new file mode 100644
index 0000000..43dfa65
--- /dev/null
+++ b/ndnboost/visit_each.hpp
@@ -0,0 +1,29 @@
+// Boost.Signals library
+
+// Copyright Douglas Gregor 2001-2003. 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/signals
+
+#ifndef BOOST_VISIT_EACH_HPP
+#define BOOST_VISIT_EACH_HPP
+
+#include <ndnboost/config.hpp>
+
+namespace ndnboost {
+ template<typename Visitor, typename T>
+ inline void visit_each(Visitor& visitor, const T& t, long)
+ {
+ visitor(t);
+ }
+
+ template<typename Visitor, typename T>
+ inline void visit_each(Visitor& visitor, const T& t)
+ {
+ visit_each(visitor, t, 0);
+ }
+}
+
+#endif // BOOST_VISIT_EACH_HPP