Include bind in ndnboost.
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