You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by be...@apache.org on 2011/06/05 08:40:27 UTC
svn commit: r1131945 [11/15] - in
/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0:
./ boost/ boost/bind/ boost/detail/ boost/exception/ boost/functional/
boost/functional/detail/ boost/functional/hash/ boost/integer/ boost/ms...
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_union.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_union.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_union.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_union.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,49 @@
+
+// (C) Copyright Dave Abrahams, 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.
+
+
+#ifndef BOOST_TT_IS_UNION_HPP_INCLUDED
+#define BOOST_TT_IS_UNION_HPP_INCLUDED
+
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/config.hpp>
+#include <boost/type_traits/intrinsics.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost {
+
+namespace detail {
+#ifndef __GNUC__
+template <typename T> struct is_union_impl
+{
+ typedef typename remove_cv<T>::type cvt;
+ BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
+};
+#else
+//
+// using remove_cv here generates a whole load of needless
+// warnings with gcc, since it doesn't do any good with gcc
+// in any case (at least at present), just remove it:
+//
+template <typename T> struct is_union_impl
+{
+ BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T));
+};
+#endif
+} // namespace detail
+
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_union,T,::boost::detail::is_union_impl<T>::value)
+
+} // namespace boost
+
+#include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif // BOOST_TT_IS_UNION_HPP_INCLUDED
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_unsigned.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_unsigned.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_unsigned.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_unsigned.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,123 @@
+
+// (C) Copyright John Maddock 2005.
+// 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_IS_UNSIGNED_HPP_INCLUDED
+#define BOOST_TT_IS_UNSIGNED_HPP_INCLUDED
+
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/detail/ice_or.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost {
+
+#if !defined( __CODEGEARC__ )
+
+namespace detail{
+
+#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
+
+template <class T>
+struct is_ununsigned_helper
+{
+ typedef typename remove_cv<T>::type no_cv_t;
+ BOOST_STATIC_CONSTANT(bool, value = (static_cast<no_cv_t>(-1) > 0));
+};
+
+template <bool integral_type>
+struct is_ununsigned_select_helper
+{
+ template <class T>
+ struct rebind
+ {
+ typedef is_ununsigned_helper<T> type;
+ };
+};
+
+template <>
+struct is_ununsigned_select_helper<false>
+{
+ template <class T>
+ struct rebind
+ {
+ typedef false_type type;
+ };
+};
+
+template <class T>
+struct is_unsigned_imp
+{
+ typedef is_ununsigned_select_helper<
+ ::boost::type_traits::ice_or<
+ ::boost::is_integral<T>::value,
+ ::boost::is_enum<T>::value>::value
+ > selector;
+ typedef typename selector::template rebind<T> binder;
+ typedef typename binder::type type;
+ BOOST_STATIC_CONSTANT(bool, value = type::value);
+};
+
+#else
+
+template <class T> struct is_unsigned_imp : public false_type{};
+template <> struct is_unsigned_imp<unsigned char> : public true_type{};
+template <> struct is_unsigned_imp<const unsigned char> : public true_type{};
+template <> struct is_unsigned_imp<volatile unsigned char> : public true_type{};
+template <> struct is_unsigned_imp<const volatile unsigned char> : public true_type{};
+template <> struct is_unsigned_imp<unsigned short> : public true_type{};
+template <> struct is_unsigned_imp<const unsigned short> : public true_type{};
+template <> struct is_unsigned_imp<volatile unsigned short> : public true_type{};
+template <> struct is_unsigned_imp<const volatile unsigned short> : public true_type{};
+template <> struct is_unsigned_imp<unsigned int> : public true_type{};
+template <> struct is_unsigned_imp<const unsigned int> : public true_type{};
+template <> struct is_unsigned_imp<volatile unsigned int> : public true_type{};
+template <> struct is_unsigned_imp<const volatile unsigned int> : public true_type{};
+template <> struct is_unsigned_imp<unsigned long> : public true_type{};
+template <> struct is_unsigned_imp<const unsigned long> : public true_type{};
+template <> struct is_unsigned_imp<volatile unsigned long> : public true_type{};
+template <> struct is_unsigned_imp<const volatile unsigned long> : public true_type{};
+#ifdef BOOST_HAS_LONG_LONG
+template <> struct is_unsigned_imp<unsigned long long> : public true_type{};
+template <> struct is_unsigned_imp<const unsigned long long> : public true_type{};
+template <> struct is_unsigned_imp<volatile unsigned long long> : public true_type{};
+template <> struct is_unsigned_imp<const volatile unsigned long long> : public true_type{};
+#endif
+#if defined(CHAR_MIN) && (CHAR_MIN == 0)
+template <> struct is_unsigned_imp<char> : public true_type{};
+template <> struct is_unsigned_imp<const char> : public true_type{};
+template <> struct is_unsigned_imp<volatile char> : public true_type{};
+template <> struct is_unsigned_imp<const volatile char> : public true_type{};
+#endif
+#if defined(WCHAR_MIN) && (WCHAR_MIN == 0)
+template <> struct is_unsigned_imp<wchar_t> : public true_type{};
+template <> struct is_unsigned_imp<const wchar_t> : public true_type{};
+template <> struct is_unsigned_imp<volatile wchar_t> : public true_type{};
+template <> struct is_unsigned_imp<const volatile wchar_t> : public true_type{};
+#endif
+
+#endif
+
+}
+
+#endif // !defined( __CODEGEARC__ )
+
+#if defined( __CODEGEARC__ )
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,__is_unsigned(T))
+#else
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_unsigned,T,::boost::detail::is_unsigned_imp<T>::value)
+#endif
+
+} // namespace boost
+
+#include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif // BOOST_TT_IS_MEMBER_FUNCTION_POINTER_HPP_INCLUDED
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_void.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_void.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_void.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_void.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,38 @@
+
+// (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.
+
+#ifndef BOOST_TT_IS_VOID_HPP_INCLUDED
+#define BOOST_TT_IS_VOID_HPP_INCLUDED
+
+#include <boost/config.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost {
+
+//* is a type T void - is_void<T>
+#if defined( __CODEGEARC__ )
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,__is_void(T))
+#else
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_void,T,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void,true)
+
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const,true)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void volatile,true)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_void,void const volatile,true)
+#endif
+
+#endif // non-CodeGear implementation
+
+} // namespace boost
+
+#include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif // BOOST_TT_IS_VOID_HPP_INCLUDED
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_volatile.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_volatile.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_volatile.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/is_volatile.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,133 @@
+
+// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
+// Howard Hinnant and John Maddock 2000.
+// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
+
+// 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.
+
+// Fixed is_pointer, is_reference, is_const, is_volatile, is_same,
+// is_member_pointer based on the Simulated Partial Specialization work
+// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
+// http://groups.yahoo.com/group/boost/message/5441
+// Some workarounds in here use ideas suggested from "Generic<Programming>:
+// Mappings between Types and Values"
+// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
+
+
+#ifndef BOOST_TT_IS_VOLATILE_HPP_INCLUDED
+#define BOOST_TT_IS_VOLATILE_HPP_INCLUDED
+
+#include <boost/config.hpp>
+#include <boost/detail/workaround.hpp>
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+# include <boost/type_traits/detail/cv_traits_impl.hpp>
+# if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+# include <boost/type_traits/remove_bounds.hpp>
+# endif
+#else
+# include <boost/type_traits/is_reference.hpp>
+# include <boost/type_traits/is_array.hpp>
+# include <boost/type_traits/detail/yes_no_type.hpp>
+# include <boost/type_traits/detail/false_result.hpp>
+#endif
+
+// should be the last #include
+#include <boost/type_traits/detail/bool_trait_def.hpp>
+
+namespace boost {
+
+#if defined( __CODEGEARC__ )
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T))
+#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
+
+//* is a type T declared volatile - is_volatile<T>
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
+ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_volatile)
+#else
+ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp<T*>::is_volatile)
+#endif
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false)
+
+#if defined(BOOST_ILLEGAL_CV_REFERENCES)
+// these are illegal specialisations; cv-qualifies applied to
+// references have no effect according to [8.3.2p1],
+// C++ Builder requires them though as it treats cv-qualified
+// references as distinct types...
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const,false)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T& const volatile,false)
+#endif
+
+#else
+
+namespace detail {
+
+using ::boost::type_traits::yes_type;
+using ::boost::type_traits::no_type;
+
+yes_type is_volatile_tester(void const volatile*);
+no_type is_volatile_tester(void const*);
+
+template <bool is_ref, bool array>
+struct is_volatile_helper
+ : ::boost::type_traits::false_result
+{
+};
+
+template <>
+struct is_volatile_helper<false,false>
+{
+ template <typename T> struct result_
+ {
+ static T* t;
+ BOOST_STATIC_CONSTANT(bool, value = (
+ sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(t))
+ ));
+ };
+};
+
+template <>
+struct is_volatile_helper<false,true>
+{
+ template <typename T> struct result_
+ {
+ static T t;
+ BOOST_STATIC_CONSTANT(bool, value = (
+ sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(&t))
+ ));
+ };
+};
+
+template <typename T>
+struct is_volatile_impl
+ : is_volatile_helper<
+ is_reference<T>::value
+ , is_array<T>::value
+ >::template result_<T>
+{
+};
+
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void volatile,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_volatile,void const volatile,true)
+#endif
+
+} // namespace detail
+
+//* is a type T declared volatile - is_volatile<T>
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_impl<T>::value)
+
+#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+} // namespace boost
+
+#include <boost/type_traits/detail/bool_trait_undef.hpp>
+
+#endif // BOOST_TT_IS_VOLATILE_HPP_INCLUDED
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/lexical_cast.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/lexical_cast.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/lexical_cast.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/lexical_cast.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,1201 @@
+#ifndef BOOST_LEXICAL_CAST_INCLUDED
+#define BOOST_LEXICAL_CAST_INCLUDED
+
+// 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 and other Boosters
+// when: November 2000, March 2003, June 2005, June 2006
+
+#include <climits>
+#include <cstddef>
+#include <istream>
+#include <string>
+#include <typeinfo>
+#include <exception>
+#include <boost/config.hpp>
+#include <boost/limits.hpp>
+#include <boost/mpl/if.hpp>
+#include <boost/throw_exception.hpp>
+#include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/make_unsigned.hpp>
+#include <boost/call_traits.hpp>
+#include <boost/static_assert.hpp>
+#include <boost/detail/lcast_precision.hpp>
+#include <boost/detail/workaround.hpp>
+
+#ifndef BOOST_NO_STD_LOCALE
+#include <locale>
+#endif
+
+#ifdef BOOST_NO_STRINGSTREAM
+#include <strstream>
+#else
+#include <sstream>
+#endif
+
+#if defined(BOOST_NO_STRINGSTREAM) || \
+ defined(BOOST_NO_STD_WSTRING) || \
+ defined(BOOST_NO_STD_LOCALE)
+#define BOOST_LCAST_NO_WCHAR_T
+#endif
+
+namespace boost
+{
+ // exception used to indicate runtime lexical_cast failure
+ class bad_lexical_cast : public std::bad_cast
+
+#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() :
+ source(&typeid(void)), target(&typeid(void))
+ {
+ }
+ bad_lexical_cast(
+ const std::type_info &source_type_arg,
+ const std::type_info &target_type_arg) :
+ 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;
+ }
+ virtual const char *what() const throw()
+ {
+ return "bad lexical cast: "
+ "source type value could not be interpreted as target";
+ }
+ virtual ~bad_lexical_cast() throw()
+ {
+ }
+ private:
+ const std::type_info *source;
+ const std::type_info *target;
+ };
+
+ namespace detail // selectors for choosing stream character type
+ {
+ template<typename Type>
+ struct stream_char
+ {
+ typedef char type;
+ };
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template<class CharT, class Traits, class Alloc>
+ struct stream_char< std::basic_string<CharT,Traits,Alloc> >
+ {
+ typedef CharT type;
+ };
+#endif
+
+#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;
+ };
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template<>
+ struct stream_char<std::wstring>
+ {
+ typedef wchar_t type;
+ };
+#endif
+#endif
+
+ template<typename TargetChar, typename SourceChar>
+ struct widest_char
+ {
+ typedef TargetChar type;
+ };
+
+ template<>
+ struct widest_char<char, wchar_t>
+ {
+ typedef wchar_t type;
+ };
+ }
+
+ namespace detail // deduce_char_traits template
+ {
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template<class CharT, class Target, class Source>
+ struct deduce_char_traits
+ {
+ typedef std::char_traits<CharT> type;
+ };
+
+ template<class CharT, class Traits, class Alloc, class Source>
+ struct deduce_char_traits< CharT
+ , std::basic_string<CharT,Traits,Alloc>
+ , Source
+ >
+ {
+ typedef Traits type;
+ };
+
+ template<class CharT, class Target, class Traits, class Alloc>
+ struct deduce_char_traits< CharT
+ , Target
+ , std::basic_string<CharT,Traits,Alloc>
+ >
+ {
+ typedef Traits type;
+ };
+
+ template<class CharT, class Traits, class Alloc1, class Alloc2>
+ struct deduce_char_traits< CharT
+ , std::basic_string<CharT,Traits,Alloc1>
+ , std::basic_string<CharT,Traits,Alloc2>
+ >
+ {
+ typedef Traits type;
+ };
+#endif
+ }
+
+ namespace detail // lcast_src_length
+ {
+ // Return max. length of string representation of Source;
+ // 0 if unlimited (with exceptions for some types, see below).
+ // Values with limited string representation are placed to
+ // the buffer locally defined in lexical_cast function.
+ // 1 is returned for few types such as CharT const* or
+ // std::basic_string<CharT> that already have an internal
+ // buffer ready to be reused by lexical_stream_limited_src.
+ // Each specialization should have a correspondent operator<<
+ // defined in lexical_stream_limited_src.
+ template< class CharT // A result of widest_char transformation.
+ , class Source // Source type of lexical_cast.
+ >
+ struct lcast_src_length
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 0);
+ // To check coverage, build the test with
+ // bjam --v2 profile optimization=off
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<char, bool>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<char, char>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+ // No specializations for:
+ // lcast_src_length<char, signed char>
+ // lcast_src_length<char, unsigned char>
+ // lcast_src_length<char, signed char*>
+ // lcast_src_length<char, unsigned char*>
+ // lcast_src_length<char, signed char const*>
+ // lcast_src_length<char, unsigned char const*>
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<>
+ struct lcast_src_length<wchar_t, bool>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<wchar_t, char>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+#ifndef BOOST_NO_INTRINSIC_WCHAR_T
+ template<>
+ struct lcast_src_length<wchar_t, wchar_t>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+#endif
+#endif
+
+ template<>
+ struct lcast_src_length<char, char const*>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<char, char*>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<>
+ struct lcast_src_length<wchar_t, wchar_t const*>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<wchar_t, wchar_t*>
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+#endif
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template<class CharT, class Traits, class Alloc>
+ struct lcast_src_length< CharT, std::basic_string<CharT,Traits,Alloc> >
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+#else
+ template<>
+ struct lcast_src_length< char, std::basic_string<char> >
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<>
+ struct lcast_src_length< wchar_t, std::basic_string<wchar_t> >
+ {
+ BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+ static void check_coverage() {}
+ };
+#endif
+#endif
+
+ // 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
+ // <boost/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_DEF1(CharT, T) \
+ template<> struct lcast_src_length<CharT, T> \
+ : lcast_src_length_integral<T> \
+ { static void check_coverage() {} };
+
+#ifdef BOOST_LCAST_NO_WCHAR_T
+#define BOOST_LCAST_DEF(T) BOOST_LCAST_DEF1(char, T)
+#else
+#define BOOST_LCAST_DEF(T) \
+ BOOST_LCAST_DEF1(char, T) \
+ BOOST_LCAST_DEF1(wchar_t, T)
+#endif
+
+ 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(boost::ulong_long_type)
+ BOOST_LCAST_DEF(boost::long_long_type )
+#elif defined(BOOST_HAS_MS_INT64)
+ BOOST_LCAST_DEF(unsigned __int64)
+ BOOST_LCAST_DEF( __int64)
+#endif
+
+#undef BOOST_LCAST_DEF
+#undef BOOST_LCAST_DEF1
+
+#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<char,float>
+ : lcast_src_length_floating<float>
+ {
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<char,double>
+ : lcast_src_length_floating<double>
+ {
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<char,long double>
+ : lcast_src_length_floating<long double>
+ {
+ static void check_coverage() {}
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<>
+ struct lcast_src_length<wchar_t,float>
+ : lcast_src_length_floating<float>
+ {
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<wchar_t,double>
+ : lcast_src_length_floating<double>
+ {
+ static void check_coverage() {}
+ };
+
+ template<>
+ struct lcast_src_length<wchar_t,long double>
+ : lcast_src_length_floating<long double>
+ {
+ static void check_coverage() {}
+ };
+
+#endif // #ifndef BOOST_LCAST_NO_WCHAR_T
+#endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
+ }
+
+ namespace detail // '0' and '-' constants
+ {
+ template<typename CharT> struct lcast_char_constants;
+
+ template<>
+ struct lcast_char_constants<char>
+ {
+ BOOST_STATIC_CONSTANT(char, zero = '0');
+ BOOST_STATIC_CONSTANT(char, minus = '-');
+ };
+
+#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'-');
+ };
+#endif
+ }
+
+ namespace detail // lexical_streambuf_fake
+ {
+ struct lexical_streambuf_fake
+ {
+ };
+ }
+
+ namespace detail // lcast_to_unsigned
+ {
+#if (defined _MSC_VER)
+# pragma warning( push )
+// C4146: unary minus operator applied to unsigned type, result still unsigned
+# pragma warning( disable : 4146 )
+#elif defined( __BORLANDC__ )
+# pragma option push -w-8041
+#endif
+ template<class T>
+ inline
+ BOOST_DEDUCED_TYPENAME make_unsigned<T>::type lcast_to_unsigned(T value)
+ {
+ typedef BOOST_DEDUCED_TYPENAME make_unsigned<T>::type result_type;
+ result_type uvalue = static_cast<result_type>(value);
+ return value < 0 ? -uvalue : uvalue;
+ }
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#elif defined( __BORLANDC__ )
+# pragma option pop
+#endif
+ }
+
+ namespace detail // lcast_put_unsigned
+ {
+ template<class Traits, class T, class CharT>
+ CharT* lcast_put_unsigned(T n, CharT* finish)
+ {
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+#endif
+
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ // TODO: use BOOST_NO_STD_LOCALE
+ std::locale loc;
+ 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();
+ CharT thousands_sep = grouping_size ? np.thousands_sep() : 0;
+ std::string::size_type group = 0; // current group number
+ char last_grp_size = grouping[0] <= 0 ? CHAR_MAX : grouping[0];
+ // a) Since grouping is const, grouping[grouping.size()] returns 0.
+ // b) It's safe to assume here and below that CHAR_MAX
+ // is equivalent to unlimited grouping:
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+ BOOST_STATIC_ASSERT(std::numeric_limits<T>::digits10 < CHAR_MAX);
+#endif
+
+ char left = last_grp_size;
+#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);
+
+ do
+ {
+#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
+ if(left == 0)
+ {
+ ++group;
+ if(group < grouping_size)
+ {
+ char const grp_size = grouping[group];
+ last_grp_size = grp_size <= 0 ? CHAR_MAX : grp_size;
+ }
+
+ left = last_grp_size;
+ --finish;
+ Traits::assign(*finish, thousands_sep);
+ }
+
+ --left;
+#endif
+
+ --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 // 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, (Source*)0, (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
+ }
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ 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
+
+#else
+ bool operator>>(std::basic_string<char_type,traits_type>& output)
+ {
+ stream.str().swap(output);
+ return true;
+ }
+
+ template<class Alloc>
+ bool operator>>(std::basic_string<char_type,traits_type,Alloc>& out)
+ {
+ std::basic_string<char_type,traits_type> str(stream.str());
+ out.assign(str.begin(), str.end());
+ 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
+ };
+ }
+
+ namespace detail // optimized stream wrapper
+ {
+ // String representation of Source has an upper limit.
+ template< class CharT // a result of widest_char transformation
+ , class Base // lexical_streambuf_fake or basic_streambuf<CharT>
+ , class Traits // usually char_traits<CharT>
+ >
+ class lexical_stream_limited_src : public Base
+ {
+ // A string representation of Source is written to [start, finish).
+ // Currently, it is assumed that [start, finish) is big enough
+ // to hold a string representation of any Source value.
+ CharT* start;
+ CharT* finish;
+
+ private:
+
+ static void widen_and_assign(char*p, char ch)
+ {
+ Traits::assign(*p, ch);
+ }
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ static void widen_and_assign(wchar_t* p, char ch)
+ {
+ // TODO: use BOOST_NO_STD_LOCALE
+ std::locale loc;
+ wchar_t w = BOOST_USE_FACET(std::ctype<wchar_t>, loc).widen(ch);
+ Traits::assign(*p, w);
+ }
+
+ static void widen_and_assign(wchar_t* p, wchar_t ch)
+ {
+ Traits::assign(*p, ch);
+ }
+
+ static void widen_and_assign(char*, wchar_t ch); // undefined
+#endif
+
+ template<class OutputStreamable>
+ bool lcast_put(const OutputStreamable& input)
+ {
+ this->setp(start, finish);
+ std::basic_ostream<CharT> stream(static_cast<Base*>(this));
+ lcast_set_precision(stream, (OutputStreamable*)0);
+ bool const result = !(stream << input).fail();
+ finish = this->pptr();
+ return result;
+ }
+
+ // Undefined:
+ lexical_stream_limited_src(lexical_stream_limited_src const&);
+ void operator=(lexical_stream_limited_src const&);
+
+ public:
+
+ lexical_stream_limited_src(CharT* sta, CharT* fin)
+ : start(sta)
+ , finish(fin)
+ {}
+
+ public: // output
+
+ template<class Alloc>
+ bool operator<<(std::basic_string<CharT,Traits,Alloc> const& str)
+ {
+ start = const_cast<CharT*>(str.data());
+ finish = start + str.length();
+ return true;
+ }
+
+ bool operator<<(bool);
+ bool operator<<(char);
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ bool operator<<(wchar_t);
+#endif
+ bool operator<<(CharT const*);
+ bool operator<<(short);
+ bool operator<<(int);
+ bool operator<<(long);
+ bool operator<<(unsigned short);
+ bool operator<<(unsigned int);
+ bool operator<<(unsigned long);
+#if defined(BOOST_HAS_LONG_LONG)
+ bool operator<<(boost::ulong_long_type);
+ bool operator<<(boost::long_long_type );
+#elif defined(BOOST_HAS_MS_INT64)
+ bool operator<<(unsigned __int64);
+ bool operator<<( __int64);
+#endif
+ // These three operators use ostream and streambuf.
+ // lcast_streambuf_for_source<T>::value is true.
+ bool operator<<(float);
+ bool operator<<(double);
+ bool operator<<(long double);
+
+ public: // input
+
+ // Generic istream-based algorithm.
+ // lcast_streambuf_for_target<InputStreamable>::value is true.
+ template<typename InputStreamable>
+ bool operator>>(InputStreamable& output)
+ {
+#if (defined _MSC_VER)
+# pragma warning( push )
+ // conditional expression is constant
+# pragma warning( disable : 4127 )
+#endif
+ if(is_pointer<InputStreamable>::value)
+ return false;
+
+ this->setg(start, start, finish);
+ std::basic_istream<CharT> stream(static_cast<Base*>(this));
+ stream.unsetf(std::ios::skipws);
+ lcast_set_precision(stream, (InputStreamable*)0);
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#endif
+ 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
+ }
+
+ bool operator>>(CharT&);
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+// This #if is in sync with lcast_streambuf_for_target
+
+ bool operator>>(std::string&);
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ bool operator>>(std::wstring&);
+#endif
+
+#else
+ template<class Alloc>
+ bool operator>>(std::basic_string<CharT,Traits,Alloc>& str)
+ {
+ str.assign(start, finish);
+ return true;
+ }
+#endif
+ };
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ bool value)
+ {
+ typedef typename Traits::int_type int_type;
+ CharT const czero = lcast_char_constants<CharT>::zero;
+ int_type const zero = Traits::to_int_type(czero);
+ Traits::assign(*start, Traits::to_char_type(zero + value));
+ finish = start + 1;
+ return true;
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ char ch)
+ {
+ widen_and_assign(start, ch);
+ finish = start + 1;
+ return true;
+ }
+
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ wchar_t ch)
+ {
+ widen_and_assign(start, ch);
+ finish = start + 1;
+ return true;
+ }
+#endif
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ short 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<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ int 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<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ long 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;
+ }
+
+#if defined(BOOST_HAS_LONG_LONG)
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ boost::long_long_type 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;
+ }
+#elif defined(BOOST_HAS_MS_INT64)
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ __int64 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;
+ }
+#endif
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ unsigned short n)
+ {
+ start = lcast_put_unsigned<Traits>(n, finish);
+ return true;
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ unsigned int n)
+ {
+ start = lcast_put_unsigned<Traits>(n, finish);
+ return true;
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ unsigned long n)
+ {
+ start = lcast_put_unsigned<Traits>(n, finish);
+ return true;
+ }
+
+#if defined(BOOST_HAS_LONG_LONG)
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ boost::ulong_long_type n)
+ {
+ start = lcast_put_unsigned<Traits>(n, finish);
+ return true;
+ }
+#elif defined(BOOST_HAS_MS_INT64)
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ unsigned __int64 n)
+ {
+ start = lcast_put_unsigned<Traits>(n, finish);
+ return true;
+ }
+#endif
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ float val)
+ {
+ return this->lcast_put(val);
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ double val)
+ {
+ return this->lcast_put(val);
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ long double val)
+ {
+ return this->lcast_put(val);
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+ CharT const* str)
+ {
+ start = const_cast<CharT*>(str);
+ finish = start + Traits::length(str);
+ return true;
+ }
+
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator>>(
+ CharT& output)
+ {
+ bool const ok = (finish - start == 1);
+ if(ok)
+ Traits::assign(output, *start);
+ return ok;
+ }
+
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator>>(
+ std::string& str)
+ {
+ str.assign(start, finish);
+ return true;
+ }
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<typename CharT, class Base, class Traits>
+ inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator>>(
+ std::wstring& str)
+ {
+ str.assign(start, finish);
+ return true;
+ }
+#endif
+#endif
+ }
+
+ namespace detail // lcast_streambuf_for_source
+ {
+ // Returns true if optimized stream wrapper needs ostream for writing.
+ template<class Source>
+ struct lcast_streambuf_for_source
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+
+ template<>
+ struct lcast_streambuf_for_source<float>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct lcast_streambuf_for_source<double>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct lcast_streambuf_for_source<long double>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+ }
+
+ namespace detail // lcast_streambuf_for_target
+ {
+ // Returns true if optimized stream wrapper needs istream for reading.
+ template<class Target>
+ struct lcast_streambuf_for_target
+ {
+ BOOST_STATIC_CONSTANT(bool, value = true);
+ };
+
+ template<>
+ struct lcast_streambuf_for_target<char>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+
+#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
+ template<>
+ struct lcast_streambuf_for_target<wchar_t>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+#endif
+
+#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+ template<class Traits, class Alloc>
+ struct lcast_streambuf_for_target<
+ std::basic_string<char,Traits,Alloc> >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<class Traits, class Alloc>
+ struct lcast_streambuf_for_target<
+ std::basic_string<wchar_t,Traits,Alloc> >
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+#endif
+#else
+ template<>
+ struct lcast_streambuf_for_target<std::string>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+
+#ifndef BOOST_LCAST_NO_WCHAR_T
+ template<>
+ struct lcast_streambuf_for_target<std::wstring>
+ {
+ BOOST_STATIC_CONSTANT(bool, value = false);
+ };
+#endif
+#endif
+ }
+
+ #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+
+ // call-by-const reference version
+
+ namespace detail
+ {
+ 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;
+ };
+
+ template< typename Target
+ , typename Source
+ , bool Unlimited // string representation of Source is unlimited
+ , typename CharT
+ >
+ Target lexical_cast(
+ BOOST_DEDUCED_TYPENAME boost::call_traits<Source>::param_type arg,
+ CharT* buf, std::size_t src_len)
+ {
+ typedef BOOST_DEDUCED_TYPENAME
+ deduce_char_traits<CharT,Target,Source>::type traits;
+
+ typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ lcast_streambuf_for_target<Target>::value ||
+ lcast_streambuf_for_source<Source>::value
+ , std::basic_streambuf<CharT>
+ , lexical_streambuf_fake
+ >::type base;
+
+ BOOST_DEDUCED_TYPENAME boost::mpl::if_c<
+ Unlimited
+ , detail::lexical_stream<Target,Source,traits>
+ , detail::lexical_stream_limited_src<CharT,base,traits>
+ >::type interpreter(buf, buf + src_len);
+
+ // The original form, reproduced below, is more elegant
+ // but yields a spurious C4701 warning ("possible use of
+ // "result" before initialization") with VC7.1 (/W4).
+//
+// Target result;
+//
+// if(!(interpreter << arg && interpreter >> result))
+// throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
+// return result;
+
+ if(interpreter << arg) {
+ Target result;
+ if (interpreter >> result)
+ return result;
+ }
+ throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
+ return Target(); // normally never reached (throw_exception)
+ }
+ }
+
+ template<typename Target, typename Source>
+ inline Target lexical_cast(const Source &arg)
+ {
+ typedef typename detail::array_to_pointer_decay<Source>::type src;
+
+ typedef typename detail::widest_char<
+ typename detail::stream_char<Target>::type
+ , typename detail::stream_char<src>::type
+ >::type char_type;
+
+ typedef detail::lcast_src_length<char_type, src> lcast_src_length;
+ std::size_t const src_len = lcast_src_length::value;
+ char_type buf[src_len + 1];
+ lcast_src_length::check_coverage();
+ return detail::lexical_cast<Target, src, !src_len>(arg, buf, src_len);
+ }
+
+ #else
+
+ // 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))
+ throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
+ return result;
+ }
+
+ #endif
+}
+
+// Copyright Kevlin Henney, 2000-2005.
+// Copyright Alexander Nasonov, 2006-2007.
+//
+// Distributed under the 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_NO_WCHAR_T
+#endif
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/limits.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/limits.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/limits.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/limits.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,146 @@
+
+// (C) Copyright John maddock 1999.
+// (C) 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)
+//
+// use this header as a workaround for missing <limits>
+
+// See http://www.boost.org/libs/utility/limits.html for documentation.
+
+#ifndef BOOST_LIMITS
+#define BOOST_LIMITS
+
+#include <boost/config.hpp>
+
+#ifdef BOOST_NO_LIMITS
+# include <boost/detail/limits.hpp>
+#else
+# include <limits>
+#endif
+
+#if (defined(BOOST_HAS_LONG_LONG) && defined(BOOST_NO_LONG_LONG_NUMERIC_LIMITS)) \
+ || (defined(BOOST_HAS_MS_INT64) && defined(BOOST_NO_MS_INT64_NUMERIC_LIMITS))
+// Add missing specializations for numeric_limits:
+#ifdef BOOST_HAS_MS_INT64
+# define BOOST_LLT __int64
+# define BOOST_ULLT unsigned __int64
+#else
+# define BOOST_LLT ::boost::long_long_type
+# define BOOST_ULLT ::boost::ulong_long_type
+#endif
+
+#include <climits> // for CHAR_BIT
+
+namespace std
+{
+ template<>
+ class numeric_limits<BOOST_LLT>
+ {
+ public:
+
+ BOOST_STATIC_CONSTANT(bool, is_specialized = true);
+#ifdef BOOST_HAS_MS_INT64
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x8000000000000000i64; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0x7FFFFFFFFFFFFFFFi64; }
+#elif defined(LLONG_MAX)
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MIN; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LLONG_MAX; }
+#elif defined(LONGLONG_MAX)
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MIN; }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return LONGLONG_MAX; }
+#else
+ static BOOST_LLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 1LL << (sizeof(BOOST_LLT) * CHAR_BIT - 1); }
+ static BOOST_LLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~(min)(); }
+#endif
+ BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT -1);
+ BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT) - 1) * 301L / 1000);
+ BOOST_STATIC_CONSTANT(bool, is_signed = true);
+ BOOST_STATIC_CONSTANT(bool, is_integer = true);
+ BOOST_STATIC_CONSTANT(bool, is_exact = true);
+ BOOST_STATIC_CONSTANT(int, radix = 2);
+ static BOOST_LLT epsilon() throw() { return 0; };
+ static BOOST_LLT round_error() throw() { return 0; };
+
+ BOOST_STATIC_CONSTANT(int, min_exponent = 0);
+ BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
+ BOOST_STATIC_CONSTANT(int, max_exponent = 0);
+ BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
+
+ BOOST_STATIC_CONSTANT(bool, has_infinity = false);
+ BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
+ BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
+ BOOST_STATIC_CONSTANT(bool, has_denorm = false);
+ BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
+ static BOOST_LLT infinity() throw() { return 0; };
+ static BOOST_LLT quiet_NaN() throw() { return 0; };
+ static BOOST_LLT signaling_NaN() throw() { return 0; };
+ static BOOST_LLT denorm_min() throw() { return 0; };
+
+ BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
+ BOOST_STATIC_CONSTANT(bool, is_bounded = true);
+ BOOST_STATIC_CONSTANT(bool, is_modulo = true);
+
+ BOOST_STATIC_CONSTANT(bool, traps = false);
+ BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
+ BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
+
+ };
+
+ template<>
+ class numeric_limits<BOOST_ULLT>
+ {
+ public:
+
+ BOOST_STATIC_CONSTANT(bool, is_specialized = true);
+#ifdef BOOST_HAS_MS_INT64
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0ui64; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0xFFFFFFFFFFFFFFFFui64; }
+#elif defined(ULLONG_MAX) && defined(ULLONG_MIN)
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MIN; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULLONG_MAX; }
+#elif defined(ULONGLONG_MAX) && defined(ULONGLONG_MIN)
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MIN; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ULONGLONG_MAX; }
+#else
+ static BOOST_ULLT min BOOST_PREVENT_MACRO_SUBSTITUTION (){ return 0uLL; }
+ static BOOST_ULLT max BOOST_PREVENT_MACRO_SUBSTITUTION (){ return ~0uLL; }
+#endif
+ BOOST_STATIC_CONSTANT(int, digits = sizeof(BOOST_LLT) * CHAR_BIT);
+ BOOST_STATIC_CONSTANT(int, digits10 = (CHAR_BIT * sizeof (BOOST_LLT)) * 301L / 1000);
+ BOOST_STATIC_CONSTANT(bool, is_signed = false);
+ BOOST_STATIC_CONSTANT(bool, is_integer = true);
+ BOOST_STATIC_CONSTANT(bool, is_exact = true);
+ BOOST_STATIC_CONSTANT(int, radix = 2);
+ static BOOST_ULLT epsilon() throw() { return 0; };
+ static BOOST_ULLT round_error() throw() { return 0; };
+
+ BOOST_STATIC_CONSTANT(int, min_exponent = 0);
+ BOOST_STATIC_CONSTANT(int, min_exponent10 = 0);
+ BOOST_STATIC_CONSTANT(int, max_exponent = 0);
+ BOOST_STATIC_CONSTANT(int, max_exponent10 = 0);
+
+ BOOST_STATIC_CONSTANT(bool, has_infinity = false);
+ BOOST_STATIC_CONSTANT(bool, has_quiet_NaN = false);
+ BOOST_STATIC_CONSTANT(bool, has_signaling_NaN = false);
+ BOOST_STATIC_CONSTANT(bool, has_denorm = false);
+ BOOST_STATIC_CONSTANT(bool, has_denorm_loss = false);
+ static BOOST_ULLT infinity() throw() { return 0; };
+ static BOOST_ULLT quiet_NaN() throw() { return 0; };
+ static BOOST_ULLT signaling_NaN() throw() { return 0; };
+ static BOOST_ULLT denorm_min() throw() { return 0; };
+
+ BOOST_STATIC_CONSTANT(bool, is_iec559 = false);
+ BOOST_STATIC_CONSTANT(bool, is_bounded = true);
+ BOOST_STATIC_CONSTANT(bool, is_modulo = true);
+
+ BOOST_STATIC_CONSTANT(bool, traps = false);
+ BOOST_STATIC_CONSTANT(bool, tinyness_before = false);
+ BOOST_STATIC_CONSTANT(float_round_style, round_style = round_toward_zero);
+
+ };
+}
+#endif
+
+#endif
+
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_signed.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_signed.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_signed.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_signed.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,137 @@
+
+// (C) 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).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+#ifndef BOOST_TT_MAKE_SIGNED_HPP_INCLUDED
+#define BOOST_TT_MAKE_SIGNED_HPP_INCLUDED
+
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_signed.hpp>
+#include <boost/type_traits/is_unsigned.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_volatile.hpp>
+#include <boost/type_traits/detail/ice_or.hpp>
+#include <boost/type_traits/detail/ice_and.hpp>
+#include <boost/type_traits/detail/ice_not.hpp>
+#include <boost/static_assert.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/type_trait_def.hpp>
+
+namespace boost {
+
+namespace detail {
+
+template <class T>
+struct make_signed_imp
+{
+ BOOST_STATIC_ASSERT(
+ (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_enum<T>::value>::value));
+#if !BOOST_WORKAROUND(BOOST_MSVC, <=1300)
+ BOOST_STATIC_ASSERT(
+ (::boost::type_traits::ice_not< ::boost::is_same<
+ typename remove_cv<T>::type, bool>::value>::value));
+#endif
+
+ typedef typename remove_cv<T>::type t_no_cv;
+ typedef typename mpl::if_c<
+ (::boost::type_traits::ice_and<
+ ::boost::is_signed<T>::value,
+ ::boost::is_integral<T>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value >::value),
+ T,
+ typename mpl::if_c<
+ (::boost::type_traits::ice_and<
+ ::boost::is_integral<T>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value>
+ ::value),
+ typename mpl::if_<
+ is_same<t_no_cv, unsigned char>,
+ signed char,
+ typename mpl::if_<
+ is_same<t_no_cv, unsigned short>,
+ signed short,
+ typename mpl::if_<
+ is_same<t_no_cv, unsigned int>,
+ int,
+ typename mpl::if_<
+ is_same<t_no_cv, unsigned long>,
+ long,
+#if defined(BOOST_HAS_LONG_LONG)
+ boost::long_long_type
+#elif defined(BOOST_HAS_MS_INT64)
+ __int64
+#else
+ long
+#endif
+ >::type
+ >::type
+ >::type
+ >::type,
+ // Not a regular integer type:
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned char),
+ signed char,
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned short),
+ signed short,
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned int),
+ int,
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned long),
+ long,
+#if defined(BOOST_HAS_LONG_LONG)
+ boost::long_long_type
+#elif defined(BOOST_HAS_MS_INT64)
+ __int64
+#else
+ long
+#endif
+ >::type
+ >::type
+ >::type
+ >::type
+ >::type
+ >::type base_integer_type;
+
+ // Add back any const qualifier:
+ typedef typename mpl::if_<
+ is_const<T>,
+ typename add_const<base_integer_type>::type,
+ base_integer_type
+ >::type const_base_integer_type;
+
+ // Add back any volatile qualifier:
+ typedef typename mpl::if_<
+ is_volatile<T>,
+ typename add_volatile<const_base_integer_type>::type,
+ const_base_integer_type
+ >::type type;
+};
+
+
+} // namespace detail
+
+BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_signed,T,typename boost::detail::make_signed_imp<T>::type)
+
+} // namespace boost
+
+#include <boost/type_traits/detail/type_trait_undef.hpp>
+
+#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
+
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_unsigned.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_unsigned.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_unsigned.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/make_unsigned.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,137 @@
+
+// (C) 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).
+//
+// See http://www.boost.org/libs/type_traits for most recent version including documentation.
+
+#ifndef BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED
+#define BOOST_TT_MAKE_UNSIGNED_HPP_INCLUDED
+
+#include <boost/mpl/if.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_signed.hpp>
+#include <boost/type_traits/is_unsigned.hpp>
+#include <boost/type_traits/is_enum.hpp>
+#include <boost/type_traits/is_same.hpp>
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_const.hpp>
+#include <boost/type_traits/is_volatile.hpp>
+#include <boost/type_traits/add_const.hpp>
+#include <boost/type_traits/add_volatile.hpp>
+#include <boost/type_traits/detail/ice_or.hpp>
+#include <boost/type_traits/detail/ice_and.hpp>
+#include <boost/type_traits/detail/ice_not.hpp>
+#include <boost/static_assert.hpp>
+
+// should be the last #include
+#include <boost/type_traits/detail/type_trait_def.hpp>
+
+namespace boost {
+
+namespace detail {
+
+template <class T>
+struct make_unsigned_imp
+{
+ BOOST_STATIC_ASSERT(
+ (::boost::type_traits::ice_or< ::boost::is_integral<T>::value, ::boost::is_enum<T>::value>::value));
+#if !BOOST_WORKAROUND(BOOST_MSVC, <=1300)
+ BOOST_STATIC_ASSERT(
+ (::boost::type_traits::ice_not< ::boost::is_same<
+ typename remove_cv<T>::type, bool>::value>::value));
+#endif
+
+ typedef typename remove_cv<T>::type t_no_cv;
+ typedef typename mpl::if_c<
+ (::boost::type_traits::ice_and<
+ ::boost::is_unsigned<T>::value,
+ ::boost::is_integral<T>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value >::value),
+ T,
+ typename mpl::if_c<
+ (::boost::type_traits::ice_and<
+ ::boost::is_integral<T>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, char>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, wchar_t>::value>::value,
+ ::boost::type_traits::ice_not< ::boost::is_same<t_no_cv, bool>::value>::value>
+ ::value),
+ typename mpl::if_<
+ is_same<t_no_cv, signed char>,
+ unsigned char,
+ typename mpl::if_<
+ is_same<t_no_cv, short>,
+ unsigned short,
+ typename mpl::if_<
+ is_same<t_no_cv, int>,
+ unsigned int,
+ typename mpl::if_<
+ is_same<t_no_cv, long>,
+ unsigned long,
+#if defined(BOOST_HAS_LONG_LONG)
+ boost::ulong_long_type
+#elif defined(BOOST_HAS_MS_INT64)
+ unsigned __int64
+#else
+ unsigned long
+#endif
+ >::type
+ >::type
+ >::type
+ >::type,
+ // Not a regular integer type:
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned char),
+ unsigned char,
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned short),
+ unsigned short,
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned int),
+ unsigned int,
+ typename mpl::if_c<
+ sizeof(t_no_cv) == sizeof(unsigned long),
+ unsigned long,
+#if defined(BOOST_HAS_LONG_LONG)
+ boost::ulong_long_type
+#elif defined(BOOST_HAS_MS_INT64)
+ unsigned __int64
+#else
+ unsigned long
+#endif
+ >::type
+ >::type
+ >::type
+ >::type
+ >::type
+ >::type base_integer_type;
+
+ // Add back any const qualifier:
+ typedef typename mpl::if_<
+ is_const<T>,
+ typename add_const<base_integer_type>::type,
+ base_integer_type
+ >::type const_base_integer_type;
+
+ // Add back any volatile qualifier:
+ typedef typename mpl::if_<
+ is_volatile<T>,
+ typename add_volatile<const_base_integer_type>::type,
+ const_base_integer_type
+ >::type type;
+};
+
+
+} // namespace detail
+
+BOOST_TT_AUX_TYPE_TRAIT_DEF1(make_unsigned,T,typename boost::detail::make_unsigned_imp<T>::type)
+
+} // namespace boost
+
+#include <boost/type_traits/detail/type_trait_undef.hpp>
+
+#endif // BOOST_TT_ADD_REFERENCE_HPP_INCLUDED
+
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/mem_fn.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/mem_fn.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/mem_fn.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/mem_fn.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,389 @@
+#ifndef BOOST_MEM_FN_HPP_INCLUDED
+#define BOOST_MEM_FN_HPP_INCLUDED
+
+// MS compatible compilers support #pragma once
+
+#if defined(_MSC_VER) && (_MSC_VER >= 1020)
+# pragma once
+#endif
+
+//
+// mem_fn.hpp - a generalization of std::mem_fun[_ref]
+//
+// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
+// Copyright (c) 2001 David Abrahams
+// Copyright (c) 2003-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/mem_fn.html for documentation.
+//
+
+#include <boost/config.hpp>
+#include <boost/get_pointer.hpp>
+#include <boost/detail/workaround.hpp>
+
+namespace boost
+{
+
+#if defined(BOOST_NO_VOID_RETURNS)
+
+#define BOOST_MEM_FN_CLASS_F , class F
+#define BOOST_MEM_FN_TYPEDEF(X)
+
+namespace _mfi // mem_fun_impl
+{
+
+template<class V> struct mf
+{
+
+#define BOOST_MEM_FN_RETURN return
+
+#define BOOST_MEM_FN_NAME(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+}; // struct mf<V>
+
+template<> struct mf<void>
+{
+
+#define BOOST_MEM_FN_RETURN
+
+#define BOOST_MEM_FN_NAME(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) inner_##X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+}; // struct mf<void>
+
+#undef BOOST_MEM_FN_CLASS_F
+#undef BOOST_MEM_FN_TYPEDEF_F
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_NAME2(X) inner_##X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) X##_cdecl
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_fastcall
+#define BOOST_MEM_FN_NAME2(X) inner_##X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_vw.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_NAME2
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+} // namespace _mfi
+
+#else // #ifdef BOOST_NO_VOID_RETURNS
+
+#define BOOST_MEM_FN_CLASS_F
+#define BOOST_MEM_FN_TYPEDEF(X) typedef X;
+
+namespace _mfi
+{
+
+#define BOOST_MEM_FN_RETURN return
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_template.hpp>
+
+#undef BOOST_MEM_FN_CC
+#undef BOOST_MEM_FN_NAME
+
+#endif
+
+#undef BOOST_MEM_FN_RETURN
+
+} // namespace _mfi
+
+#undef BOOST_MEM_FN_CLASS_F
+#undef BOOST_MEM_FN_TYPEDEF
+
+#endif // #ifdef BOOST_NO_VOID_RETURNS
+
+#define BOOST_MEM_FN_NAME(X) X
+#define BOOST_MEM_FN_CC
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#ifdef BOOST_MEM_FN_ENABLE_CDECL
+
+#define BOOST_MEM_FN_NAME(X) X##_cdecl
+#define BOOST_MEM_FN_CC __cdecl
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_STDCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_stdcall
+#define BOOST_MEM_FN_CC __stdcall
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+#ifdef BOOST_MEM_FN_ENABLE_FASTCALL
+
+#define BOOST_MEM_FN_NAME(X) X##_fastcall
+#define BOOST_MEM_FN_CC __fastcall
+
+#include <boost/bind/mem_fn_cc.hpp>
+
+#undef BOOST_MEM_FN_NAME
+#undef BOOST_MEM_FN_CC
+
+#endif
+
+// data member support
+
+namespace _mfi
+{
+
+template<class R, class T> class dm
+{
+public:
+
+ typedef R const & result_type;
+ typedef T const * argument_type;
+
+private:
+
+ typedef R (T::*F);
+ F f_;
+
+ template<class U> R const & call(U & u, T const *) const
+ {
+ return (u.*f_);
+ }
+
+ template<class U> R const & call(U & u, void const *) const
+ {
+ return (get_pointer(u)->*f_);
+ }
+
+public:
+
+ explicit dm(F f): f_(f) {}
+
+ R & operator()(T * p) const
+ {
+ return (p->*f_);
+ }
+
+ R const & operator()(T const * p) const
+ {
+ return (p->*f_);
+ }
+
+ template<class U> R const & operator()(U const & u) const
+ {
+ return call(u, &u);
+ }
+
+#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300) && !BOOST_WORKAROUND(__MWERKS__, < 0x3200)
+
+ R & operator()(T & t) const
+ {
+ return (t.*f_);
+ }
+
+ R const & operator()(T const & t) const
+ {
+ return (t.*f_);
+ }
+
+#endif
+
+ bool operator==(dm const & rhs) const
+ {
+ return f_ == rhs.f_;
+ }
+
+ bool operator!=(dm const & rhs) const
+ {
+ return f_ != rhs.f_;
+ }
+};
+
+} // namespace _mfi
+
+template<class R, class T> _mfi::dm<R, T> mem_fn(R T::*f)
+{
+ return _mfi::dm<R, T>(f);
+}
+
+} // namespace boost
+
+#endif // #ifndef BOOST_MEM_FN_HPP_INCLUDED
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_all_extents.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_all_extents.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_all_extents.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_all_extents.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,47 @@
+// Copyright (C) 2004 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_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_ALL_EXTENT_HOLT_2004_0827
+
+#include <boost/type_traits/msvc/typeof.hpp>
+#include <boost/type_traits/is_array.hpp>
+
+namespace boost {
+ template<typename T>
+ struct remove_all_extents;
+
+ namespace detail {
+ template<bool IsArray>
+ struct remove_all_extents_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ };
+ template<>
+ struct remove_all_extents_impl_typeof<true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U[]);
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type reduced_type;
+ typedef typename remove_all_extents<reduced_type>::type type;
+ };
+ };
+ } //namespace detail
+
+ template<typename T>
+ struct remove_all_extents {
+ typedef typename detail::remove_all_extents_impl_typeof<
+ boost::is_array<T>::value
+ >::template inner<T,remove_all_extents<T> >::type type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_all_extents,T)
+ };
+} //namespace boost
+
+#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
+
Added: incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_bounds.hpp
URL: http://svn.apache.org/viewvc/incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_bounds.hpp?rev=1131945&view=auto
==============================================================================
--- incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_bounds.hpp (added)
+++ incubator/mesos/trunk/src/third_party/libprocess/third_party/boost-1.37.0/boost/msvc/remove_bounds.hpp Sun Jun 5 06:40:23 2011
@@ -0,0 +1,43 @@
+// Copyright (C) 2004 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_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
+#define BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
+
+#include <boost/type_traits/msvc/typeof.hpp>
+#include <boost/type_traits/is_array.hpp>
+
+namespace boost {
+ namespace detail {
+ template<bool IsArray>
+ struct remove_bounds_impl_typeof {
+ template<typename T,typename ID>
+ struct inner {
+ typedef T type;
+ };
+ };
+ template<>
+ struct remove_bounds_impl_typeof<true> {
+ template<typename T,typename ID>
+ struct inner {
+ template<typename U>
+ static msvc_register_type<U,ID> test(U[]);
+ static msvc_register_type<T,ID> test(...);
+ BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( *((T*)NULL) ) ));
+ typedef typename msvc_extract_type<ID>::id2type::type type;
+ };
+ };
+ } //namespace detail
+
+ template<typename T>
+ struct remove_bounds {
+ typedef typename detail::remove_bounds_impl_typeof<
+ boost::is_array<T>::value
+ >::template inner<T,remove_bounds<T> >::type type;
+ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_bounds,T)
+ };
+} //namespace boost
+
+#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_BOUNDS_HOLT_2004_0827
+