mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 01:59:02 +00:00
update to boost 1.46.1. Tested on Win, Mac, Linux, GCC 4.2, 4.4, 4.5, 4.6
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38953 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
afad4dc1ea
commit
62692a06df
@ -13,6 +13,7 @@
|
||||
* accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
*
|
||||
* 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)
|
||||
@ -69,10 +70,13 @@ namespace boost {
|
||||
typedef std::ptrdiff_t difference_type;
|
||||
|
||||
// iterator support
|
||||
iterator begin() { return elems; }
|
||||
const_iterator begin() const { return elems; }
|
||||
iterator end() { return elems+N; }
|
||||
const_iterator end() const { return elems+N; }
|
||||
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)
|
||||
@ -99,10 +103,17 @@ namespace boost {
|
||||
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)
|
||||
@ -200,10 +211,13 @@ namespace boost {
|
||||
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 ) ); }
|
||||
iterator end() { return begin(); }
|
||||
const_iterator end() const { return begin(); }
|
||||
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)
|
||||
@ -230,10 +244,17 @@ namespace boost {
|
||||
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*/)
|
||||
@ -346,7 +367,34 @@ namespace boost {
|
||||
x.swap(y);
|
||||
}
|
||||
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
#if defined(__SUNPRO_CC)
|
||||
// Trac ticket #4757; the Sun Solaris compiler can't handle
|
||||
// syntax like 'T(&get_c_array(boost::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 boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
typename detail::c_array<T,N>::type& get_c_array(boost::array<T,N>& arg)
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
|
||||
// Specific for boost::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 boost::array<T,N>& arg)
|
||||
{
|
||||
return arg.elems;
|
||||
}
|
||||
#else
|
||||
// Specific for boost::array: simply returns its elems data member.
|
||||
template <typename T, std::size_t N>
|
||||
T(&get_c_array(boost::array<T,N>& arg))[N]
|
||||
{
|
||||
@ -359,7 +407,8 @@ namespace boost {
|
||||
{
|
||||
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
|
||||
|
@ -1,8 +1,11 @@
|
||||
//
|
||||
// boost/assert.hpp - BOOST_ASSERT(expr)
|
||||
// BOOST_ASSERT_MSG(expr, msg)
|
||||
// BOOST_VERIFY(expr)
|
||||
//
|
||||
// Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2007 Peter Dimov
|
||||
// Copyright (c) Beman Dawes 2011
|
||||
//
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
@ -13,6 +16,16 @@
|
||||
// See http://www.boost.org/libs/utility/assert.html for documentation.
|
||||
//
|
||||
|
||||
//
|
||||
// Stop inspect complaining about use of 'assert':
|
||||
//
|
||||
// boostinspect:naassert_macro
|
||||
//
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// BOOST_ASSERT //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#undef BOOST_ASSERT
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS)
|
||||
@ -25,18 +38,86 @@
|
||||
|
||||
namespace boost
|
||||
{
|
||||
|
||||
void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined
|
||||
|
||||
void assertion_failed(char const * expr,
|
||||
char const * function, char const * file, long line); // user defined
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
#define BOOST_ASSERT(expr) ((expr) \
|
||||
? ((void)0) \
|
||||
: ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
|
||||
#else
|
||||
# include <assert.h> // .h to support old libraries w/o <cassert> - effect is the same
|
||||
# define BOOST_ASSERT(expr) assert(expr)
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// BOOST_ASSERT_MSG //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
# undef BOOST_ASSERT_MSG
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG)
|
||||
|
||||
#define BOOST_ASSERT_MSG(expr, msg) ((void)0)
|
||||
|
||||
#elif defined(BOOST_ENABLE_ASSERT_HANDLER)
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
namespace boost
|
||||
{
|
||||
void assertion_failed_msg(char const * expr, char const * msg,
|
||||
char const * function, char const * file, long line); // user defined
|
||||
} // namespace boost
|
||||
|
||||
#define BOOST_ASSERT_MSG(expr, msg) ((expr) \
|
||||
? ((void)0) \
|
||||
: ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
|
||||
#else
|
||||
#ifndef BOOST_ASSERT_HPP
|
||||
#define BOOST_ASSERT_HPP
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
// IDE's like Visual Studio perform better if output goes to std::cout or
|
||||
// some other stream, so allow user to configure output stream:
|
||||
#ifndef BOOST_ASSERT_MSG_OSTREAM
|
||||
# define BOOST_ASSERT_MSG_OSTREAM std::cerr
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace assertion
|
||||
{
|
||||
namespace detail
|
||||
{
|
||||
inline void assertion_failed_msg(char const * expr, char const * msg, char const * function,
|
||||
char const * file, long line)
|
||||
{
|
||||
BOOST_ASSERT_MSG_OSTREAM
|
||||
<< "***** Internal Program Error - assertion (" << expr << ") failed in "
|
||||
<< function << ":\n"
|
||||
<< file << '(' << line << "): " << msg << std::endl;
|
||||
std::abort();
|
||||
}
|
||||
} // detail
|
||||
} // assertion
|
||||
} // detail
|
||||
#endif
|
||||
|
||||
#define BOOST_ASSERT_MSG(expr, msg) ((expr) \
|
||||
? ((void)0) \
|
||||
: ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \
|
||||
BOOST_CURRENT_FUNCTION, __FILE__, __LINE__))
|
||||
#endif
|
||||
|
||||
//--------------------------------------------------------------------------------------//
|
||||
// BOOST_VERIFY //
|
||||
//--------------------------------------------------------------------------------------//
|
||||
|
||||
#undef BOOST_VERIFY
|
||||
|
||||
#if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) )
|
||||
|
@ -1,5 +1,7 @@
|
||||
//
|
||||
// (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)
|
||||
@ -36,14 +38,14 @@ namespace boost
|
||||
//
|
||||
// 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>))
|
||||
|
||||
@ -56,20 +58,21 @@ namespace boost
|
||||
# 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> {};
|
||||
@ -87,7 +90,7 @@ namespace boost
|
||||
# endif
|
||||
|
||||
BOOST_concept(SignedInteger,(T)) {
|
||||
BOOST_CONCEPT_USAGE(SignedInteger) {
|
||||
BOOST_CONCEPT_USAGE(SignedInteger) {
|
||||
x.error_type_must_be_a_signed_integer_type();
|
||||
}
|
||||
private:
|
||||
@ -101,16 +104,16 @@ namespace boost
|
||||
template <> struct SignedInteger< ::boost::long_long_type> {};
|
||||
# elif defined(BOOST_HAS_MS_INT64)
|
||||
template <> struct SignedInteger<__int64> {};
|
||||
# endif
|
||||
# endif
|
||||
|
||||
BOOST_concept(UnsignedInteger,(T)) {
|
||||
BOOST_CONCEPT_USAGE(UnsignedInteger) {
|
||||
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> {};
|
||||
@ -136,23 +139,24 @@ namespace boost
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(Assignable) {
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = a; // require assignment operator
|
||||
a = b; // require assignment operator
|
||||
#endif
|
||||
const_constraints(a);
|
||||
const_constraints(b);
|
||||
}
|
||||
private:
|
||||
void const_constraints(const TT& b) {
|
||||
void const_constraints(const TT& x) {
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = b; // const required for argument to assignment
|
||||
a = x; // const required for argument to assignment
|
||||
#else
|
||||
ignore_unused_variable_warning(b);
|
||||
ignore_unused_variable_warning(x);
|
||||
#endif
|
||||
}
|
||||
private:
|
||||
TT a;
|
||||
TT b;
|
||||
};
|
||||
|
||||
|
||||
|
||||
BOOST_concept(CopyConstructible,(TT))
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(CopyConstructible) {
|
||||
@ -180,22 +184,23 @@ namespace boost
|
||||
BOOST_concept(SGIAssignable,(TT))
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(SGIAssignable) {
|
||||
TT b(a);
|
||||
TT c(a);
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = a; // require assignment operator
|
||||
a = b; // require assignment operator
|
||||
#endif
|
||||
const_constraints(a);
|
||||
ignore_unused_variable_warning(b);
|
||||
const_constraints(b);
|
||||
ignore_unused_variable_warning(c);
|
||||
}
|
||||
private:
|
||||
void const_constraints(const TT& b) {
|
||||
TT c(b);
|
||||
void const_constraints(const TT& x) {
|
||||
TT c(x);
|
||||
#if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL
|
||||
a = b; // const required for argument to assignment
|
||||
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 )
|
||||
@ -297,7 +302,7 @@ namespace boost
|
||||
BOOST_concept(Generator,(Func)(Return))
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(Generator) { test(is_void<Return>()); }
|
||||
|
||||
|
||||
private:
|
||||
void test(boost::mpl::false_)
|
||||
{
|
||||
@ -310,22 +315,22 @@ namespace boost
|
||||
{
|
||||
f();
|
||||
}
|
||||
|
||||
|
||||
Func f;
|
||||
};
|
||||
|
||||
BOOST_concept(UnaryFunction,(Func)(Return)(Arg))
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(UnaryFunction) { test(is_void<Return>()); }
|
||||
|
||||
|
||||
private:
|
||||
void test(boost::mpl::false_)
|
||||
{
|
||||
f(arg); // "priming the pump" this way keeps msvc6 happy (ICE)
|
||||
Return r = f(arg);
|
||||
ignore_unused_variable_warning(r);
|
||||
ignore_unused_variable_warning(r);
|
||||
}
|
||||
|
||||
|
||||
void test(boost::mpl::true_)
|
||||
{
|
||||
f(arg);
|
||||
@ -354,12 +359,21 @@ namespace boost
|
||||
Return r = f(first, second); // require operator()
|
||||
(void)r;
|
||||
}
|
||||
|
||||
|
||||
void test(boost::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& boost::BinaryFunction<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
BinaryFunction();
|
||||
#endif
|
||||
|
||||
Func f;
|
||||
First first;
|
||||
Second second;
|
||||
@ -371,6 +385,15 @@ namespace boost
|
||||
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& boost::UnaryPredicate<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
UnaryPredicate();
|
||||
#endif
|
||||
|
||||
Func f;
|
||||
Arg arg;
|
||||
};
|
||||
@ -381,6 +404,14 @@ namespace boost
|
||||
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& boost::BinaryPredicate<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
BinaryPredicate();
|
||||
#endif
|
||||
Func f;
|
||||
First a;
|
||||
Second b;
|
||||
@ -390,7 +421,7 @@ namespace boost
|
||||
BOOST_concept(Const_BinaryPredicate,(Func)(First)(Second))
|
||||
: BinaryPredicate<Func, First, Second>
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(Const_BinaryPredicate) {
|
||||
BOOST_CONCEPT_USAGE(Const_BinaryPredicate) {
|
||||
const_constraints(f);
|
||||
}
|
||||
private:
|
||||
@ -398,6 +429,15 @@ namespace boost
|
||||
// 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& boost::Const_BinaryPredicate<YourClassHere>::arg"
|
||||
// in class without a constructor [-Wuninitialized])
|
||||
Const_BinaryPredicate();
|
||||
#endif
|
||||
|
||||
Func f;
|
||||
First a;
|
||||
Second b;
|
||||
@ -407,7 +447,7 @@ namespace boost
|
||||
: Generator<Func, typename Func::result_type>
|
||||
{
|
||||
typedef typename Func::result_type result_type;
|
||||
|
||||
|
||||
BOOST_CONCEPT_USAGE(AdaptableGenerator)
|
||||
{
|
||||
BOOST_CONCEPT_ASSERT((Convertible<result_type, Return>));
|
||||
@ -438,7 +478,7 @@ namespace boost
|
||||
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>));
|
||||
@ -476,7 +516,7 @@ namespace boost
|
||||
{
|
||||
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
|
||||
@ -490,7 +530,7 @@ namespace boost
|
||||
: Assignable<TT>
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(OutputIterator) {
|
||||
|
||||
|
||||
++i; // require preincrement operator
|
||||
i++; // require postincrement operator
|
||||
*i++ = t; // require postincrement and assignment
|
||||
@ -509,11 +549,11 @@ namespace boost
|
||||
BOOST_DEDUCED_TYPENAME ForwardIterator::iterator_category
|
||||
, std::forward_iterator_tag
|
||||
>));
|
||||
|
||||
|
||||
typename InputIterator<TT>::reference r = *i;
|
||||
ignore_unused_variable_warning(r);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
TT i;
|
||||
};
|
||||
@ -575,7 +615,7 @@ namespace boost
|
||||
n = i - j; // require difference operator
|
||||
(void)i[n]; // require element access operator
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
TT a, b;
|
||||
TT i, j;
|
||||
@ -613,7 +653,7 @@ namespace boost
|
||||
BOOST_CONCEPT_ASSERT((InputIterator<const_iterator>));
|
||||
const_constraints(c);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
void const_constraints(const C& cc) {
|
||||
i = cc.begin();
|
||||
@ -634,19 +674,19 @@ namespace boost
|
||||
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;
|
||||
@ -662,7 +702,7 @@ namespace boost
|
||||
typename ForwardContainer::const_iterator
|
||||
>));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
BOOST_concept(Mutable_ForwardContainer,(C))
|
||||
: ForwardContainer<C>
|
||||
@ -675,7 +715,7 @@ namespace boost
|
||||
typename Mutable_ForwardContainer::iterator
|
||||
>));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
BOOST_concept(ReversibleContainer,(C))
|
||||
: ForwardContainer<C>
|
||||
@ -689,9 +729,9 @@ namespace boost
|
||||
BOOST_CONCEPT_ASSERT((
|
||||
BidirectionalIterator<
|
||||
typename ReversibleContainer::const_iterator>));
|
||||
|
||||
|
||||
BOOST_CONCEPT_ASSERT((BidirectionalIterator<const_reverse_iterator>));
|
||||
|
||||
|
||||
const_constraints(c);
|
||||
}
|
||||
private:
|
||||
@ -708,17 +748,17 @@ namespace boost
|
||||
, 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:
|
||||
private:
|
||||
C c;
|
||||
};
|
||||
|
||||
@ -734,7 +774,7 @@ namespace boost
|
||||
RandomAccessIterator<
|
||||
typename RandomAccessContainer::const_iterator
|
||||
>));
|
||||
|
||||
|
||||
const_constraints(c);
|
||||
}
|
||||
private:
|
||||
@ -743,7 +783,7 @@ namespace boost
|
||||
const_reference r = cc[n];
|
||||
ignore_unused_variable_warning(r);
|
||||
}
|
||||
|
||||
|
||||
C c;
|
||||
size_type n;
|
||||
};
|
||||
@ -759,11 +799,11 @@ namespace boost
|
||||
{
|
||||
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;
|
||||
@ -779,7 +819,7 @@ namespace boost
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(Sequence)
|
||||
{
|
||||
S
|
||||
S
|
||||
c(n),
|
||||
c2(n, t),
|
||||
c3(first, last);
|
||||
@ -804,7 +844,7 @@ namespace boost
|
||||
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;
|
||||
@ -863,11 +903,11 @@ namespace boost
|
||||
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:
|
||||
@ -893,7 +933,7 @@ namespace boost
|
||||
BOOST_CONCEPT_USAGE(UniqueAssociativeContainer)
|
||||
{
|
||||
C c(first, last);
|
||||
|
||||
|
||||
pos_flag = c.insert(t);
|
||||
c.insert(first, last);
|
||||
|
||||
@ -911,7 +951,7 @@ namespace boost
|
||||
BOOST_CONCEPT_USAGE(MultipleAssociativeContainer)
|
||||
{
|
||||
C c(first, last);
|
||||
|
||||
|
||||
pos = c.insert(t);
|
||||
c.insert(first, last);
|
||||
|
||||
@ -954,7 +994,7 @@ namespace boost
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(SortedAssociativeContainer)
|
||||
{
|
||||
C
|
||||
C
|
||||
c(kc),
|
||||
c2(first, last),
|
||||
c3(first, last, kc);
|
||||
@ -962,15 +1002,15 @@ namespace boost
|
||||
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();
|
||||
@ -980,7 +1020,7 @@ namespace boost
|
||||
cp = c.lower_bound(k);
|
||||
cr = c.equal_range(k);
|
||||
}
|
||||
|
||||
|
||||
private:
|
||||
typename C::key_compare kc;
|
||||
typename C::value_compare vc;
|
||||
@ -999,6 +1039,42 @@ namespace boost
|
||||
|
||||
// HashedAssociativeContainer
|
||||
|
||||
BOOST_concept(Collection,(C))
|
||||
{
|
||||
BOOST_CONCEPT_USAGE(Collection)
|
||||
{
|
||||
boost::function_requires<boost::InputIteratorConcept<iterator> >();
|
||||
boost::function_requires<boost::InputIteratorConcept<const_iterator> >();
|
||||
boost::function_requires<boost::CopyConstructibleConcept<value_type> >();
|
||||
const_constraints(c);
|
||||
i = c.begin();
|
||||
i = c.end();
|
||||
c.swap(c);
|
||||
}
|
||||
|
||||
void const_constraints(const C& c) {
|
||||
ci = c.begin();
|
||||
ci = c.end();
|
||||
n = c.size();
|
||||
b = c.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 boost
|
||||
|
||||
# include <boost/concept/detail/concept_undef.hpp>
|
||||
|
@ -362,7 +362,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
&& defined(BOOST_LIB_VERSION)
|
||||
|
||||
#ifdef BOOST_AUTO_LINK_TAGGED
|
||||
# pragma commentcomment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
|
||||
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
|
||||
# ifdef BOOST_LIB_DIAGNOSTIC
|
||||
# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
|
||||
# endif
|
||||
@ -414,7 +414,4 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
|
||||
#if defined(BOOST_DYN_LINK)
|
||||
# undef BOOST_DYN_LINK
|
||||
#endif
|
||||
#if defined(BOOST_AUTO_LINK_NOMANGLE)
|
||||
# undef BOOST_AUTO_LINK_NOMANGLE
|
||||
#endif
|
||||
|
||||
|
@ -46,6 +46,8 @@
|
||||
// Borland C++Builder 5, command-line compiler 5.5:
|
||||
# define BOOST_NO_OPERATORS_IN_NAMESPACE
|
||||
# endif
|
||||
// Variadic macros do not exist for C++ Builder versions 5 and below
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
# endif
|
||||
|
||||
// Version 5.51 and below:
|
||||
|
@ -62,10 +62,13 @@
|
||||
#if (__EDG_VERSION__ < 310)
|
||||
# define BOOST_NO_EXTERN_TEMPLATE
|
||||
#endif
|
||||
#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
|
||||
#if (__EDG_VERSION__ <= 310)
|
||||
// No support for initializer lists
|
||||
# define BOOST_NO_INITIALIZER_LISTS
|
||||
#endif
|
||||
#if (__EDG_VERSION__ < 400)
|
||||
# define BOOST_NO_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
#define BOOST_NO_AUTO_DECLARATIONS
|
||||
#define BOOST_NO_AUTO_MULTIDECLARATIONS
|
||||
@ -94,6 +97,3 @@
|
||||
// However, some libraries have insufficient "long long" support
|
||||
// #define BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -80,6 +80,9 @@
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#if (__DMC__ < 0x812)
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
#if __DMC__ < 0x800
|
||||
#error "Compiler not supported or configured - please reconfigure"
|
||||
|
@ -43,6 +43,8 @@
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# define BOOST_NO_IS_ABSTRACT
|
||||
# define BOOST_NO_EXTERN_TEMPLATE
|
||||
// Variadic macros do not exist for gcc versions before 3.0
|
||||
# define BOOST_NO_VARIADIC_MACROS
|
||||
#elif __GNUC__ == 3
|
||||
# if defined (__PATHSCALE__)
|
||||
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
||||
@ -113,7 +115,7 @@
|
||||
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
|
||||
//
|
||||
#if __GNUC__ >= 4
|
||||
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
|
||||
# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__)
|
||||
// All Win32 development environments, including 64-bit Windows and MinGW, define
|
||||
// _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment,
|
||||
// so does not define _WIN32 or its variants.
|
||||
@ -146,8 +148,6 @@
|
||||
|
||||
// C++0x features not implemented in any GCC version
|
||||
//
|
||||
#define BOOST_NO_CONSTEXPR
|
||||
#define BOOST_NO_NULLPTR
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
|
||||
// C++0x features in 4.3.n and later
|
||||
@ -209,6 +209,13 @@
|
||||
# define BOOST_NO_UNICODE_LITERALS
|
||||
#endif
|
||||
|
||||
// C++0x features in 4.5.n and later
|
||||
//
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
#define BOOST_NO_CONSTEXPR
|
||||
#define BOOST_NO_NULLPTR
|
||||
#endif
|
||||
|
||||
// ConceptGCC compiler:
|
||||
// http://www.generic-programming.org/software/ConceptGCC/
|
||||
#ifdef __GXX_CONCEPTS__
|
||||
@ -229,8 +236,8 @@
|
||||
# error "Compiler not configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 4.4 (Pre-release):
|
||||
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 4))
|
||||
// last known and checked version is 4.6 (Pre-release):
|
||||
#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6))
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# else
|
||||
|
@ -35,6 +35,7 @@
|
||||
# define BOOST_NO_RVALUE_REFERENCES
|
||||
# define BOOST_NO_STATIC_ASSERT
|
||||
# define BOOST_NO_VARIADIC_TEMPLATES
|
||||
# define BOOST_NO_VARIADIC_MACROS
|
||||
# define BOOST_NO_AUTO_DECLARATIONS
|
||||
# define BOOST_NO_AUTO_MULTIDECLARATIONS
|
||||
# define BOOST_NO_CHAR16_T
|
||||
|
@ -115,6 +115,16 @@
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
|
||||
/*
|
||||
See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and
|
||||
https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443436
|
||||
*/
|
||||
|
||||
#if (__HP_aCC < 62500) || !defined(HP_CXX0x_SOURCE)
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
//
|
||||
|
@ -26,7 +26,19 @@
|
||||
# define BOOST_INTEL_CXX_VERSION __ECC
|
||||
#endif
|
||||
|
||||
// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x'
|
||||
#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && __STDC_HOSTED__) || defined(__GXX_EXPERIMENTAL_CPP0X__)
|
||||
# define BOOST_INTEL_STDCXX0X
|
||||
#endif
|
||||
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
||||
# define BOOST_INTEL_STDCXX0X
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_INTEL_STDCXX0X
|
||||
#define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
|
||||
#else
|
||||
#define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION)
|
||||
#endif
|
||||
#define BOOST_INTEL BOOST_INTEL_CXX_VERSION
|
||||
|
||||
#if defined(_WIN32) || defined(_WIN64)
|
||||
@ -99,7 +111,7 @@
|
||||
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
|
||||
# endif
|
||||
#endif
|
||||
#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1110)
|
||||
#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1200)
|
||||
// GCC or VC emulation:
|
||||
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
||||
#endif
|
||||
@ -179,6 +191,32 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
|
||||
# define BOOST_SYMBOL_IMPORT
|
||||
# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
|
||||
#endif
|
||||
//
|
||||
// C++0x features
|
||||
// - ICC added static_assert in 11.0 (first version with C++0x support)
|
||||
//
|
||||
#if defined(BOOST_INTEL_STDCXX0X)
|
||||
# undef BOOST_NO_STATIC_ASSERT
|
||||
//
|
||||
// These pass our test cases, but aren't officially supported according to:
|
||||
// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/
|
||||
//
|
||||
//# undef BOOST_NO_LAMBDAS
|
||||
//# undef BOOST_NO_DECLTYPE
|
||||
//# undef BOOST_NO_AUTO_DECLARATIONS
|
||||
//# undef BOOST_NO_AUTO_MULTIDECLARATIONS
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200)
|
||||
# undef BOOST_NO_RVALUE_REFERENCES
|
||||
# undef BOOST_NO_SCOPED_ENUMS
|
||||
# undef BOOST_NO_DELETED_FUNCTIONS
|
||||
# undef BOOST_NO_DEFAULTED_FUNCTIONS
|
||||
# undef BOOST_NO_LAMBDAS
|
||||
# undef BOOST_NO_DECLTYPE
|
||||
# undef BOOST_NO_AUTO_DECLARATIONS
|
||||
# undef BOOST_NO_AUTO_MULTIDECLARATIONS
|
||||
#endif
|
||||
|
||||
//
|
||||
// last known and checked version:
|
||||
|
@ -114,6 +114,7 @@
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
#define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
|
||||
|
||||
|
@ -63,6 +63,7 @@
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
//
|
||||
// versions check:
|
||||
|
@ -70,6 +70,7 @@
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
//
|
||||
// version check:
|
||||
|
@ -122,6 +122,7 @@
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#define BOOST_NO_VARIADIC_MACROS
|
||||
|
||||
//
|
||||
// Version
|
||||
|
@ -27,7 +27,6 @@
|
||||
|
||||
#if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG)
|
||||
# define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS
|
||||
# define BOOST_NO_INITIALIZER_LISTS
|
||||
#endif
|
||||
|
||||
#if (__IBMCPP__ <= 1110)
|
||||
@ -54,43 +53,66 @@
|
||||
#error "Compiler not supported or configured - please reconfigure"
|
||||
#endif
|
||||
//
|
||||
// last known and checked version is 600:
|
||||
#if (__IBMCPP__ > 1010)
|
||||
// last known and checked version is 1110:
|
||||
#if (__IBMCPP__ > 1110)
|
||||
# if defined(BOOST_ASSERT_CONFIG)
|
||||
# error "Unknown compiler version - please run the configure tests and report the results"
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Some versions of the compiler have issues with default arguments on partial specializations
|
||||
#if __IBMCPP__ <= 1010
|
||||
#define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS
|
||||
#endif
|
||||
|
||||
//
|
||||
// C++0x features
|
||||
//
|
||||
// See boost\config\suffix.hpp for BOOST_NO_LONG_LONG
|
||||
//
|
||||
#define BOOST_NO_AUTO_DECLARATIONS
|
||||
#define BOOST_NO_AUTO_MULTIDECLARATIONS
|
||||
#define BOOST_NO_CHAR16_T
|
||||
#define BOOST_NO_CHAR32_T
|
||||
#if ! __IBMCPP_AUTO_TYPEDEDUCTION
|
||||
# define BOOST_NO_AUTO_DECLARATIONS
|
||||
# define BOOST_NO_AUTO_MULTIDECLARATIONS
|
||||
#endif
|
||||
#if ! __IBMCPP_UTF_LITERAL__
|
||||
# define BOOST_NO_CHAR16_T
|
||||
# define BOOST_NO_CHAR32_T
|
||||
#endif
|
||||
#define BOOST_NO_CONCEPTS
|
||||
#define BOOST_NO_CONSTEXPR
|
||||
#define BOOST_NO_DECLTYPE
|
||||
#if ! __IBMCPP_DECLTYPE
|
||||
# define BOOST_NO_DECLTYPE
|
||||
#else
|
||||
# define BOOST_HAS_DECLTYPE
|
||||
#endif
|
||||
#define BOOST_NO_DEFAULTED_FUNCTIONS
|
||||
#define BOOST_NO_DELETED_FUNCTIONS
|
||||
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
|
||||
#define BOOST_NO_EXTERN_TEMPLATE
|
||||
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
|
||||
#if ! __IBMCPP_EXTERN_TEMPLATE
|
||||
# define BOOST_NO_EXTERN_TEMPLATE
|
||||
#endif
|
||||
#if ! __IBMCPP_VARIADIC_TEMPLATES
|
||||
// not enabled separately at this time
|
||||
# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
|
||||
#endif
|
||||
#define BOOST_NO_INITIALIZER_LISTS
|
||||
#define BOOST_NO_LAMBDAS
|
||||
#define BOOST_NO_NULLPTR
|
||||
#define BOOST_NO_RAW_LITERALS
|
||||
#define BOOST_NO_RVALUE_REFERENCES
|
||||
#define BOOST_NO_SCOPED_ENUMS
|
||||
#define BOOST_NO_SFINAE_EXPR
|
||||
#define BOOST_NO_STATIC_ASSERT
|
||||
#if ! __IBMCPP_STATIC_ASSERT
|
||||
# define BOOST_NO_STATIC_ASSERT
|
||||
#endif
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#if ! __IBMCPP_VARIADIC_TEMPLATES
|
||||
# define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#endif
|
||||
#if ! __C99_MACRO_WITH_VA_ARGS
|
||||
# define BOOST_NO_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -37,6 +37,9 @@
|
||||
//
|
||||
#endif
|
||||
|
||||
/// Visual Studio has no fenv.h
|
||||
#define BOOST_NO_FENV_H
|
||||
|
||||
#if (_MSC_VER <= 1300) // 1300 == VC++ 7.0
|
||||
|
||||
# if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za
|
||||
@ -81,6 +84,8 @@
|
||||
# define BOOST_NO_SWPRINTF
|
||||
// Our extern template tests also fail for this compiler:
|
||||
# define BOOST_NO_EXTERN_TEMPLATE
|
||||
// Variadic macros do not exist for VC7.1 and lower
|
||||
# define BOOST_NO_VARIADIC_MACROS
|
||||
#endif
|
||||
|
||||
#if defined(UNDER_CE)
|
||||
@ -92,10 +97,6 @@
|
||||
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
|
||||
#endif
|
||||
|
||||
#if _MSC_VER <= 1600 // 1600 == VC++ 10.0
|
||||
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
||||
#endif
|
||||
|
||||
#if _MSC_VER == 1500 // 1500 == VC++ 9.0
|
||||
// A bug in VC9:
|
||||
# define BOOST_NO_ADL_BARRIER
|
||||
@ -179,6 +180,7 @@
|
||||
#define BOOST_NO_STATIC_ASSERT
|
||||
#define BOOST_NO_NULLPTR
|
||||
#endif // _MSC_VER < 1600
|
||||
|
||||
#if _MSC_VER >= 1600
|
||||
#define BOOST_HAS_STDINT_H
|
||||
#endif
|
||||
@ -196,10 +198,11 @@
|
||||
#define BOOST_NO_INITIALIZER_LISTS
|
||||
#define BOOST_NO_RAW_LITERALS
|
||||
#define BOOST_NO_SCOPED_ENUMS
|
||||
#define BOOST_NO_SFINAE_EXPR
|
||||
#define BOOST_NO_TEMPLATE_ALIASES
|
||||
#define BOOST_NO_UNICODE_LITERALS
|
||||
#define BOOST_NO_VARIADIC_TEMPLATES
|
||||
#define BOOST_NO_SFINAE_EXPR
|
||||
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
|
||||
//
|
||||
// prefix and suffix headers:
|
||||
//
|
||||
|
@ -56,7 +56,7 @@
|
||||
#endif
|
||||
|
||||
#if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \
|
||||
|| (__NetBSD_GCC__ >= 2095003) || defined(__DragonFly__))
|
||||
|| (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__))
|
||||
# define BOOST_NO_CWCHAR
|
||||
#endif
|
||||
//
|
||||
|
@ -39,8 +39,18 @@
|
||||
#define BOOST_HAS_STDINT_H
|
||||
#endif
|
||||
|
||||
/// Cygwin has no fenv.h
|
||||
#define BOOST_NO_FENV_H
|
||||
|
||||
// boilerplate code:
|
||||
#include <boost/config/posix_features.hpp>
|
||||
|
||||
//
|
||||
// Cygwin lies about XSI conformance, there is no nl_types.h:
|
||||
//
|
||||
#ifdef BOOST_HAS_NL_TYPES_H
|
||||
# undef BOOST_HAS_NL_TYPES_H
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
@ -31,7 +31,6 @@
|
||||
# define BOOST_SYMBOL_IMPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
|
||||
# define BOOST_HAS_STDINT_H
|
||||
# define __STDC_LIMIT_MACROS
|
||||
@ -39,6 +38,11 @@
|
||||
# define BOOST_HAS_UNISTD_H
|
||||
#endif
|
||||
|
||||
#if defined(__MINGW32__) && (__GNUC__ >= 4)
|
||||
# define BOOST_HAS_EXPM1
|
||||
# define BOOST_HAS_LOG1P
|
||||
# define BOOST_HAS_GETTIMEOFDAY
|
||||
#endif
|
||||
//
|
||||
// Win32 will normally be using native Win32 threads,
|
||||
// but there is a pthread library avaliable as an option,
|
||||
|
@ -14,25 +14,27 @@
|
||||
// one identification macro for each of the
|
||||
// compilers we support:
|
||||
|
||||
# define BOOST_CXX_GCCXML 0
|
||||
# define BOOST_CXX_CLANG 0
|
||||
# define BOOST_CXX_COMO 0
|
||||
# define BOOST_CXX_DMC 0
|
||||
# define BOOST_CXX_INTEL 0
|
||||
# define BOOST_CXX_GNUC 0
|
||||
# define BOOST_CXX_KCC 0
|
||||
# define BOOST_CXX_SGI 0
|
||||
# define BOOST_CXX_TRU64 0
|
||||
# define BOOST_CXX_GHS 0
|
||||
# define BOOST_CXX_BORLAND 0
|
||||
# define BOOST_CXX_CW 0
|
||||
# define BOOST_CXX_SUNPRO 0
|
||||
# define BOOST_CXX_HPACC 0
|
||||
# define BOOST_CXX_MPW 0
|
||||
# define BOOST_CXX_IBMCPP 0
|
||||
# define BOOST_CXX_MSVC 0
|
||||
# define BOOST_CXX_PGI 0
|
||||
# define BOOST_CXX_NVCC 0
|
||||
# define BOOST_CXX_GCCXML 0
|
||||
# define BOOST_CXX_NVCC 0
|
||||
# define BOOST_CXX_COMO 0
|
||||
# define BOOST_CXX_PATHSCALE 0
|
||||
# define BOOST_CXX_CLANG 0
|
||||
# define BOOST_CXX_DMC 0
|
||||
# define BOOST_CXX_INTEL 0
|
||||
# define BOOST_CXX_GNUC 0
|
||||
# define BOOST_CXX_KCC 0
|
||||
# define BOOST_CXX_SGI 0
|
||||
# define BOOST_CXX_TRU64 0
|
||||
# define BOOST_CXX_GHS 0
|
||||
# define BOOST_CXX_BORLAND 0
|
||||
# define BOOST_CXX_CW 0
|
||||
# define BOOST_CXX_SUNPRO 0
|
||||
# define BOOST_CXX_HPACC 0
|
||||
# define BOOST_CXX_MPW 0
|
||||
# define BOOST_CXX_IBMCPP 0
|
||||
# define BOOST_CXX_MSVC 0
|
||||
# define BOOST_CXX_PGI 0
|
||||
# define BOOST_CXX_NVCC 0
|
||||
|
||||
|
||||
// locate which compiler we are using and define
|
||||
@ -50,6 +52,10 @@
|
||||
// Comeau C++
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
|
||||
|
||||
#elif defined(__PATHSCALE__) && (__PATHCC__ >= 4)
|
||||
// PathScale EKOPath compiler (has to come before clang and gcc)
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/pathscale.hpp"
|
||||
|
||||
#elif defined __clang__
|
||||
// Clang C++ emulates GCC, so it has to appear early.
|
||||
# define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp"
|
||||
|
@ -69,6 +69,9 @@
|
||||
// Symbian:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp"
|
||||
|
||||
#elif defined(__VMS)
|
||||
// VMS:
|
||||
# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp"
|
||||
#else
|
||||
|
||||
# if defined(unix) \
|
||||
|
@ -40,6 +40,10 @@
|
||||
// Rogue Wave library:
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp"
|
||||
|
||||
#elif defined(_LIBCPP_VERSION)
|
||||
// libc++
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcpp.hpp"
|
||||
|
||||
#elif defined(__GLIBCPP__) || defined(__GLIBCXX__)
|
||||
// GNU libstdc++ 3
|
||||
# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"
|
||||
|
@ -107,6 +107,7 @@
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_0X_HDR_TUPLE
|
||||
# define BOOST_NO_0X_HDR_TYPEINDEX
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
#endif
|
||||
|
||||
#if !defined(_HAS_TR1_IMPORTS) && !defined(BOOST_NO_0X_HDR_TUPLE)
|
||||
|
@ -58,6 +58,7 @@
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
//
|
||||
// Intrinsic type_traits support.
|
||||
|
@ -9,6 +9,8 @@
|
||||
// config for libstdc++ v3
|
||||
// not much to go in here:
|
||||
|
||||
#define BOOST_GNU_STDLIB 1
|
||||
|
||||
#ifdef __GLIBCXX__
|
||||
#define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__)
|
||||
#else
|
||||
@ -54,7 +56,6 @@
|
||||
# define BOOST_HAS_THREADS
|
||||
#endif
|
||||
|
||||
|
||||
#if !defined(_GLIBCPP_USE_LONG_LONG) \
|
||||
&& !defined(_GLIBCXX_USE_LONG_LONG)\
|
||||
&& defined(BOOST_HAS_LONG_LONG)
|
||||
@ -63,6 +64,16 @@
|
||||
# undef BOOST_HAS_LONG_LONG
|
||||
#endif
|
||||
|
||||
// Apple doesn't seem to reliably defined a *unix* macro
|
||||
#if !defined(CYGWIN) && ( defined(__unix__) \
|
||||
|| defined(__unix) \
|
||||
|| defined(unix) \
|
||||
|| defined(__APPLE__) \
|
||||
|| defined(__APPLE) \
|
||||
|| defined(APPLE))
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0
|
||||
# define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx
|
||||
# define BOOST_HAS_SLIST
|
||||
@ -115,6 +126,12 @@
|
||||
# define BOOST_NO_0X_HDR_THREAD
|
||||
#endif
|
||||
|
||||
// C++0x features in GCC 4.5.0 and later
|
||||
//
|
||||
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
#endif
|
||||
|
||||
// C++0x headers not yet implemented
|
||||
//
|
||||
# define BOOST_NO_0X_HDR_CODECVT
|
||||
|
@ -47,6 +47,7 @@
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
#define BOOST_STDLIB "Modena C++ standard library"
|
||||
|
||||
|
@ -71,6 +71,7 @@
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
#define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__)
|
||||
|
||||
|
@ -10,6 +10,8 @@
|
||||
|
||||
// Rogue Wave std lib:
|
||||
|
||||
#define BOOST_RW_STDLIB 1
|
||||
|
||||
#if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
# include <boost/config/no_tr1/utility.hpp>
|
||||
# if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER)
|
||||
@ -154,7 +156,10 @@
|
||||
|
||||
// C++0x headers not yet implemented
|
||||
//
|
||||
#if _RWSTD_VER < 0x05000000
|
||||
# define BOOST_NO_0X_HDR_ARRAY
|
||||
# define BOOST_NO_0X_HDR_TYPE_TRAITS
|
||||
#endif
|
||||
# define BOOST_NO_0X_HDR_CHRONO
|
||||
# define BOOST_NO_0X_HDR_CODECVT
|
||||
# define BOOST_NO_0X_HDR_CONCEPTS
|
||||
@ -172,9 +177,9 @@
|
||||
# define BOOST_NO_0X_HDR_SYSTEM_ERROR
|
||||
# define BOOST_NO_0X_HDR_THREAD
|
||||
# define BOOST_NO_0X_HDR_TUPLE
|
||||
# define BOOST_NO_0X_HDR_TYPE_TRAITS
|
||||
# define BOOST_NO_0X_HDR_TYPEINDEX
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
|
@ -40,6 +40,17 @@
|
||||
# define BOOST_NO_STRINGSTREAM
|
||||
#endif
|
||||
|
||||
// Apple doesn't seem to reliably defined a *unix* macro
|
||||
#if !defined(CYGWIN) && ( defined(__unix__) \
|
||||
|| defined(__unix) \
|
||||
|| defined(unix) \
|
||||
|| defined(__APPLE__) \
|
||||
|| defined(__APPLE) \
|
||||
|| defined(APPLE))
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
|
||||
//
|
||||
// Assume no std::locale without own iostreams (this may be an
|
||||
// incorrect assumption in some cases):
|
||||
@ -130,6 +141,7 @@
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
#define BOOST_STDLIB "SGI standard library"
|
||||
|
||||
|
@ -16,6 +16,16 @@
|
||||
# endif
|
||||
#endif
|
||||
|
||||
// Apple doesn't seem to reliably defined a *unix* macro
|
||||
#if !defined(CYGWIN) && ( defined(__unix__) \
|
||||
|| defined(__unix) \
|
||||
|| defined(unix) \
|
||||
|| defined(__APPLE__) \
|
||||
|| defined(__APPLE) \
|
||||
|| defined(APPLE))
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
//
|
||||
// __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
|
||||
// for versions prior to 4.1(beta)
|
||||
@ -225,6 +235,7 @@ namespace boost { using std::min; using std::max; }
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
#define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT)
|
||||
|
||||
|
@ -12,6 +12,16 @@
|
||||
#define BOOST_HAS_MACRO_USE_FACET
|
||||
#define BOOST_NO_STD_MESSAGES
|
||||
|
||||
// Apple doesn't seem to reliably defined a *unix* macro
|
||||
#if !defined(CYGWIN) && ( defined(__unix__) \
|
||||
|| defined(__unix) \
|
||||
|| defined(unix) \
|
||||
|| defined(__APPLE__) \
|
||||
|| defined(__APPLE) \
|
||||
|| defined(APPLE))
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
// C++0x headers not yet implemented
|
||||
//
|
||||
# define BOOST_NO_0X_HDR_ARRAY
|
||||
@ -37,6 +47,7 @@
|
||||
# define BOOST_NO_STD_UNORDERED // deprecated; see following
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_MAP
|
||||
# define BOOST_NO_0X_HDR_UNORDERED_SET
|
||||
# define BOOST_NO_NUMERIC_LIMITS_LOWEST
|
||||
|
||||
#define BOOST_STDLIB "Visual Age default standard library"
|
||||
|
||||
|
@ -25,6 +25,14 @@
|
||||
#ifndef BOOST_CONFIG_SUFFIX_HPP
|
||||
#define BOOST_CONFIG_SUFFIX_HPP
|
||||
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
//
|
||||
// Some GCC-4.x versions issue warnings even when __extension__ is used,
|
||||
// so use this as a workaround:
|
||||
//
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
//
|
||||
// ensure that visibility macros are always defined, thus symplifying use
|
||||
//
|
||||
@ -341,6 +349,13 @@
|
||||
#define BOOST_HAS_RVALUE_REFS
|
||||
#endif
|
||||
|
||||
//
|
||||
// Set BOOST_HAS_VARIADIC_TMPL when BOOST_NO_VARIADIC_TEMPLATES is not defined
|
||||
//
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_HAS_VARIADIC_TMPL)
|
||||
#define BOOST_HAS_VARIADIC_TMPL
|
||||
#endif
|
||||
|
||||
// BOOST_HAS_ABI_HEADERS
|
||||
// This macro gets set if we have headers that fix the ABI,
|
||||
// and prevent ODR violations when linking to external libraries:
|
||||
@ -585,7 +600,7 @@ namespace boost{
|
||||
// the global definition into std namespace:
|
||||
#ifdef BOOST_NO_STD_TYPEINFO
|
||||
#include <typeinfo>
|
||||
namespace std{ using ::typeinfo; }
|
||||
namespace std{ using ::type_info; }
|
||||
#endif
|
||||
|
||||
// ---------------------------------------------------------------------------//
|
||||
@ -635,5 +650,19 @@ namespace std{ using ::typeinfo; }
|
||||
# ifndef BOOST_GPU_ENABLED
|
||||
# define BOOST_GPU_ENABLED
|
||||
# endif
|
||||
|
||||
//
|
||||
// constexpr workarounds
|
||||
//
|
||||
#if defined(BOOST_NO_CONSTEXPR)
|
||||
#define BOOST_CONSTEXPR
|
||||
#define BOOST_CONSTEXPR_OR_CONST const
|
||||
#else
|
||||
#define BOOST_CONSTEXPR constexpr
|
||||
#define BOOST_CONSTEXPR_OR_CONST constexpr
|
||||
#endif
|
||||
|
||||
#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -137,7 +137,7 @@ namespace boost
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__)
|
||||
#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS)
|
||||
// FreeBSD and Tru64 have an <inttypes.h> that contains much of what we need.
|
||||
# include <inttypes.h>
|
||||
|
||||
@ -256,20 +256,27 @@ namespace boost
|
||||
|
||||
// 32-bit types -----------------------------------------------------------//
|
||||
|
||||
# if ULONG_MAX == 0xffffffff
|
||||
typedef long int32_t;
|
||||
typedef long int_least32_t;
|
||||
typedef long int_fast32_t;
|
||||
typedef unsigned long uint32_t;
|
||||
typedef unsigned long uint_least32_t;
|
||||
typedef unsigned long uint_fast32_t;
|
||||
# elif UINT_MAX == 0xffffffff
|
||||
# if UINT_MAX == 0xffffffff
|
||||
typedef int int32_t;
|
||||
typedef int int_least32_t;
|
||||
typedef int int_fast32_t;
|
||||
typedef unsigned int uint32_t;
|
||||
typedef unsigned int uint_least32_t;
|
||||
typedef unsigned int uint_fast32_t;
|
||||
# elif (USHRT_MAX == 0xffffffff)
|
||||
typedef short int32_t;
|
||||
typedef short int_least32_t;
|
||||
typedef short int_fast32_t;
|
||||
typedef unsigned short uint32_t;
|
||||
typedef unsigned short uint_least32_t;
|
||||
typedef unsigned short uint_fast32_t;
|
||||
# elif ULONG_MAX == 0xffffffff
|
||||
typedef long int32_t;
|
||||
typedef long int_least32_t;
|
||||
typedef long int_fast32_t;
|
||||
typedef unsigned long uint32_t;
|
||||
typedef unsigned long uint_least32_t;
|
||||
typedef unsigned long uint_fast32_t;
|
||||
# elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__)
|
||||
// Integers are 64 bits on the MTA / XMT
|
||||
typedef __int32 int32_t;
|
||||
|
@ -68,7 +68,11 @@ namespace std
|
||||
template <class charT> struct char_traits;
|
||||
#endif
|
||||
|
||||
template <class T> class complex;
|
||||
#if BOOST_CLANG
|
||||
template <class T> struct complex;
|
||||
#else
|
||||
template <class T> class complex;
|
||||
#endif
|
||||
}
|
||||
|
||||
// gcc 3.4 and greater
|
||||
|
@ -44,11 +44,13 @@
|
||||
# endif
|
||||
# define BOOST_BYTE_ORDER __BYTE_ORDER
|
||||
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \
|
||||
defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
|
||||
defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \
|
||||
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(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \
|
||||
defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN)
|
||||
# define BOOST_LITTLE_ENDIAN
|
||||
# define BOOST_BYTE_ORDER 1234
|
||||
#elif defined(__sparc) || defined(__sparc__) \
|
||||
|
@ -70,10 +70,10 @@ namespace is_incrementable_
|
||||
# endif
|
||||
|
||||
// two check overloads help us identify which operator++ was picked
|
||||
char (& check(tag) )[2];
|
||||
char (& check_(tag) )[2];
|
||||
|
||||
template <class T>
|
||||
char check(T const&);
|
||||
char check_(T const&);
|
||||
|
||||
|
||||
template <class T>
|
||||
@ -83,7 +83,7 @@ namespace is_incrementable_
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool
|
||||
, value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1
|
||||
, value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1
|
||||
);
|
||||
};
|
||||
|
||||
@ -94,7 +94,7 @@ namespace is_incrementable_
|
||||
|
||||
BOOST_STATIC_CONSTANT(
|
||||
bool
|
||||
, value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1
|
||||
, value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
//
|
||||
|
||||
#include <boost/current_function.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <iostream>
|
||||
|
||||
namespace boost
|
||||
@ -32,9 +33,26 @@ namespace boost
|
||||
namespace detail
|
||||
{
|
||||
|
||||
struct report_errors_reminder
|
||||
{
|
||||
bool called_report_errors_function;
|
||||
report_errors_reminder() : called_report_errors_function(false) {}
|
||||
~report_errors_reminder()
|
||||
{
|
||||
BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called
|
||||
}
|
||||
};
|
||||
|
||||
inline report_errors_reminder& report_errors_remind()
|
||||
{
|
||||
static report_errors_reminder r;
|
||||
return r;
|
||||
}
|
||||
|
||||
inline int & test_errors()
|
||||
{
|
||||
static int x = 0;
|
||||
report_errors_remind();
|
||||
return x;
|
||||
}
|
||||
|
||||
@ -68,6 +86,8 @@ template<class T, class U> inline void test_eq_impl( char const * expr1, char co
|
||||
|
||||
inline int report_errors()
|
||||
{
|
||||
detail::report_errors_remind().called_report_errors_function = true;
|
||||
|
||||
int errors = detail::test_errors();
|
||||
|
||||
if( errors == 0 )
|
||||
|
@ -74,7 +74,13 @@ template<class T> struct sp_typeid_
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__SUNPRO_CC)
|
||||
// see #4199, the Sun Studio compiler gets confused about static initialization
|
||||
// constructor arguments. But an assignment works just fine.
|
||||
template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
|
||||
#else
|
||||
template<class T> sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name());
|
||||
#endif
|
||||
|
||||
template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
|
||||
{
|
||||
|
@ -137,7 +137,7 @@ boost
|
||||
}
|
||||
#ifndef BOOST_NO_RTTI
|
||||
tmp << std::string("Dynamic exception type: ") <<
|
||||
units::detail::demangle((be?BOOST_EXCEPTION_DYNAMIC_TYPEID(*be):BOOST_EXCEPTION_DYNAMIC_TYPEID(*se)).type_.name()) << '\n';
|
||||
units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_.name()) << '\n';
|
||||
#endif
|
||||
if( with_what && se )
|
||||
tmp << "std::exception::what: " << wh << '\n';
|
||||
|
@ -53,7 +53,7 @@ namespace boost
|
||||
|
||||
v = ldexp(v, limits<std::size_t>::digits);
|
||||
std::size_t seed = static_cast<std::size_t>(v);
|
||||
v -= seed;
|
||||
v -= static_cast<T>(seed);
|
||||
|
||||
// ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;
|
||||
std::size_t const length
|
||||
@ -66,7 +66,7 @@ namespace boost
|
||||
{
|
||||
v = ldexp(v, limits<std::size_t>::digits);
|
||||
std::size_t part = static_cast<std::size_t>(v);
|
||||
v -= part;
|
||||
v -= static_cast<T>(part);
|
||||
hash_float_combine(seed, part);
|
||||
}
|
||||
|
||||
|
@ -24,6 +24,10 @@
|
||||
#include <boost/type_traits/is_pointer.hpp>
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_0X_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
|
||||
@ -87,6 +91,10 @@ namespace boost
|
||||
std::size_t hash_value(
|
||||
std::basic_string<Ch, std::BOOST_HASH_CHAR_TRAITS<Ch>, A> const&);
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
|
||||
std::size_t hash_value(std::type_index);
|
||||
#endif
|
||||
|
||||
// Implementation
|
||||
|
||||
namespace hash_detail
|
||||
@ -209,9 +217,15 @@ namespace boost
|
||||
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);
|
||||
}
|
||||
|
||||
@ -325,6 +339,13 @@ namespace boost
|
||||
return boost::hash_detail::float_hash_value(v);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
|
||||
inline std::size_t hash_value(std::type_index v)
|
||||
{
|
||||
return v.hash_code();
|
||||
}
|
||||
#endif
|
||||
|
||||
//
|
||||
// boost::hash
|
||||
//
|
||||
@ -429,6 +450,10 @@ namespace boost
|
||||
BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_0X_HDR_TYPEINDEX)
|
||||
BOOST_HASH_SPECIALIZE(std::type_index)
|
||||
#endif
|
||||
|
||||
#undef BOOST_HASH_SPECIALIZE
|
||||
#undef BOOST_HASH_SPECIALIZE_REF
|
||||
|
||||
|
@ -20,6 +20,17 @@
|
||||
|
||||
#include <boost/limits.hpp> // for std::numeric_limits
|
||||
|
||||
//
|
||||
// We simply cannot include this header on gcc without getting copious warnings of the kind:
|
||||
//
|
||||
// boost/integer/integer_mask.hpp:93:35: warning: use of C99 long long integer constant
|
||||
//
|
||||
// And yet there is no other reasonable implementation, so we declare this a system header
|
||||
// to suppress these warnings.
|
||||
//
|
||||
#if defined(__GNUC__) && (__GNUC__ >= 4)
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
@ -89,6 +100,19 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int );
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long );
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_HAS_LONG_LONG)
|
||||
#if ((defined(ULLONG_MAX) && (ULLONG_MAX > ULONG_MAX)) ||\
|
||||
(defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX > ULONG_MAX)) ||\
|
||||
(defined(ULONGLONG_MAX) && (ULONGLONG_MAX > ULONG_MAX)) ||\
|
||||
(defined(_ULLONG_MAX) && (_ULLONG_MAX > ULONG_MAX)))
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( boost::ulong_long_type );
|
||||
#endif
|
||||
#elif defined(BOOST_HAS_MS_INT64)
|
||||
#if 18446744073709551615ui64 > ULONG_MAX
|
||||
BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 );
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
|
@ -136,22 +136,6 @@ template < std::size_t Bits >
|
||||
template < >
|
||||
struct low_bits_mask_t< ::std::numeric_limits<unsigned char>::digits >;
|
||||
|
||||
#if USHRT_MAX > UCHAR_MAX
|
||||
template < >
|
||||
struct low_bits_mask_t< ::std::numeric_limits<unsigned short>::digits >;
|
||||
#endif
|
||||
|
||||
#if UINT_MAX > USHRT_MAX
|
||||
template < >
|
||||
struct low_bits_mask_t< ::std::numeric_limits<unsigned int>::digits >;
|
||||
#endif
|
||||
|
||||
#if ULONG_MAX > UINT_MAX
|
||||
template < >
|
||||
struct low_bits_mask_t< ::std::numeric_limits<unsigned long>::digits >;
|
||||
#endif
|
||||
|
||||
|
||||
// From <boost/integer/static_log2.hpp> ------------------------------------//
|
||||
|
||||
template <static_log2_argument_type Value >
|
||||
|
@ -105,6 +105,7 @@ namespace boost
|
||||
|
||||
typedef typename remove_const<ValueParam>::type value_type;
|
||||
|
||||
// Not the real associated pointer type
|
||||
typedef typename mpl::eval_if<
|
||||
boost::detail::iterator_writability_disabled<ValueParam,Reference>
|
||||
, add_pointer<const value_type>
|
||||
@ -323,7 +324,7 @@ namespace boost
|
||||
|
||||
static type make(Reference x)
|
||||
{
|
||||
return implicit_cast<type>(&x);
|
||||
return boost::implicit_cast<type>(&x);
|
||||
}
|
||||
};
|
||||
|
||||
@ -617,6 +618,12 @@ namespace boost
|
||||
Value, CategoryOrTraversal, Reference, Difference
|
||||
> associated_types;
|
||||
|
||||
typedef boost::detail::operator_arrow_result<
|
||||
typename associated_types::value_type
|
||||
, Reference
|
||||
, typename associated_types::pointer
|
||||
> pointer_;
|
||||
|
||||
protected:
|
||||
// For use by derived classes
|
||||
typedef iterator_facade<Derived,Value,CategoryOrTraversal,Reference,Difference> iterator_facade_;
|
||||
@ -626,7 +633,9 @@ namespace boost
|
||||
typedef typename associated_types::value_type value_type;
|
||||
typedef Reference reference;
|
||||
typedef Difference difference_type;
|
||||
typedef typename associated_types::pointer pointer;
|
||||
|
||||
typedef typename pointer_::type pointer;
|
||||
|
||||
typedef typename associated_types::iterator_category iterator_category;
|
||||
|
||||
reference operator*() const
|
||||
@ -634,18 +643,9 @@ namespace boost
|
||||
return iterator_core_access::dereference(this->derived());
|
||||
}
|
||||
|
||||
typename boost::detail::operator_arrow_result<
|
||||
value_type
|
||||
, reference
|
||||
, pointer
|
||||
>::type
|
||||
operator->() const
|
||||
pointer operator->() const
|
||||
{
|
||||
return boost::detail::operator_arrow_result<
|
||||
value_type
|
||||
, reference
|
||||
, pointer
|
||||
>::make(*this->derived());
|
||||
return pointer_::make(*this->derived());
|
||||
}
|
||||
|
||||
typename boost::detail::operator_brackets_result<Derived,Value,reference>::type
|
||||
|
@ -1,4 +1,4 @@
|
||||
// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
|
||||
// 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
|
||||
@ -9,27 +9,34 @@
|
||||
// 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 <new>
|
||||
#include <algorithm>
|
||||
|
||||
#include "boost/config.hpp"
|
||||
#include "boost/assert.hpp"
|
||||
#include "boost/type.hpp"
|
||||
#include "boost/type_traits/alignment_of.hpp"
|
||||
#include "boost/type_traits/type_with_alignment.hpp"
|
||||
#include "boost/type_traits/remove_reference.hpp"
|
||||
#include "boost/type_traits/is_reference.hpp"
|
||||
#include "boost/mpl/if.hpp"
|
||||
#include "boost/mpl/bool.hpp"
|
||||
#include "boost/mpl/not.hpp"
|
||||
#include "boost/detail/reference_content.hpp"
|
||||
#include "boost/none.hpp"
|
||||
#include "boost/utility/compare_pointees.hpp"
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include <boost/type.hpp>
|
||||
#include <boost/type_traits/alignment_of.hpp>
|
||||
#include <boost/type_traits/has_nothrow_constructor.hpp>
|
||||
#include <boost/type_traits/type_with_alignment.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/not.hpp>
|
||||
#include <boost/detail/reference_content.hpp>
|
||||
#include <boost/none.hpp>
|
||||
#include <boost/utility/swap.hpp>
|
||||
#include <boost/utility/addressof.hpp>
|
||||
#include <boost/utility/compare_pointees.hpp>
|
||||
#include <boost/utility/in_place_factory.hpp>
|
||||
|
||||
#include "boost/optional/optional_fwd.hpp"
|
||||
#include <boost/optional/optional_fwd.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1200)
|
||||
// VC6.0 has the following bug:
|
||||
@ -76,6 +83,15 @@
|
||||
#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
|
||||
@ -83,7 +99,7 @@
|
||||
namespace boost_optional_detail
|
||||
{
|
||||
template <class T, class Factory>
|
||||
void construct(Factory const& factory, void* address)
|
||||
inline void construct(Factory const& factory, void* address)
|
||||
{
|
||||
factory.BOOST_NESTED_TEMPLATE apply<T>(address);
|
||||
}
|
||||
@ -95,6 +111,9 @@ namespace boost {
|
||||
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"
|
||||
@ -105,7 +124,12 @@ template <class T>
|
||||
class aligned_storage
|
||||
{
|
||||
// Borland ICEs if unnamed unions are used for this!
|
||||
union dummy_u
|
||||
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<
|
||||
@ -114,8 +138,13 @@ class aligned_storage
|
||||
|
||||
public:
|
||||
|
||||
void const* address() const { return &dummy_.data[0]; }
|
||||
void * address() { return &dummy_.data[0]; }
|
||||
#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>
|
||||
@ -149,7 +178,7 @@ class optional_base : public optional_tag
|
||||
typedef
|
||||
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
|
||||
BOOST_DEDUCED_TYPENAME
|
||||
#endif
|
||||
#endif
|
||||
::boost::detail::make_reference_content<T>::type internal_type ;
|
||||
|
||||
typedef aligned_storage<internal_type> storage_type ;
|
||||
@ -200,7 +229,7 @@ class optional_base : public optional_tag
|
||||
{
|
||||
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 )
|
||||
@ -421,8 +450,22 @@ class optional_base : public optional_tag
|
||||
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 ; }
|
||||
@ -513,12 +556,12 @@ class optional : public optional_detail::optional_base<T>
|
||||
// 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,&expr) {}
|
||||
explicit optional ( Expr const& expr ) : base(expr,boost::addressof(expr)) {}
|
||||
#endif
|
||||
|
||||
// Creates a deep copy of another optional<T>
|
||||
// Can throw if T::T(T const&) does
|
||||
optional ( optional const& rhs ) : base(rhs) {}
|
||||
optional ( optional const& rhs ) : base( static_cast<base const&>(rhs) ) {}
|
||||
|
||||
// No-throw (assuming T::~T() doesn't)
|
||||
~optional() {}
|
||||
@ -527,9 +570,9 @@ class optional : public optional_detail::optional_base<T>
|
||||
// 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 expr )
|
||||
optional& operator= ( Expr const& expr )
|
||||
{
|
||||
this->assign_expr(expr,&expr);
|
||||
this->assign_expr(expr,boost::addressof(expr));
|
||||
return *this ;
|
||||
}
|
||||
#endif
|
||||
@ -552,7 +595,7 @@ class optional : public optional_detail::optional_base<T>
|
||||
// (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( rhs ) ;
|
||||
this->assign( static_cast<base const&>(rhs) ) ;
|
||||
return *this ;
|
||||
}
|
||||
|
||||
@ -573,6 +616,14 @@ class optional : public optional_detail::optional_base<T>
|
||||
return *this ;
|
||||
}
|
||||
|
||||
void swap( optional & arg )
|
||||
{
|
||||
// allow for Koenig lookup
|
||||
using boost::swap;
|
||||
swap(*this, arg);
|
||||
}
|
||||
|
||||
|
||||
// Returns a reference to the value if this is initialized, otherwise,
|
||||
// the behaviour is UNDEFINED
|
||||
// No-throw
|
||||
@ -582,7 +633,7 @@ class optional : public optional_detail::optional_base<T>
|
||||
// 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
|
||||
@ -599,22 +650,22 @@ class optional : public optional_detail::optional_base<T>
|
||||
// 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() ; }
|
||||
// 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
|
||||
template<class T>
|
||||
inline
|
||||
optional<T> make_optional ( T const& v )
|
||||
{
|
||||
return optional<T>(v);
|
||||
}
|
||||
|
||||
// Returns optional<T>(cond,v)
|
||||
template<class T>
|
||||
inline
|
||||
template<class T>
|
||||
inline
|
||||
optional<T> make_optional ( bool cond, T const& v )
|
||||
{
|
||||
return optional<T>(cond,v);
|
||||
@ -867,58 +918,74 @@ inline
|
||||
bool operator >= ( none_t x, optional<T> const& y )
|
||||
{ return !( x < y ) ; }
|
||||
|
||||
//
|
||||
// The following swap implementation follows the GCC workaround as found in
|
||||
// "boost/detail/compressed_pair.hpp"
|
||||
//
|
||||
namespace optional_detail {
|
||||
|
||||
// GCC < 3.2 gets the using declaration at namespace scope (FLC, DWA)
|
||||
#if BOOST_WORKAROUND(__GNUC__, < 3) \
|
||||
|| BOOST_WORKAROUND(__GNUC__, == 3) && __GNUC_MINOR__ <= 2
|
||||
using std::swap;
|
||||
#define BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
|
||||
#endif
|
||||
template<bool use_default_constructor> struct swap_selector;
|
||||
|
||||
// optional's swap:
|
||||
// If both are initialized, calls swap(T&, T&). If this swap throws, both will remain initialized but their values are now unspecified.
|
||||
// If only one is initialized, calls U.reset(*I), THEN I.reset().
|
||||
// If U.reset(*I) throws, both are left UNCHANGED (U is kept uinitialized and I is never reset)
|
||||
// If both are uninitialized, do nothing (no-throw)
|
||||
template<class T>
|
||||
inline
|
||||
void optional_swap ( optional<T>& x, optional<T>& y )
|
||||
template<>
|
||||
struct swap_selector<true>
|
||||
{
|
||||
if ( !x && !!y )
|
||||
{
|
||||
x.reset(*y);
|
||||
y.reset();
|
||||
}
|
||||
else if ( !!x && !y )
|
||||
{
|
||||
y.reset(*x);
|
||||
x.reset();
|
||||
}
|
||||
else if ( !!x && !!y )
|
||||
{
|
||||
// GCC > 3.2 and all other compilers have the using declaration at function scope (FLC)
|
||||
#ifndef BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE
|
||||
// allow for Koenig lookup
|
||||
using std::swap ;
|
||||
#endif
|
||||
swap(*x,*y);
|
||||
}
|
||||
}
|
||||
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 = boost::in_place();
|
||||
else if ( !hasY )
|
||||
y = boost::in_place();
|
||||
|
||||
// Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
|
||||
boost::swap(x.get(),y.get());
|
||||
|
||||
if( !hasX )
|
||||
y = boost::none ;
|
||||
else if( !hasY )
|
||||
x = boost::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 = boost::none ;
|
||||
}
|
||||
else if ( hasX && !hasY )
|
||||
{
|
||||
y = x.get();
|
||||
x = boost::none ;
|
||||
}
|
||||
else if ( hasX && hasY )
|
||||
{
|
||||
// Boost.Utility.Swap will take care of ADL and workarounds for broken compilers
|
||||
boost::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::optional_swap(x,y);
|
||||
optional_detail::swap_selector<optional_swap_should_use_default_constructor<T>::value>::optional_swap(x, y);
|
||||
}
|
||||
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -13,19 +13,20 @@
|
||||
#define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP
|
||||
|
||||
#if defined __GNUC__
|
||||
# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
|
||||
# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97)
|
||||
# define BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
|
||||
# endif
|
||||
#endif // __GNUC__
|
||||
|
||||
#if defined BOOST_OPTIONAL_NO_TEMPLATED_STREAMS
|
||||
# include <iostream>
|
||||
#else
|
||||
#else
|
||||
# include <istream>
|
||||
# include <ostream>
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
#include <boost/none.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
#include "boost/optional/optional.hpp"
|
||||
#include "boost/utility/value_init.hpp"
|
||||
|
||||
@ -62,17 +63,30 @@ std::basic_istream<CharType, CharTrait>&
|
||||
operator>>(std::basic_istream<CharType, CharTrait>& in, optional<T>& v)
|
||||
#endif
|
||||
{
|
||||
if ( in.good() )
|
||||
if (in.good())
|
||||
{
|
||||
int d = in.get();
|
||||
if ( d == ' ' )
|
||||
if (d == ' ')
|
||||
{
|
||||
T x ;
|
||||
T x;
|
||||
in >> x;
|
||||
v = x ;
|
||||
v = x;
|
||||
}
|
||||
else
|
||||
v = optional<T>() ;
|
||||
{
|
||||
if (d == '-')
|
||||
{
|
||||
d = in.get();
|
||||
|
||||
if (d == '-')
|
||||
{
|
||||
v = none;
|
||||
return in;
|
||||
}
|
||||
}
|
||||
|
||||
in.setstate( std::ios::failbit );
|
||||
}
|
||||
}
|
||||
|
||||
return in;
|
||||
|
@ -412,7 +412,7 @@ struct BaseRegexConcept
|
||||
|
||||
// access:
|
||||
const Regex ce;
|
||||
unsigned i = ce.mark_count();
|
||||
typename Regex::size_type i = ce.mark_count();
|
||||
ignore_unused_variable_warning(i);
|
||||
m_flags = ce.flags();
|
||||
e.imbue(ce.getloc());
|
||||
|
@ -255,6 +255,10 @@
|
||||
# define BOOST_REGEX_USE_CPP_LOCALE
|
||||
#endif
|
||||
|
||||
#if defined(__CYGWIN__)
|
||||
# define BOOST_REGEX_USE_C_LOCALE
|
||||
#endif
|
||||
|
||||
/* Win32 defaults to native Win32 locale: */
|
||||
#if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32)
|
||||
# define BOOST_REGEX_USE_WIN32_LOCALE
|
||||
|
@ -41,10 +41,10 @@ public:
|
||||
typedef std::map<Key, list_iterator> map_type;
|
||||
typedef typename map_type::iterator map_iterator;
|
||||
typedef typename list_type::size_type size_type;
|
||||
static boost::shared_ptr<Object const> get(const Key& k, size_type max_cache_size);
|
||||
static boost::shared_ptr<Object const> get(const Key& k, size_type l_max_cache_size);
|
||||
|
||||
private:
|
||||
static boost::shared_ptr<Object const> do_get(const Key& k, size_type max_cache_size);
|
||||
static boost::shared_ptr<Object const> do_get(const Key& k, size_type l_max_cache_size);
|
||||
|
||||
struct data
|
||||
{
|
||||
@ -58,7 +58,7 @@ private:
|
||||
};
|
||||
|
||||
template <class Key, class Object>
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type max_cache_size)
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, size_type l_max_cache_size)
|
||||
{
|
||||
#ifdef BOOST_HAS_THREADS
|
||||
static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT;
|
||||
@ -66,7 +66,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz
|
||||
boost::static_mutex::scoped_lock l(mut);
|
||||
if(l)
|
||||
{
|
||||
return do_get(k, max_cache_size);
|
||||
return do_get(k, l_max_cache_size);
|
||||
}
|
||||
//
|
||||
// what do we do if the lock fails?
|
||||
@ -77,12 +77,12 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz
|
||||
return boost::shared_ptr<Object>();
|
||||
#endif
|
||||
#else
|
||||
return do_get(k, max_cache_size);
|
||||
return do_get(k, l_max_cache_size);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class Key, class Object>
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type max_cache_size)
|
||||
boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k, size_type l_max_cache_size)
|
||||
{
|
||||
typedef typename object_cache<Key, Object>::data object_data;
|
||||
typedef typename map_type::size_type map_size_type;
|
||||
@ -128,7 +128,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k,
|
||||
BOOST_ASSERT(s_data.index[k]->first.get() == result.get());
|
||||
BOOST_ASSERT(&(s_data.index.find(k)->first) == s_data.cont.back().second);
|
||||
BOOST_ASSERT(s_data.index.find(k)->first == k);
|
||||
if(s > max_cache_size)
|
||||
if(s > l_max_cache_size)
|
||||
{
|
||||
//
|
||||
// We have too many items in the list, so we need to start
|
||||
@ -137,7 +137,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::do_get(const Key& k,
|
||||
//
|
||||
list_iterator pos = s_data.cont.begin();
|
||||
list_iterator last = s_data.cont.end();
|
||||
while((pos != last) && (s > max_cache_size))
|
||||
while((pos != last) && (s > l_max_cache_size))
|
||||
{
|
||||
if(pos->first.unique())
|
||||
{
|
||||
|
@ -96,8 +96,14 @@ class BOOST_REGEX_DECL scoped_static_mutex_lock
|
||||
public:
|
||||
scoped_static_mutex_lock(static_mutex& mut, bool lk = true);
|
||||
~scoped_static_mutex_lock();
|
||||
operator void const*()const;
|
||||
bool locked()const;
|
||||
operator void const*()const
|
||||
{
|
||||
return locked() ? this : 0;
|
||||
}
|
||||
bool locked()const
|
||||
{
|
||||
return m_have_lock;
|
||||
}
|
||||
void lock();
|
||||
void unlock();
|
||||
private:
|
||||
@ -107,16 +113,6 @@ private:
|
||||
scoped_static_mutex_lock& operator=(const scoped_static_mutex_lock&);
|
||||
};
|
||||
|
||||
inline scoped_static_mutex_lock::operator void const*()const
|
||||
{
|
||||
return locked() ? this : 0;
|
||||
}
|
||||
|
||||
inline bool scoped_static_mutex_lock::locked()const
|
||||
{
|
||||
return m_have_lock;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
#else
|
||||
|
@ -53,7 +53,7 @@ void bubble_down_one(I first, I last)
|
||||
if(first != last)
|
||||
{
|
||||
I next = last - 1;
|
||||
while((next != first) && !(*(next-1) < *next))
|
||||
while((next != first) && (*next < *(next-1)))
|
||||
{
|
||||
(next-1)->swap(*next);
|
||||
--next;
|
||||
@ -61,70 +61,59 @@ void bubble_down_one(I first, I last)
|
||||
}
|
||||
}
|
||||
|
||||
//
|
||||
// Class named_subexpressions
|
||||
// Contains information about named subexpressions within the regex.
|
||||
//
|
||||
template <class charT>
|
||||
class named_subexpressions_base
|
||||
{
|
||||
public:
|
||||
virtual int get_id(const charT* i, const charT* j)const = 0;
|
||||
virtual int get_id(std::size_t hash)const = 0;
|
||||
#ifdef __GNUC__
|
||||
// warning supression:
|
||||
virtual ~named_subexpressions_base(){}
|
||||
#endif
|
||||
};
|
||||
|
||||
template <class Iterator>
|
||||
inline std::size_t hash_value_from_capture_name(Iterator i, Iterator j)
|
||||
inline int hash_value_from_capture_name(Iterator i, Iterator j)
|
||||
{
|
||||
std::size_t r = boost::hash_range(i, j);
|
||||
r %= ((std::numeric_limits<int>::max)() - 10001);
|
||||
r += 10000;
|
||||
return r;
|
||||
return static_cast<int>(r);
|
||||
}
|
||||
|
||||
template <class charT>
|
||||
class named_subexpressions : public named_subexpressions_base<charT>
|
||||
class named_subexpressions
|
||||
{
|
||||
public:
|
||||
struct name
|
||||
{
|
||||
template <class charT>
|
||||
name(const charT* i, const charT* j, int idx)
|
||||
: /*n(i, j), */ index(idx)
|
||||
: index(idx)
|
||||
{
|
||||
hash = hash_value_from_capture_name(i, j);
|
||||
}
|
||||
name(std::size_t h, int idx)
|
||||
name(int h, int idx)
|
||||
: index(idx), hash(h)
|
||||
{
|
||||
}
|
||||
//std::vector<charT> n;
|
||||
int index;
|
||||
std::size_t hash;
|
||||
int hash;
|
||||
bool operator < (const name& other)const
|
||||
{
|
||||
return hash < other.hash; //std::lexicographical_compare(n.begin(), n.end(), other.n.begin(), other.n.end());
|
||||
return hash < other.hash;
|
||||
}
|
||||
bool operator == (const name& other)const
|
||||
{
|
||||
return hash == other.hash; //n == other.n;
|
||||
return hash == other.hash;
|
||||
}
|
||||
void swap(name& other)
|
||||
{
|
||||
//n.swap(other.n);
|
||||
std::swap(index, other.index);
|
||||
std::swap(hash, other.hash);
|
||||
}
|
||||
};
|
||||
public:
|
||||
|
||||
typedef std::vector<name>::const_iterator const_iterator;
|
||||
typedef std::pair<const_iterator, const_iterator> range_type;
|
||||
|
||||
named_subexpressions(){}
|
||||
|
||||
template <class charT>
|
||||
void set_name(const charT* i, const charT* j, int index)
|
||||
{
|
||||
m_sub_names.push_back(name(i, j, index));
|
||||
bubble_down_one(m_sub_names.begin(), m_sub_names.end());
|
||||
}
|
||||
template <class charT>
|
||||
int get_id(const charT* i, const charT* j)const
|
||||
{
|
||||
name t(i, j, 0);
|
||||
@ -135,72 +124,37 @@ public:
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
int get_id(std::size_t h)const
|
||||
template <class charT>
|
||||
range_type equal_range(const charT* i, const charT* j)const
|
||||
{
|
||||
name t(i, j, 0);
|
||||
return std::equal_range(m_sub_names.begin(), m_sub_names.end(), t);
|
||||
}
|
||||
int get_id(int h)const
|
||||
{
|
||||
name t(h, 0);
|
||||
typename std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t);
|
||||
std::vector<name>::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t);
|
||||
if((pos != m_sub_names.end()) && (*pos == t))
|
||||
{
|
||||
return pos->index;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
range_type equal_range(int h)const
|
||||
{
|
||||
name t(h, 0);
|
||||
return std::equal_range(m_sub_names.begin(), m_sub_names.end(), t);
|
||||
}
|
||||
private:
|
||||
std::vector<name> m_sub_names;
|
||||
};
|
||||
|
||||
template <class charT, class Other>
|
||||
class named_subexpressions_converter : public named_subexpressions_base<charT>
|
||||
{
|
||||
boost::shared_ptr<named_subexpressions<Other> > m_converter;
|
||||
public:
|
||||
named_subexpressions_converter(boost::shared_ptr<named_subexpressions<Other> > s)
|
||||
: m_converter(s) {}
|
||||
int get_id(const charT* i, const charT* j)const
|
||||
{
|
||||
if(i == j)
|
||||
return -1;
|
||||
std::vector<Other> v;
|
||||
while(i != j)
|
||||
{
|
||||
v.push_back(*i);
|
||||
++i;
|
||||
}
|
||||
return m_converter->get_id(&v[0], &v[0] + v.size());
|
||||
}
|
||||
int get_id(std::size_t h)const
|
||||
{
|
||||
return m_converter->get_id(h);
|
||||
}
|
||||
};
|
||||
|
||||
template <class To>
|
||||
inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs_imp(
|
||||
boost::shared_ptr<named_subexpressions<To> > s,
|
||||
boost::integral_constant<bool,true> const&)
|
||||
{
|
||||
return s;
|
||||
}
|
||||
template <class To, class From>
|
||||
inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs_imp(
|
||||
boost::shared_ptr<named_subexpressions<From> > s,
|
||||
boost::integral_constant<bool,false> const&)
|
||||
{
|
||||
return boost::shared_ptr<named_subexpressions_converter<To, From> >(new named_subexpressions_converter<To, From>(s));
|
||||
}
|
||||
template <class To, class From>
|
||||
inline boost::shared_ptr<named_subexpressions_base<To> > convert_to_named_subs(
|
||||
boost::shared_ptr<named_subexpressions<From> > s)
|
||||
{
|
||||
typedef typename boost::is_same<To, From>::type tag_type;
|
||||
return convert_to_named_subs_imp<To>(s, tag_type());
|
||||
}
|
||||
//
|
||||
// class regex_data:
|
||||
// represents the data we wish to expose to the matching algorithms.
|
||||
//
|
||||
template <class charT, class traits>
|
||||
struct regex_data : public named_subexpressions<charT>
|
||||
struct regex_data : public named_subexpressions
|
||||
{
|
||||
typedef regex_constants::syntax_option_type flag_type;
|
||||
typedef std::size_t size_type;
|
||||
@ -672,7 +626,7 @@ public:
|
||||
BOOST_ASSERT(0 != m_pimpl.get());
|
||||
return m_pimpl->get_data();
|
||||
}
|
||||
boost::shared_ptr<re_detail::named_subexpressions<charT> > get_named_subs()const
|
||||
boost::shared_ptr<re_detail::named_subexpressions > get_named_subs()const
|
||||
{
|
||||
return m_pimpl;
|
||||
}
|
||||
|
@ -806,7 +806,13 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
|
||||
re_syntax_base* p = base;
|
||||
std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i;
|
||||
if(idx > 10000)
|
||||
idx = m_pdata->get_id(idx);
|
||||
{
|
||||
//
|
||||
// There may be more than one capture group with this hash, just do what Perl
|
||||
// does and recurse to the leftmost:
|
||||
//
|
||||
idx = m_pdata->get_id(static_cast<int>(idx));
|
||||
}
|
||||
while(p)
|
||||
{
|
||||
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))
|
||||
|
@ -820,7 +820,11 @@ escape_type_class_jump:
|
||||
return false;
|
||||
}
|
||||
// maybe have \g{ddd}
|
||||
if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_open_brace)
|
||||
regex_constants::syntax_type syn = this->m_traits.syntax_type(*m_position);
|
||||
regex_constants::syntax_type syn_end = 0;
|
||||
if((syn == regex_constants::syntax_open_brace)
|
||||
|| (syn == regex_constants::escape_type_left_word)
|
||||
|| (syn == regex_constants::escape_type_end_buffer))
|
||||
{
|
||||
if(++m_position == m_end)
|
||||
{
|
||||
@ -828,6 +832,18 @@ escape_type_class_jump:
|
||||
return false;
|
||||
}
|
||||
have_brace = true;
|
||||
switch(syn)
|
||||
{
|
||||
case regex_constants::syntax_open_brace:
|
||||
syn_end = regex_constants::syntax_close_brace;
|
||||
break;
|
||||
case regex_constants::escape_type_left_word:
|
||||
syn_end = regex_constants::escape_type_right_word;
|
||||
break;
|
||||
default:
|
||||
syn_end = regex_constants::escape_type_end_buffer;
|
||||
break;
|
||||
}
|
||||
}
|
||||
negative = (*m_position == static_cast<charT>('-'));
|
||||
if((negative) && (++m_position == m_end))
|
||||
@ -837,18 +853,20 @@ escape_type_class_jump:
|
||||
}
|
||||
const charT* pc = m_position;
|
||||
int i = this->m_traits.toi(pc, m_end, 10);
|
||||
if(i < 0)
|
||||
if((i < 0) && syn_end)
|
||||
{
|
||||
// Check for a named capture:
|
||||
// Check for a named capture, get the leftmost one if there is more than one:
|
||||
const charT* base = m_position;
|
||||
while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace))
|
||||
while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != syn_end))
|
||||
{
|
||||
++m_position;
|
||||
i = this->m_pdata->get_id(base, m_position);
|
||||
}
|
||||
i = hash_value_from_capture_name(base, m_position);
|
||||
pc = m_position;
|
||||
}
|
||||
if(negative)
|
||||
i = 1 + m_mark_count - i;
|
||||
if((i > 0) && (this->m_backrefs & (1u << (i-1))))
|
||||
if(((i > 0) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1)))))
|
||||
{
|
||||
m_position = pc;
|
||||
re_brace* pb = static_cast<re_brace*>(this->append_state(syntax_element_backref, sizeof(re_brace)));
|
||||
@ -863,7 +881,7 @@ escape_type_class_jump:
|
||||
m_position = pc;
|
||||
if(have_brace)
|
||||
{
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace))
|
||||
if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != syn_end))
|
||||
{
|
||||
fail(regex_constants::error_escape, m_position - m_base, incomplete_message);
|
||||
return false;
|
||||
@ -1003,6 +1021,21 @@ bool basic_regex_parser<charT, traits>::parse_repeat(std::size_t low, std::size_
|
||||
//
|
||||
if(pocessive)
|
||||
{
|
||||
if(m_position != m_end)
|
||||
{
|
||||
//
|
||||
// Check for illegal following quantifier, we have to do this here, because
|
||||
// the extra states we insert below circumvents are usual error checking :-(
|
||||
//
|
||||
switch(this->m_traits.syntax_type(*m_position))
|
||||
{
|
||||
case regex_constants::syntax_star:
|
||||
case regex_constants::syntax_plus:
|
||||
case regex_constants::syntax_question:
|
||||
fail(regex_constants::error_badrepeat, m_position - m_base);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
re_brace* pb = static_cast<re_brace*>(this->insert_state(insert_point, syntax_element_startmark, sizeof(re_brace)));
|
||||
pb->index = -3;
|
||||
pb->icase = this->flags() & regbase::icase;
|
||||
|
@ -827,20 +827,20 @@ template <class charT>
|
||||
bool cpp_regex_traits_implementation<charT>::isctype(const charT c, char_class_type mask) const
|
||||
{
|
||||
return
|
||||
((mask & ::boost::re_detail::char_class_space) && (m_pctype->is(std::ctype<charT>::space, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_print) && (m_pctype->is(std::ctype<charT>::print, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_cntrl) && (m_pctype->is(std::ctype<charT>::cntrl, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_upper) && (m_pctype->is(std::ctype<charT>::upper, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_lower) && (m_pctype->is(std::ctype<charT>::lower, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_alpha) && (m_pctype->is(std::ctype<charT>::alpha, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_digit) && (m_pctype->is(std::ctype<charT>::digit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_punct) && (m_pctype->is(std::ctype<charT>::punct, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_xdigit) && (m_pctype->is(std::ctype<charT>::xdigit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_blank) && (m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
|
||||
((mask & ::boost::re_detail::char_class_space) && (this->m_pctype->is(std::ctype<charT>::space, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_print) && (this->m_pctype->is(std::ctype<charT>::print, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_cntrl) && (this->m_pctype->is(std::ctype<charT>::cntrl, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_upper) && (this->m_pctype->is(std::ctype<charT>::upper, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_lower) && (this->m_pctype->is(std::ctype<charT>::lower, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_alpha) && (this->m_pctype->is(std::ctype<charT>::alpha, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_digit) && (this->m_pctype->is(std::ctype<charT>::digit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_punct) && (this->m_pctype->is(std::ctype<charT>::punct, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_xdigit) && (this->m_pctype->is(std::ctype<charT>::xdigit, c)))
|
||||
|| ((mask & ::boost::re_detail::char_class_blank) && (this->m_pctype->is(std::ctype<charT>::space, c)) && !::boost::re_detail::is_separator(c))
|
||||
|| ((mask & ::boost::re_detail::char_class_word) && (c == '_'))
|
||||
|| ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c))
|
||||
|| ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v')))
|
||||
|| ((mask & ::boost::re_detail::char_class_horizontal_space) && m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
|
||||
|| ((mask & ::boost::re_detail::char_class_horizontal_space) && this->m_pctype->is(std::ctype<charT>::space, c) && !(is_separator(c) || (c == '\v')));
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -38,7 +38,6 @@ namespace boost{
|
||||
|
||||
namespace re_detail{
|
||||
|
||||
template <class charT>
|
||||
class named_subexpressions;
|
||||
|
||||
}
|
||||
@ -69,7 +68,7 @@ public:
|
||||
typedef typename re_detail::regex_iterator_traits<
|
||||
BidiIterator>::value_type char_type;
|
||||
typedef std::basic_string<char_type> string_type;
|
||||
typedef re_detail::named_subexpressions_base<char_type> named_sub_type;
|
||||
typedef re_detail::named_subexpressions named_sub_type;
|
||||
|
||||
// construct/copy/destroy:
|
||||
explicit match_results(const Allocator& a = Allocator())
|
||||
@ -225,10 +224,15 @@ public:
|
||||
//
|
||||
const_reference named_subexpression(const char_type* i, const char_type* j) const
|
||||
{
|
||||
//
|
||||
// Scan for the leftmost *matched* subexpression with the specified named:
|
||||
//
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
int index = m_named_subs->get_id(i, j);
|
||||
return index > 0 ? (*this)[index] : m_null;
|
||||
re_detail::named_subexpressions::range_type r = m_named_subs->equal_range(i, j);
|
||||
while((r.first != r.second) && ((*this)[r.first->index].matched == false))
|
||||
++r.first;
|
||||
return r.first != r.second ? (*this)[r.first->index] : m_null;
|
||||
}
|
||||
template <class charT>
|
||||
const_reference named_subexpression(const charT* i, const charT* j) const
|
||||
@ -243,10 +247,20 @@ public:
|
||||
}
|
||||
int named_subexpression_index(const char_type* i, const char_type* j) const
|
||||
{
|
||||
//
|
||||
// Scan for the leftmost *matched* subexpression with the specified named.
|
||||
// If none found then return the leftmost expression with that name,
|
||||
// otherwise an invalid index:
|
||||
//
|
||||
if(m_is_singular)
|
||||
raise_logic_error();
|
||||
int index = m_named_subs->get_id(i, j);
|
||||
return index > 0 ? index : -20;
|
||||
re_detail::named_subexpressions::range_type s, r;
|
||||
s = r = m_named_subs->equal_range(i, j);
|
||||
while((r.first != r.second) && ((*this)[r.first->index].matched == false))
|
||||
++r.first;
|
||||
if(r.first == r.second)
|
||||
r = s;
|
||||
return r.first != r.second ? r.first->index : -20;
|
||||
}
|
||||
template <class charT>
|
||||
int named_subexpression_index(const charT* i, const charT* j) const
|
||||
|
@ -200,7 +200,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_imp()
|
||||
m_match_flags |= regex_constants::match_all;
|
||||
m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last);
|
||||
m_presult->set_base(base);
|
||||
m_presult->set_named_subs(re_detail::convert_to_named_subs<typename match_results<BidiIterator>::char_type>(this->re.get_named_subs()));
|
||||
m_presult->set_named_subs(this->re.get_named_subs());
|
||||
if(m_match_flags & match_posix)
|
||||
m_result = *m_presult;
|
||||
verify_options(re.flags(), m_match_flags);
|
||||
@ -262,7 +262,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::find_imp()
|
||||
pstate = re.get_first_state();
|
||||
m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last);
|
||||
m_presult->set_base(base);
|
||||
m_presult->set_named_subs(re_detail::convert_to_named_subs<typename match_results<BidiIterator>::char_type>(this->re.get_named_subs()));
|
||||
m_presult->set_named_subs(this->re.get_named_subs());
|
||||
m_match_flags |= regex_constants::match_init;
|
||||
}
|
||||
else
|
||||
@ -588,8 +588,23 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_backref()
|
||||
// in the match, this is in line with ECMAScript, but not Perl
|
||||
// or PCRE.
|
||||
//
|
||||
BidiIterator i = (*m_presult)[static_cast<const re_brace*>(pstate)->index].first;
|
||||
BidiIterator j = (*m_presult)[static_cast<const re_brace*>(pstate)->index].second;
|
||||
int index = static_cast<const re_brace*>(pstate)->index;
|
||||
if(index >= 10000)
|
||||
{
|
||||
named_subexpressions::range_type r = re.get_data().equal_range(index);
|
||||
BOOST_ASSERT(r.first != r.second);
|
||||
do
|
||||
{
|
||||
index = r.first->index;
|
||||
++r.first;
|
||||
}while((r.first != r.second) && ((*m_presult)[index].matched != true));
|
||||
}
|
||||
|
||||
if((m_match_flags & match_perl) && !(*m_presult)[index].matched)
|
||||
return false;
|
||||
|
||||
BidiIterator i = (*m_presult)[index].first;
|
||||
BidiIterator j = (*m_presult)[index].second;
|
||||
while(i != j)
|
||||
{
|
||||
if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase)))
|
||||
@ -713,7 +728,7 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
|
||||
{
|
||||
// return true if marked sub-expression N has been matched:
|
||||
int index = static_cast<const re_brace*>(pstate)->index;
|
||||
bool result;
|
||||
bool result = false;
|
||||
if(index == 9999)
|
||||
{
|
||||
// Magic value for a (DEFINE) block:
|
||||
@ -721,11 +736,25 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
|
||||
}
|
||||
else if(index > 0)
|
||||
{
|
||||
// Have we matched subexpression "index"?
|
||||
// Check if index is a hash value:
|
||||
if(index >= 10000)
|
||||
index = re.get_data().get_id(index);
|
||||
// Have we matched subexpression "index"?
|
||||
result = (*m_presult)[index].matched;
|
||||
{
|
||||
named_subexpressions::range_type r = re.get_data().equal_range(index);
|
||||
while(r.first != r.second)
|
||||
{
|
||||
if((*m_presult)[r.first->index].matched)
|
||||
{
|
||||
result = true;
|
||||
break;
|
||||
}
|
||||
++r.first;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = (*m_presult)[index].matched;
|
||||
}
|
||||
pstate = pstate->next.p;
|
||||
}
|
||||
else
|
||||
@ -734,8 +763,20 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
|
||||
// If index == 0 then check for any recursion at all, otherwise for recursion to -index-1.
|
||||
int idx = -index-1;
|
||||
if(idx >= 10000)
|
||||
idx = re.get_data().get_id(idx);
|
||||
result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0));
|
||||
{
|
||||
named_subexpressions::range_type r = re.get_data().equal_range(idx);
|
||||
int stack_index = recursion_stack.empty() ? -1 : recursion_stack.back().idx;
|
||||
while(r.first != r.second)
|
||||
{
|
||||
result |= (stack_index == r.first->index);
|
||||
if(result)break;
|
||||
++r.first;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0));
|
||||
}
|
||||
pstate = pstate->next.p;
|
||||
}
|
||||
return result;
|
||||
|
@ -200,11 +200,11 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_startmark()
|
||||
BidiIterator saved_position = position;
|
||||
const re_syntax_base* next_pstate = static_cast<const re_jump*>(pstate->next.p)->alt.p->next.p;
|
||||
pstate = pstate->next.p->next.p;
|
||||
bool r = match_all_states();
|
||||
bool res = match_all_states();
|
||||
position = saved_position;
|
||||
if(negated)
|
||||
r = !r;
|
||||
if(r)
|
||||
res = !res;
|
||||
if(res)
|
||||
pstate = next_pstate;
|
||||
else
|
||||
pstate = alt->alt.p;
|
||||
@ -901,7 +901,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
|
||||
{
|
||||
recursion_info<results_type> saved = recursion_stack.back();
|
||||
recursion_stack.pop_back();
|
||||
const re_syntax_base* saved_state = pstate = saved.preturn_address;
|
||||
pstate = saved.preturn_address;
|
||||
repeater_count<BidiIterator>* saved_count = next_count;
|
||||
next_count = saved.repeater_stack;
|
||||
*m_presult = saved.results;
|
||||
|
@ -153,6 +153,11 @@ private:
|
||||
typedef typename boost::is_convertible<ForwardIter, const char_type*>::type tag_type;
|
||||
return get_named_sub_index(i, j, tag_type());
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
// msvc-8.0 issues a spurious warning on the call to std::advance here:
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:4244)
|
||||
#endif
|
||||
inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::false_&)
|
||||
{
|
||||
if(i != j)
|
||||
@ -166,6 +171,9 @@ private:
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(pop)
|
||||
#endif
|
||||
inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::true_&)
|
||||
{
|
||||
return m_traits.toi(i, j, base);
|
||||
|
@ -56,7 +56,7 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
template <class T, class A>
|
||||
operator std::basic_string<value_type, T, A> ()const
|
||||
{
|
||||
return std::basic_string<value_type, T, A>(this->first, this->second);
|
||||
return matched ? std::basic_string<value_type, T, A>(this->first, this->second) : std::basic_string<value_type, T, A>();
|
||||
}
|
||||
#else
|
||||
operator std::basic_string<value_type> ()const
|
||||
@ -66,19 +66,22 @@ struct sub_match : public std::pair<BidiIterator, BidiIterator>
|
||||
#endif
|
||||
difference_type BOOST_REGEX_CALL length()const
|
||||
{
|
||||
difference_type n = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
|
||||
difference_type n = matched ? ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0;
|
||||
return n;
|
||||
}
|
||||
std::basic_string<value_type> str()const
|
||||
{
|
||||
std::basic_string<value_type> result;
|
||||
std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
|
||||
result.reserve(len);
|
||||
BidiIterator i = this->first;
|
||||
while(i != this->second)
|
||||
if(matched)
|
||||
{
|
||||
result.append(1, *i);
|
||||
++i;
|
||||
std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second);
|
||||
result.reserve(len);
|
||||
BidiIterator i = this->first;
|
||||
while(i != this->second)
|
||||
{
|
||||
result.append(1, *i);
|
||||
++i;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const
|
||||
return u32regex_token_iterator<const UChar*>(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m);
|
||||
}
|
||||
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, == 1310)
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, > 1300)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
#ifdef BOOST_HAS_ABI_HEADERS
|
||||
|
@ -32,10 +32,10 @@ class stored_group
|
||||
public:
|
||||
enum storage_kind { sk_empty, sk_front, sk_back, sk_group };
|
||||
|
||||
stored_group(storage_kind kind = sk_empty) : kind(kind), group() { }
|
||||
stored_group(storage_kind p_kind = sk_empty) : kind(p_kind), group() { }
|
||||
|
||||
template<typename T>
|
||||
stored_group(const T& group) : kind(sk_group), group(new T(group)) { }
|
||||
stored_group(const T& p_group) : kind(sk_group), group(new T(p_group)) { }
|
||||
|
||||
bool is_front() const { return kind == sk_front; }
|
||||
bool is_back() const { return kind == sk_back; }
|
||||
@ -133,12 +133,12 @@ public:
|
||||
#endif
|
||||
|
||||
private:
|
||||
named_slot_map_iterator(group_iterator group, group_iterator last) :
|
||||
group(group), last_group(last), slot_assigned(false)
|
||||
named_slot_map_iterator(group_iterator giter, group_iterator last) :
|
||||
group(giter), last_group(last), slot_assigned(false)
|
||||
{ init_next_group(); }
|
||||
named_slot_map_iterator(group_iterator group, group_iterator last,
|
||||
named_slot_map_iterator(group_iterator giter, group_iterator last,
|
||||
slot_pair_iterator slot) :
|
||||
group(group), last_group(last), slot_(slot), slot_assigned(true)
|
||||
group(giter), last_group(last), slot_(slot), slot_assigned(true)
|
||||
{ }
|
||||
|
||||
void init_next_group()
|
||||
|
@ -47,9 +47,9 @@ namespace boost {
|
||||
friend class iterator_core_access;
|
||||
|
||||
public:
|
||||
slot_call_iterator(Iterator iter_in, Iterator end_in, Function f,
|
||||
slot_call_iterator(Iterator iter_in, Iterator end_in, Function func,
|
||||
optional<result_type> &c)
|
||||
: iter(iter_in), end(end_in), f(f), cache(&c)
|
||||
: iter(iter_in), end(end_in), f(func), cache(&c)
|
||||
{
|
||||
iter = std::find_if(iter, end, is_callable());
|
||||
}
|
||||
|
@ -345,8 +345,8 @@ namespace boost {
|
||||
#endif // BOOST_SIGNALS_NUM_ARGS > 0
|
||||
call_bound_slot f(&args);
|
||||
|
||||
typedef typename call_bound_slot::result_type result_type;
|
||||
optional<result_type> cache;
|
||||
typedef typename call_bound_slot::result_type call_result_type;
|
||||
optional<call_result_type> cache;
|
||||
// Let the combiner call the slots via a pair of input iterators
|
||||
return combiner()(slot_call_iterator(notification.impl->slots_.begin(),
|
||||
impl->slots_.end(), f, cache),
|
||||
@ -386,8 +386,8 @@ namespace boost {
|
||||
|
||||
call_bound_slot f(&args);
|
||||
|
||||
typedef typename call_bound_slot::result_type result_type;
|
||||
optional<result_type> cache;
|
||||
typedef typename call_bound_slot::result_type call_result_type;
|
||||
optional<call_result_type> cache;
|
||||
|
||||
// Let the combiner call the slots via a pair of input iterators
|
||||
return combiner()(slot_call_iterator(notification.impl->slots_.begin(),
|
||||
|
@ -17,6 +17,12 @@
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#ifndef BOOST_NO_STATIC_ASSERT
|
||||
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert(B, Msg)
|
||||
#else
|
||||
# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B )
|
||||
#endif
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
//
|
||||
// workaround for buggy integral-constant expression support:
|
||||
@ -38,7 +44,7 @@
|
||||
# define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x)
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_HAS_STATIC_ASSERT
|
||||
#ifndef BOOST_NO_STATIC_ASSERT
|
||||
# define BOOST_STATIC_ASSERT( B ) static_assert(B, #B)
|
||||
#else
|
||||
|
||||
@ -125,7 +131,7 @@ template<int x> struct static_assert_test{};
|
||||
enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \
|
||||
= sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) }
|
||||
#endif
|
||||
#endif // ndef BOOST_HAS_STATIC_ASSERT
|
||||
#endif // defined(BOOST_NO_STATIC_ASSERT)
|
||||
|
||||
#endif // BOOST_STATIC_ASSERT_HPP
|
||||
|
||||
|
@ -79,7 +79,7 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
|
||||
set_info(
|
||||
set_info(
|
||||
set_info(
|
||||
enable_error_info(x),
|
||||
boost::enable_error_info(x),
|
||||
throw_function(current_function)),
|
||||
throw_file(file)),
|
||||
throw_line(line)));
|
||||
|
@ -218,9 +218,9 @@ namespace boost{
|
||||
{
|
||||
#if !defined(BOOST_NO_CWCTYPE)
|
||||
if (sizeof(char_type) == 1)
|
||||
return std::isspace(c) != 0;
|
||||
return std::isspace(static_cast<int>(c)) != 0;
|
||||
else
|
||||
return std::iswspace(c) != 0;
|
||||
return std::iswspace(static_cast<std::wint_t>(c)) != 0;
|
||||
#else
|
||||
return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0;
|
||||
#endif
|
||||
@ -230,9 +230,9 @@ namespace boost{
|
||||
{
|
||||
#if !defined(BOOST_NO_CWCTYPE)
|
||||
if (sizeof(char_type) == 1)
|
||||
return std::ispunct(c) != 0;
|
||||
return std::ispunct(static_cast<int>(c)) != 0;
|
||||
else
|
||||
return std::iswpunct(c) != 0;
|
||||
return std::iswpunct(static_cast<std::wint_t>(c)) != 0;
|
||||
#else
|
||||
return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0;
|
||||
#endif
|
||||
@ -418,7 +418,7 @@ namespace boost{
|
||||
class char_separator
|
||||
{
|
||||
typedef tokenizer_detail::traits_extension<Tr> Traits;
|
||||
typedef std::basic_string<Char,Traits> string_type;
|
||||
typedef std::basic_string<Char,Tr> string_type;
|
||||
public:
|
||||
explicit
|
||||
char_separator(const Char* dropped_delims,
|
||||
@ -561,7 +561,7 @@ namespace boost{
|
||||
private:
|
||||
|
||||
typedef tokenizer_detail::traits_extension<Tr> Traits;
|
||||
typedef std::basic_string<Char,Traits> string_type;
|
||||
typedef std::basic_string<Char,Tr> string_type;
|
||||
string_type returnable_;
|
||||
string_type nonreturnable_;
|
||||
bool return_delims_;
|
||||
|
@ -37,6 +37,7 @@
|
||||
|
||||
#include "boost/type_traits/cv_traits.hpp"
|
||||
#include "boost/type_traits/function_traits.hpp"
|
||||
#include "boost/utility/swap.hpp"
|
||||
|
||||
#include "boost/detail/workaround.hpp" // needed for BOOST_WORKAROUND
|
||||
|
||||
@ -86,45 +87,28 @@ namespace detail {
|
||||
template<class T>
|
||||
class generate_error;
|
||||
|
||||
// - cons getters --------------------------------------------------------
|
||||
// called: get_class<N>::get<RETURN_TYPE>(aTuple)
|
||||
|
||||
template< int N >
|
||||
struct get_class {
|
||||
template<class RET, class HT, class TT >
|
||||
inline static RET get(const cons<HT, TT>& t)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__IBMCPP__,==600)
|
||||
// vacpp 6.0 is not very consistent regarding the member template keyword
|
||||
// Here it generates an error when the template keyword is used.
|
||||
return get_class<N-1>::get<RET>(t.tail);
|
||||
#else
|
||||
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
|
||||
#endif
|
||||
}
|
||||
template<class RET, class HT, class TT >
|
||||
inline static RET get(cons<HT, TT>& t)
|
||||
{
|
||||
#if BOOST_WORKAROUND(__IBMCPP__,==600)
|
||||
return get_class<N-1>::get<RET>(t.tail);
|
||||
#else
|
||||
return get_class<N-1>::BOOST_NESTED_TEMPLATE get<RET>(t.tail);
|
||||
#endif
|
||||
}
|
||||
template<int N>
|
||||
struct drop_front {
|
||||
template<class Tuple>
|
||||
struct apply {
|
||||
typedef BOOST_DEDUCED_TYPENAME drop_front<N-1>::BOOST_NESTED_TEMPLATE
|
||||
apply<Tuple> next;
|
||||
typedef BOOST_DEDUCED_TYPENAME next::type::tail_type type;
|
||||
static const type& call(const Tuple& tup) {
|
||||
return next::call(tup).tail;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
template<>
|
||||
struct get_class<0> {
|
||||
template<class RET, class HT, class TT>
|
||||
inline static RET get(const cons<HT, TT>& t)
|
||||
{
|
||||
return t.head;
|
||||
}
|
||||
template<class RET, class HT, class TT>
|
||||
inline static RET get(cons<HT, TT>& t)
|
||||
{
|
||||
return t.head;
|
||||
}
|
||||
struct drop_front<0> {
|
||||
template<class Tuple>
|
||||
struct apply {
|
||||
typedef Tuple type;
|
||||
static const type& call(const Tuple& tup) {
|
||||
return tup;
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
} // end of namespace detail
|
||||
@ -140,41 +124,23 @@ struct get_class<0> {
|
||||
template<int N, class T>
|
||||
struct element
|
||||
{
|
||||
private:
|
||||
typedef typename T::tail_type Next;
|
||||
public:
|
||||
typedef typename element<N-1, Next>::type type;
|
||||
};
|
||||
template<class T>
|
||||
struct element<0,T>
|
||||
{
|
||||
typedef typename T::head_type type;
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
||||
apply<T>::type::head_type type;
|
||||
};
|
||||
|
||||
template<int N, class T>
|
||||
struct element<N, const T>
|
||||
{
|
||||
private:
|
||||
typedef typename T::tail_type Next;
|
||||
typedef typename element<N-1, Next>::type unqualified_type;
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
||||
apply<T>::type::head_type unqualified_type;
|
||||
public:
|
||||
#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
|
||||
typedef const unqualified_type type;
|
||||
#else
|
||||
typedef typename boost::add_const<unqualified_type>::type type;
|
||||
#endif
|
||||
|
||||
};
|
||||
template<class T>
|
||||
struct element<0,const T>
|
||||
{
|
||||
#if BOOST_WORKAROUND(__BORLANDC__,<0x600)
|
||||
typedef const typename T::head_type type;
|
||||
#else
|
||||
typedef typename boost::add_const<typename T::head_type>::type type;
|
||||
typedef BOOST_DEDUCED_TYPENAME boost::add_const<unqualified_type>::type type;
|
||||
#endif
|
||||
};
|
||||
|
||||
#else // def BOOST_NO_CV_SPECIALIZATIONS
|
||||
|
||||
namespace detail {
|
||||
@ -182,31 +148,16 @@ namespace detail {
|
||||
template<int N, class T, bool IsConst>
|
||||
struct element_impl
|
||||
{
|
||||
private:
|
||||
typedef typename T::tail_type Next;
|
||||
public:
|
||||
typedef typename element_impl<N-1, Next, IsConst>::type type;
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
||||
apply<T>::type::head_type type;
|
||||
};
|
||||
|
||||
template<int N, class T>
|
||||
struct element_impl<N, T, true /* IsConst */>
|
||||
{
|
||||
private:
|
||||
typedef typename T::tail_type Next;
|
||||
public:
|
||||
typedef const typename element_impl<N-1, Next, true>::type type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct element_impl<0, T, false /* IsConst */>
|
||||
{
|
||||
typedef typename T::head_type type;
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct element_impl<0, T, true /* IsConst */>
|
||||
{
|
||||
typedef const typename T::head_type type;
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
||||
apply<T>::type::head_type unqualified_type;
|
||||
typedef const unqualified_type type;
|
||||
};
|
||||
|
||||
} // end of namespace detail
|
||||
@ -258,17 +209,10 @@ inline typename access_traits<
|
||||
typename element<N, cons<HT, TT> >::type
|
||||
>::non_const_type
|
||||
get(cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
|
||||
#if BOOST_WORKAROUND(__IBMCPP__,==600 )
|
||||
return detail::get_class<N>::
|
||||
#else
|
||||
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
|
||||
#endif
|
||||
get<
|
||||
typename access_traits<
|
||||
typename element<N, cons<HT, TT> >::type
|
||||
>::non_const_type,
|
||||
HT,TT
|
||||
>(c);
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
||||
apply<cons<HT, TT> > impl;
|
||||
typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
|
||||
return const_cast<cons_element&>(impl::call(c)).head;
|
||||
}
|
||||
|
||||
// get function for const cons-lists, returns a const reference to
|
||||
@ -279,17 +223,10 @@ inline typename access_traits<
|
||||
typename element<N, cons<HT, TT> >::type
|
||||
>::const_type
|
||||
get(const cons<HT, TT>& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) {
|
||||
#if BOOST_WORKAROUND(__IBMCPP__,==600)
|
||||
return detail::get_class<N>::
|
||||
#else
|
||||
return detail::get_class<N>::BOOST_NESTED_TEMPLATE
|
||||
#endif
|
||||
get<
|
||||
typename access_traits<
|
||||
typename element<N, cons<HT, TT> >::type
|
||||
>::const_type,
|
||||
HT,TT
|
||||
>(c);
|
||||
typedef BOOST_DEDUCED_TYPENAME detail::drop_front<N>::BOOST_NESTED_TEMPLATE
|
||||
apply<cons<HT, TT> > impl;
|
||||
typedef BOOST_DEDUCED_TYPENAME impl::type cons_element;
|
||||
return impl::call(c).head;
|
||||
}
|
||||
|
||||
// -- the cons template --------------------------------------------------
|
||||
@ -663,18 +600,21 @@ public:
|
||||
// Swallows any assignment (by Doug Gregor)
|
||||
namespace detail {
|
||||
|
||||
struct swallow_assign;
|
||||
typedef void (detail::swallow_assign::*ignore_t)();
|
||||
struct swallow_assign {
|
||||
|
||||
swallow_assign(ignore_t(*)(ignore_t)) {}
|
||||
template<typename T>
|
||||
swallow_assign const& operator=(const T&) const {
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
} // namespace detail
|
||||
|
||||
// "ignore" allows tuple positions to be ignored when using "tie".
|
||||
detail::swallow_assign const ignore = detail::swallow_assign();
|
||||
inline detail::ignore_t ignore(detail::ignore_t) { return 0; }
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// The call_traits for make_tuple
|
||||
@ -756,6 +696,10 @@ struct make_tuple_traits<const reference_wrapper<T> >{
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct make_tuple_traits<detail::ignore_t(detail::ignore_t)> {
|
||||
typedef detail::swallow_assign type;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -877,71 +821,154 @@ make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3,
|
||||
return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
||||
}
|
||||
|
||||
namespace detail {
|
||||
|
||||
template<class T>
|
||||
struct tie_traits {
|
||||
typedef T& type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct tie_traits<ignore_t(ignore_t)> {
|
||||
typedef swallow_assign type;
|
||||
};
|
||||
|
||||
template<>
|
||||
struct tie_traits<void> {
|
||||
typedef null_type type;
|
||||
};
|
||||
|
||||
template <
|
||||
class T0 = void, class T1 = void, class T2 = void,
|
||||
class T3 = void, class T4 = void, class T5 = void,
|
||||
class T6 = void, class T7 = void, class T8 = void,
|
||||
class T9 = void
|
||||
>
|
||||
struct tie_mapper {
|
||||
typedef
|
||||
tuple<typename tie_traits<T0>::type,
|
||||
typename tie_traits<T1>::type,
|
||||
typename tie_traits<T2>::type,
|
||||
typename tie_traits<T3>::type,
|
||||
typename tie_traits<T4>::type,
|
||||
typename tie_traits<T5>::type,
|
||||
typename tie_traits<T6>::type,
|
||||
typename tie_traits<T7>::type,
|
||||
typename tie_traits<T8>::type,
|
||||
typename tie_traits<T9>::type> type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
// Tie function templates -------------------------------------------------
|
||||
template<class T1>
|
||||
inline tuple<T1&> tie(T1& t1) {
|
||||
return tuple<T1&> (t1);
|
||||
template<class T0>
|
||||
inline typename detail::tie_mapper<T0>::type
|
||||
tie(T0& t0) {
|
||||
typedef typename detail::tie_mapper<T0>::type t;
|
||||
return t(t0);
|
||||
}
|
||||
|
||||
template<class T1, class T2>
|
||||
inline tuple<T1&, T2&> tie(T1& t1, T2& t2) {
|
||||
return tuple<T1&, T2&> (t1, t2);
|
||||
template<class T0, class T1>
|
||||
inline typename detail::tie_mapper<T0, T1>::type
|
||||
tie(T0& t0, T1& t1) {
|
||||
typedef typename detail::tie_mapper<T0, T1>::type t;
|
||||
return t(t0, t1);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3>
|
||||
inline tuple<T1&, T2&, T3&> tie(T1& t1, T2& t2, T3& t3) {
|
||||
return tuple<T1&, T2&, T3&> (t1, t2, t3);
|
||||
template<class T0, class T1, class T2>
|
||||
inline typename detail::tie_mapper<T0, T1, T2>::type
|
||||
tie(T0& t0, T1& t1, T2& t2) {
|
||||
typedef typename detail::tie_mapper<T0, T1, T2>::type t;
|
||||
return t(t0, t1, t2);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4>
|
||||
inline tuple<T1&, T2&, T3&, T4&> tie(T1& t1, T2& t2, T3& t3, T4& t4) {
|
||||
return tuple<T1&, T2&, T3&, T4&> (t1, t2, t3, t4);
|
||||
template<class T0, class T1, class T2, class T3>
|
||||
inline typename detail::tie_mapper<T0, T1, T2, T3>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3) {
|
||||
typedef typename detail::tie_mapper<T0, T1, T2, T3>::type t;
|
||||
return t(t0, t1, t2, t3);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4, class T5>
|
||||
inline tuple<T1&, T2&, T3&, T4&, T5&>
|
||||
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) {
|
||||
return tuple<T1&, T2&, T3&, T4&, T5&> (t1, t2, t3, t4, t5);
|
||||
template<class T0, class T1, class T2, class T3, class T4>
|
||||
inline typename detail::tie_mapper<T0, T1, T2, T3, T4>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
||||
T4& t4) {
|
||||
typedef typename detail::tie_mapper<T0, T1, T2, T3, T4>::type t;
|
||||
return t(t0, t1, t2, t3, t4);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&>
|
||||
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) {
|
||||
return tuple<T1&, T2&, T3&, T4&, T5&, T6&> (t1, t2, t3, t4, t5, t6);
|
||||
template<class T0, class T1, class T2, class T3, class T4, class T5>
|
||||
inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
||||
T4& t4, T5& t5) {
|
||||
typedef typename detail::tie_mapper<T0, T1, T2, T3, T4, T5>::type t;
|
||||
return t(t0, t1, t2, t3, t4, t5);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7>
|
||||
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&>
|
||||
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) {
|
||||
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&> (t1, t2, t3, t4, t5, t6, t7);
|
||||
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6>
|
||||
inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5, T6>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
||||
T4& t4, T5& t5, T6& t6) {
|
||||
typedef typename detail::tie_mapper
|
||||
<T0, T1, T2, T3, T4, T5, T6>::type t;
|
||||
return t(t0, t1, t2, t3, t4, t5, t6);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
|
||||
class T8>
|
||||
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
|
||||
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) {
|
||||
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&>
|
||||
(t1, t2, t3, t4, t5, t6, t7, t8);
|
||||
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
|
||||
class T7>
|
||||
inline typename detail::tie_mapper<T0, T1, T2, T3, T4, T5, T6, T7>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
||||
T4& t4, T5& t5, T6& t6, T7& t7) {
|
||||
typedef typename detail::tie_mapper
|
||||
<T0, T1, T2, T3, T4, T5, T6, T7>::type t;
|
||||
return t(t0, t1, t2, t3, t4, t5, t6, t7);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
|
||||
class T8, class T9>
|
||||
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
|
||||
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
|
||||
T9& t9) {
|
||||
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&>
|
||||
(t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
||||
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
|
||||
class T7, class T8>
|
||||
inline typename detail::tie_mapper
|
||||
<T0, T1, T2, T3, T4, T5, T6, T7, T8>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
||||
T4& t4, T5& t5, T6& t6, T7& t7,
|
||||
T8& t8) {
|
||||
typedef typename detail::tie_mapper
|
||||
<T0, T1, T2, T3, T4, T5, T6, T7, T8>::type t;
|
||||
return t(t0, t1, t2, t3, t4, t5, t6, t7, t8);
|
||||
}
|
||||
|
||||
template<class T1, class T2, class T3, class T4, class T5, class T6, class T7,
|
||||
class T8, class T9, class T10>
|
||||
inline tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&, T10&>
|
||||
tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8,
|
||||
T9& t9, T10& t10) {
|
||||
return tuple<T1&, T2&, T3&, T4&, T5&, T6&, T7&, T8&, T9&, T10&>
|
||||
(t1, t2, t3, t4, t5, t6, t7, t8, t9, t10);
|
||||
template<class T0, class T1, class T2, class T3, class T4, class T5, class T6,
|
||||
class T7, class T8, class T9>
|
||||
inline typename detail::tie_mapper
|
||||
<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type
|
||||
tie(T0& t0, T1& t1, T2& t2, T3& t3,
|
||||
T4& t4, T5& t5, T6& t6, T7& t7,
|
||||
T8& t8, T9& t9) {
|
||||
typedef typename detail::tie_mapper
|
||||
<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>::type t;
|
||||
return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9);
|
||||
}
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9>
|
||||
void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
|
||||
tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs);
|
||||
inline void swap(null_type&, null_type&) {}
|
||||
template<class HH>
|
||||
inline void swap(cons<HH, null_type>& lhs, cons<HH, null_type>& rhs) {
|
||||
::boost::swap(lhs.head, rhs.head);
|
||||
}
|
||||
template<class HH, class TT>
|
||||
inline void swap(cons<HH, TT>& lhs, cons<HH, TT>& rhs) {
|
||||
::boost::swap(lhs.head, rhs.head);
|
||||
::boost::tuples::swap(lhs.tail, rhs.tail);
|
||||
}
|
||||
template <class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9>
|
||||
inline void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
|
||||
tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs) {
|
||||
typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple_type;
|
||||
typedef typename tuple_type::inherited base;
|
||||
::boost::tuples::swap(static_cast<base&>(lhs), static_cast<base&>(rhs));
|
||||
}
|
||||
|
||||
} // end of namespace tuples
|
||||
|
@ -27,6 +27,7 @@
|
||||
#define BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP
|
||||
|
||||
#include "boost/type_traits.hpp"
|
||||
#include "boost/utility/swap.hpp"
|
||||
#include <utility>
|
||||
|
||||
#if defined BOOST_MSVC
|
||||
@ -836,6 +837,29 @@ namespace tuples {
|
||||
|
||||
detail::swallow_assign const ignore = detail::swallow_assign();
|
||||
|
||||
template <class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9>
|
||||
void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
|
||||
tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs);
|
||||
inline void swap(null_type&, null_type&) {}
|
||||
template<class HH>
|
||||
inline void swap(cons<HH, null_type>& lhs, cons<HH, null_type>& rhs) {
|
||||
::boost::swap(lhs.head, rhs.head);
|
||||
}
|
||||
template<class HH, class TT>
|
||||
inline void swap(cons<HH, TT>& lhs, cons<HH, TT>& rhs) {
|
||||
::boost::swap(lhs.head, rhs.head);
|
||||
::boost::tuples::swap(lhs.tail, rhs.tail);
|
||||
}
|
||||
template <class T0, class T1, class T2, class T3, class T4,
|
||||
class T5, class T6, class T7, class T8, class T9>
|
||||
inline void swap(tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& lhs,
|
||||
tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9>& rhs) {
|
||||
typedef tuple<T0, T1, T2, T3, T4, T5, T6, T7, T8, T9> tuple_type;
|
||||
typedef typename tuple_type::inherited base;
|
||||
::boost::tuples::swap(static_cast<base&>(lhs), static_cast<base&>(rhs));
|
||||
}
|
||||
|
||||
} // namespace tuples
|
||||
} // namespace boost
|
||||
#endif // BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP
|
||||
|
@ -384,6 +384,8 @@ extract_and_check_delimiter(
|
||||
if (is.good() && c!=d) {
|
||||
is.setstate(std::ios::failbit);
|
||||
}
|
||||
} else {
|
||||
is >> std::ws;
|
||||
}
|
||||
return is;
|
||||
}
|
||||
@ -478,6 +480,8 @@ extract_and_check_delimiter(
|
||||
if (is.good() && c!=d) {
|
||||
is.setstate(std::ios::failbit);
|
||||
}
|
||||
} else {
|
||||
is >> std::ws;
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
@ -12,10 +12,19 @@
|
||||
|
||||
#include "boost/type_traits/add_const.hpp"
|
||||
#include "boost/type_traits/add_cv.hpp"
|
||||
#include "boost/type_traits/add_lvalue_reference.hpp"
|
||||
#include "boost/type_traits/add_pointer.hpp"
|
||||
#include "boost/type_traits/add_reference.hpp"
|
||||
#include "boost/type_traits/add_rvalue_reference.hpp"
|
||||
#include "boost/type_traits/add_volatile.hpp"
|
||||
#include "boost/type_traits/aligned_storage.hpp"
|
||||
#include "boost/type_traits/alignment_of.hpp"
|
||||
#include "boost/type_traits/common_type.hpp"
|
||||
#include "boost/type_traits/conditional.hpp"
|
||||
#include "boost/type_traits/decay.hpp"
|
||||
#include "boost/type_traits/extent.hpp"
|
||||
#include "boost/type_traits/floating_point_promotion.hpp"
|
||||
#include "boost/type_traits/function_traits.hpp"
|
||||
#if !defined(__BORLANDC__) && !defined(__CUDACC__)
|
||||
#include "boost/type_traits/has_new_operator.hpp"
|
||||
#endif
|
||||
@ -28,14 +37,13 @@
|
||||
#include "boost/type_traits/has_trivial_copy.hpp"
|
||||
#include "boost/type_traits/has_trivial_destructor.hpp"
|
||||
#include "boost/type_traits/has_virtual_destructor.hpp"
|
||||
#include "boost/type_traits/is_signed.hpp"
|
||||
#include "boost/type_traits/is_unsigned.hpp"
|
||||
#include "boost/type_traits/is_abstract.hpp"
|
||||
#include "boost/type_traits/is_arithmetic.hpp"
|
||||
#include "boost/type_traits/is_array.hpp"
|
||||
#include "boost/type_traits/is_base_and_derived.hpp"
|
||||
#include "boost/type_traits/is_base_of.hpp"
|
||||
#include "boost/type_traits/is_class.hpp"
|
||||
#include <boost/type_traits/is_complex.hpp>
|
||||
#include "boost/type_traits/is_compound.hpp"
|
||||
#include "boost/type_traits/is_const.hpp"
|
||||
#include "boost/type_traits/is_convertible.hpp"
|
||||
@ -46,6 +54,7 @@
|
||||
#include "boost/type_traits/is_function.hpp"
|
||||
#include "boost/type_traits/is_fundamental.hpp"
|
||||
#include "boost/type_traits/is_integral.hpp"
|
||||
#include "boost/type_traits/is_lvalue_reference.hpp"
|
||||
#include "boost/type_traits/is_member_function_pointer.hpp"
|
||||
#include "boost/type_traits/is_member_object_pointer.hpp"
|
||||
#include "boost/type_traits/is_member_pointer.hpp"
|
||||
@ -55,16 +64,18 @@
|
||||
#include "boost/type_traits/is_pointer.hpp"
|
||||
#include "boost/type_traits/is_reference.hpp"
|
||||
#include "boost/type_traits/is_rvalue_reference.hpp"
|
||||
#include "boost/type_traits/is_lvalue_reference.hpp"
|
||||
#include "boost/type_traits/is_signed.hpp"
|
||||
#include "boost/type_traits/is_same.hpp"
|
||||
#include "boost/type_traits/is_scalar.hpp"
|
||||
#include "boost/type_traits/is_stateless.hpp"
|
||||
#include "boost/type_traits/is_union.hpp"
|
||||
#include "boost/type_traits/is_unsigned.hpp"
|
||||
#include "boost/type_traits/is_void.hpp"
|
||||
#include "boost/type_traits/is_virtual_base_of.hpp"
|
||||
#include "boost/type_traits/is_volatile.hpp"
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/type_traits/make_signed.hpp>
|
||||
#include "boost/type_traits/rank.hpp"
|
||||
#include "boost/type_traits/extent.hpp"
|
||||
#include "boost/type_traits/remove_bounds.hpp"
|
||||
#include "boost/type_traits/remove_extent.hpp"
|
||||
#include "boost/type_traits/remove_all_extents.hpp"
|
||||
@ -74,17 +85,10 @@
|
||||
#include "boost/type_traits/remove_reference.hpp"
|
||||
#include "boost/type_traits/remove_volatile.hpp"
|
||||
#include "boost/type_traits/type_with_alignment.hpp"
|
||||
#include "boost/type_traits/function_traits.hpp"
|
||||
#include "boost/type_traits/aligned_storage.hpp"
|
||||
#include "boost/type_traits/floating_point_promotion.hpp"
|
||||
#if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238))
|
||||
#include "boost/type_traits/integral_promotion.hpp"
|
||||
#include "boost/type_traits/promote.hpp"
|
||||
#endif
|
||||
#include <boost/type_traits/make_unsigned.hpp>
|
||||
#include <boost/type_traits/make_signed.hpp>
|
||||
#include <boost/type_traits/decay.hpp>
|
||||
#include <boost/type_traits/is_complex.hpp>
|
||||
|
||||
#include "boost/type_traits/ice.hpp"
|
||||
|
||||
|
26
boost/boost/type_traits/add_lvalue_reference.hpp
Normal file
26
boost/boost/type_traits/add_lvalue_reference.hpp
Normal file
@ -0,0 +1,26 @@
|
||||
// Copyright 2010 John Maddock
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
|
||||
#define BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
|
||||
|
||||
#include <boost/type_traits/add_reference.hpp>
|
||||
|
||||
// should be the last #include
|
||||
#include <boost/type_traits/detail/type_trait_def.hpp>
|
||||
|
||||
namespace boost{
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_lvalue_reference,T,typename boost::add_reference<T>::type)
|
||||
|
||||
#ifndef BOOST_NO_RVALUE_REFERENCES
|
||||
BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_lvalue_reference,T&&,T&)
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
#include <boost/type_traits/detail/type_trait_undef.hpp>
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP
|
67
boost/boost/type_traits/add_rvalue_reference.hpp
Normal file
67
boost/boost/type_traits/add_rvalue_reference.hpp
Normal file
@ -0,0 +1,67 @@
|
||||
// add_rvalue_reference.hpp ---------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP
|
||||
#define BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#include <boost/type_traits/is_void.hpp>
|
||||
#include <boost/type_traits/is_reference.hpp>
|
||||
|
||||
// should be the last #include
|
||||
#include <boost/type_traits/detail/type_trait_def.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// //
|
||||
// C++03 implementation of //
|
||||
// 20.7.6.2 Reference modifications [meta.trans.ref] //
|
||||
// Written by Vicente J. Botet Escriba //
|
||||
// //
|
||||
// If T names an object or function type then the member typedef type
|
||||
// shall name T&&; otherwise, type shall name T. [ Note: This rule reflects
|
||||
// the semantics of reference collapsing. For example, when a type T names
|
||||
// a type T1&, the type add_rvalue_reference<T>::type is not an rvalue
|
||||
// reference. —end note ]
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
namespace boost {
|
||||
|
||||
namespace type_traits_detail {
|
||||
|
||||
template <typename T, bool b>
|
||||
struct add_rvalue_reference_helper
|
||||
{ typedef T type; };
|
||||
|
||||
template <typename T>
|
||||
struct add_rvalue_reference_helper<T, true>
|
||||
{
|
||||
#if !defined(BOOST_NO_RVALUE_REFERENCES)
|
||||
typedef T&& type;
|
||||
#else
|
||||
typedef T type;
|
||||
#endif
|
||||
};
|
||||
|
||||
template <typename T>
|
||||
struct add_rvalue_reference_imp
|
||||
{
|
||||
typedef typename boost::type_traits_detail::add_rvalue_reference_helper
|
||||
<T, (!is_void<T>::value && !is_reference<T>::value) >::type type;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename boost::type_traits_detail::add_rvalue_reference_imp<T>::type)
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#include <boost/type_traits/detail/type_trait_undef.hpp>
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP
|
158
boost/boost/type_traits/common_type.hpp
Normal file
158
boost/boost/type_traits/common_type.hpp
Normal file
@ -0,0 +1,158 @@
|
||||
// common_type.hpp ---------------------------------------------------------//
|
||||
|
||||
// Copyright 2008 Howard Hinnant
|
||||
// Copyright 2008 Beman Dawes
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP
|
||||
#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
#ifdef __SUNPRO_CC
|
||||
# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF
|
||||
#endif
|
||||
#ifdef __IBMCPP__
|
||||
# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
#if defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
#define BOOST_COMMON_TYPE_ARITY 3
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
#if defined(BOOST_NO_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
|
||||
#define BOOST_TYPEOF_SILENT
|
||||
#include <boost/typeof/typeof.hpp> // boost wonders never cease!
|
||||
#endif
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
#ifndef BOOST_NO_STATIC_ASSERT
|
||||
#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG)
|
||||
#elif defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT)
|
||||
#include <boost/mpl/assert.hpp>
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) \
|
||||
BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES)
|
||||
#else
|
||||
#include <boost/static_assert.hpp>
|
||||
#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND)
|
||||
#endif
|
||||
|
||||
#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT)
|
||||
#define BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type"
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_DECLTYPE) && defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
|
||||
#include <boost/type_traits/detail/common_type_imp.hpp>
|
||||
#include <boost/type_traits/remove_cv.hpp>
|
||||
#endif
|
||||
#include <boost/mpl/if.hpp>
|
||||
#include <boost/utility/declval.hpp>
|
||||
#include <boost/type_traits/add_rvalue_reference.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// //
|
||||
// C++03 implementation of //
|
||||
// 20.6.7 Other transformations [meta.trans.other] //
|
||||
// Written by Howard Hinnant //
|
||||
// Adapted for Boost by Beman Dawes, Vicente Botet and Jeffrey Hellrung //
|
||||
// //
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
namespace boost {
|
||||
|
||||
// prototype
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
template<typename... T>
|
||||
struct common_type;
|
||||
#else // or no specialization
|
||||
template <class T, class U = void, class V = void>
|
||||
struct common_type
|
||||
{
|
||||
public:
|
||||
typedef typename common_type<typename common_type<T, U>::type, V>::type type;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
// 1 arg
|
||||
template<typename T>
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
struct common_type<T>
|
||||
#else
|
||||
struct common_type<T, void, void>
|
||||
|
||||
#endif
|
||||
{
|
||||
BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T));
|
||||
public:
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
// 2 args
|
||||
namespace type_traits_detail {
|
||||
|
||||
template <class T, class U>
|
||||
struct common_type_2
|
||||
{
|
||||
private:
|
||||
BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T));
|
||||
BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(U) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (U));
|
||||
static bool declval_bool(); // workaround gcc bug; not required by std
|
||||
static typename add_rvalue_reference<T>::type declval_T(); // workaround gcc bug; not required by std
|
||||
static typename add_rvalue_reference<U>::type declval_U(); // workaround gcc bug; not required by std
|
||||
static typename add_rvalue_reference<bool>::type declval_b();
|
||||
|
||||
#if !defined(BOOST_NO_DECLTYPE)
|
||||
public:
|
||||
typedef decltype(declval<bool>() ? declval<T>() : declval<U>()) type;
|
||||
#elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
|
||||
public:
|
||||
typedef typename detail_type_traits_common_type::common_type_impl<
|
||||
typename remove_cv<T>::type,
|
||||
typename remove_cv<U>::type
|
||||
>::type type;
|
||||
#else
|
||||
public:
|
||||
typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type;
|
||||
#endif
|
||||
|
||||
#if defined(__GNUC__) && __GNUC__ == 3 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3)
|
||||
public:
|
||||
void public_dummy_function_just_to_silence_warning();
|
||||
#endif
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct common_type_2<T, T>
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
template <class T, class U>
|
||||
struct common_type<T, U>
|
||||
#else
|
||||
template <class T, class U>
|
||||
struct common_type<T, U, void>
|
||||
#endif
|
||||
: type_traits_detail::common_type_2<T,U>
|
||||
{ };
|
||||
|
||||
|
||||
// 3 or more args
|
||||
#if !defined(BOOST_NO_VARIADIC_TEMPLATES)
|
||||
template<typename T, typename U, typename... V>
|
||||
struct common_type<T, U, V...> {
|
||||
public:
|
||||
typedef typename common_type<typename common_type<T, U>::type, V...>::type type;
|
||||
};
|
||||
#endif
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_COMMON_TYPE_HPP
|
25
boost/boost/type_traits/conditional.hpp
Normal file
25
boost/boost/type_traits/conditional.hpp
Normal file
@ -0,0 +1,25 @@
|
||||
|
||||
// (C) Copyright John Maddock 2010.
|
||||
// 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_CONDITIONAL_HPP_INCLUDED
|
||||
#define BOOST_TT_CONDITIONAL_HPP_INCLUDED
|
||||
|
||||
#include <boost/mpl/if.hpp>
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <bool b, class T, class U>
|
||||
struct conditional : public mpl::if_c<b, T, U>
|
||||
{
|
||||
};
|
||||
|
||||
} // namespace boost
|
||||
|
||||
|
||||
#endif // BOOST_TT_CONDITIONAL_HPP_INCLUDED
|
@ -166,7 +166,7 @@ struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
|
||||
|
||||
template<typename Function>
|
||||
struct function_traits :
|
||||
public boost::detail::function_traits_helper<typename boost::add_pointer<Function>::type>
|
||||
public boost::detail::function_traits_helper<typename boost::add_pointer<Function>::type>
|
||||
{
|
||||
};
|
||||
|
||||
|
@ -159,6 +159,33 @@
|
||||
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
|
||||
#endif
|
||||
|
||||
#if defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600)
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# include <boost/type_traits/is_reference.hpp>
|
||||
# include <boost/type_traits/is_volatile.hpp>
|
||||
|
||||
# define BOOST_IS_UNION(T) __is_union(T)
|
||||
# define BOOST_IS_POD(T) __is_pod(T)
|
||||
# define BOOST_IS_EMPTY(T) __is_empty(T)
|
||||
# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T)
|
||||
# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value)
|
||||
# define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
|
||||
# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
|
||||
# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
|
||||
# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
|
||||
# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
|
||||
# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
|
||||
|
||||
# define BOOST_IS_ABSTRACT(T) __is_abstract(T)
|
||||
# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
|
||||
# define BOOST_IS_CLASS(T) __is_class(T)
|
||||
# define BOOST_IS_ENUM(T) __is_enum(T)
|
||||
# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
|
||||
# define BOOST_ALIGNMENT_OF(T) __alignof__(T)
|
||||
|
||||
# define BOOST_HAS_TYPE_TRAITS_INTRINSICS
|
||||
#endif
|
||||
|
||||
# if defined(__CODEGEARC__)
|
||||
# include <boost/type_traits/is_same.hpp>
|
||||
# include <boost/type_traits/is_reference.hpp>
|
||||
|
@ -59,16 +59,16 @@ template <class T>
|
||||
struct is_const_rvalue_filter
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_const);
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_const);
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<T*>::is_const);
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<T*>::is_const);
|
||||
#endif
|
||||
};
|
||||
#ifndef BOOST_NO_RVALUE_REFERENCES
|
||||
template <class T>
|
||||
struct is_const_rvalue_filter<T&&>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
@ -24,14 +24,19 @@ namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
|
||||
#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
|
||||
|
||||
template <class T>
|
||||
struct is_signed_values
|
||||
{
|
||||
//
|
||||
// Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's
|
||||
// rather than "real" static constants simply doesn't work or give
|
||||
// the correct answer.
|
||||
//
|
||||
typedef typename remove_cv<T>::type no_cv_t;
|
||||
BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast<no_cv_t>(-1)));
|
||||
BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast<no_cv_t>(0)));
|
||||
static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
|
||||
static const no_cv_t zero = (static_cast<no_cv_t>(0));
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
@ -24,14 +24,19 @@ namespace boost {
|
||||
|
||||
namespace detail{
|
||||
|
||||
#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238)
|
||||
#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)
|
||||
|
||||
template <class T>
|
||||
struct is_unsigned_values
|
||||
{
|
||||
//
|
||||
// Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's
|
||||
// rather than "real" static constants simply doesn't work or give
|
||||
// the correct answer.
|
||||
//
|
||||
typedef typename remove_cv<T>::type no_cv_t;
|
||||
BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast<no_cv_t>(-1)));
|
||||
BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast<no_cv_t>(0)));
|
||||
static const no_cv_t minus_one = (static_cast<no_cv_t>(-1));
|
||||
static const no_cv_t zero = (static_cast<no_cv_t>(0));
|
||||
};
|
||||
|
||||
template <class T>
|
||||
|
@ -22,7 +22,7 @@ namespace detail {
|
||||
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4584 )
|
||||
#pragma warning( disable : 4584 4250)
|
||||
#elif defined __GNUC__
|
||||
#pragma GCC system_header
|
||||
#endif
|
||||
@ -37,37 +37,37 @@ template<typename Base, typename Derived>
|
||||
struct is_virtual_base_of_impl<Base, Derived, mpl::true_>
|
||||
{
|
||||
#ifdef __BORLANDC__
|
||||
struct X : public virtual Derived, public virtual Base
|
||||
struct boost_type_traits_internal_struct_X : public virtual Derived, public virtual Base
|
||||
{
|
||||
X();
|
||||
X(const X&);
|
||||
X& operator=(const X&);
|
||||
~X()throw();
|
||||
boost_type_traits_internal_struct_X();
|
||||
boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
|
||||
boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
|
||||
~boost_type_traits_internal_struct_X()throw();
|
||||
};
|
||||
struct Y : public virtual Derived
|
||||
struct boost_type_traits_internal_struct_Y : public virtual Derived
|
||||
{
|
||||
Y();
|
||||
Y(const Y&);
|
||||
Y& operator=(const Y&);
|
||||
~Y()throw();
|
||||
boost_type_traits_internal_struct_Y();
|
||||
boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
|
||||
boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&);
|
||||
~boost_type_traits_internal_struct_Y()throw();
|
||||
};
|
||||
#else
|
||||
struct X : Derived, virtual Base
|
||||
struct boost_type_traits_internal_struct_X : Derived, virtual Base
|
||||
{
|
||||
X();
|
||||
X(const X&);
|
||||
X& operator=(const X&);
|
||||
~X()throw();
|
||||
boost_type_traits_internal_struct_X();
|
||||
boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
|
||||
boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
|
||||
~boost_type_traits_internal_struct_X()throw();
|
||||
};
|
||||
struct Y : Derived
|
||||
struct boost_type_traits_internal_struct_Y : Derived
|
||||
{
|
||||
Y();
|
||||
Y(const Y&);
|
||||
Y& operator=(const Y&);
|
||||
~Y()throw();
|
||||
boost_type_traits_internal_struct_Y();
|
||||
boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
|
||||
boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&);
|
||||
~boost_type_traits_internal_struct_Y()throw();
|
||||
};
|
||||
#endif
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y)));
|
||||
BOOST_STATIC_CONSTANT(bool, value = (sizeof(boost_type_traits_internal_struct_X)==sizeof(boost_type_traits_internal_struct_Y)));
|
||||
};
|
||||
|
||||
template<typename Base, typename Derived>
|
||||
|
@ -46,9 +46,9 @@ template <class T>
|
||||
struct is_volatile_rval_filter
|
||||
{
|
||||
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_volatile);
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_volatile);
|
||||
#else
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<T*>::is_volatile);
|
||||
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<T*>::is_volatile);
|
||||
#endif
|
||||
};
|
||||
#ifndef BOOST_NO_RVALUE_REFERENCES
|
||||
@ -59,7 +59,7 @@ struct is_volatile_rval_filter
|
||||
template <class T>
|
||||
struct is_volatile_rval_filter<T&&>
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
BOOST_STATIC_CONSTANT(bool, value = false);
|
||||
};
|
||||
#endif
|
||||
}
|
||||
|
@ -32,7 +32,7 @@ namespace detail{
|
||||
template <class T>
|
||||
struct rvalue_ref_filter_rem_cv
|
||||
{
|
||||
typedef typename boost::detail::cv_traits_imp<T*>::unqualified_type type;
|
||||
typedef typename boost::detail::cv_traits_imp<T*>::unqualified_type type;
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_RVALUE_REFERENCES
|
||||
@ -43,7 +43,7 @@ struct rvalue_ref_filter_rem_cv
|
||||
template <class T>
|
||||
struct rvalue_ref_filter_rem_cv<T&&>
|
||||
{
|
||||
typedef T&& type;
|
||||
typedef T&& type;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
@ -32,13 +32,13 @@ namespace detail{
|
||||
template <class T>
|
||||
struct remove_rvalue_ref
|
||||
{
|
||||
typedef T type;
|
||||
typedef T type;
|
||||
};
|
||||
#ifndef BOOST_NO_RVALUE_REFERENCES
|
||||
template <class T>
|
||||
struct remove_rvalue_ref<T&&>
|
||||
{
|
||||
typedef T type;
|
||||
typedef T type;
|
||||
};
|
||||
#endif
|
||||
|
||||
|
8
boost/boost/typeof/message.hpp
Normal file
8
boost/boost/typeof/message.hpp
Normal file
@ -0,0 +1,8 @@
|
||||
// Copyright (C) 2005 Arkadiy Vertleyb
|
||||
// Use, modification and distribution is subject to the Boost Software
|
||||
// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#if defined(_MSC_VER) && defined BOOST_TYPEOF_MESSAGES
|
||||
# pragma message(BOOST_TYPEOF_TEXT)
|
||||
#endif
|
||||
#undef BOOST_TYPEOF_TEXT
|
283
boost/boost/typeof/msvc/typeof_impl.hpp
Normal file
283
boost/boost/typeof/msvc/typeof_impl.hpp
Normal file
@ -0,0 +1,283 @@
|
||||
|
||||
// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com (VC 6.5,VC 7.1 + counter code)
|
||||
// Copyright (C) 2005-2007 Peder Holt (VC 7.0 + framework)
|
||||
// Copyright (C) 2006 Steven Watanabe (VC 8.0)
|
||||
|
||||
// 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_MSVC_TYPEOF_IMPL_HPP_INCLUDED
|
||||
# define BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED
|
||||
|
||||
# include <boost/config.hpp>
|
||||
# include <boost/detail/workaround.hpp>
|
||||
# include <boost/mpl/int.hpp>
|
||||
# include <boost/type_traits/is_function.hpp>
|
||||
# include <boost/utility/enable_if.hpp>
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
|
||||
# include <typeinfo>
|
||||
# endif
|
||||
|
||||
namespace boost
|
||||
{
|
||||
namespace type_of
|
||||
{
|
||||
|
||||
//Compile time constant code
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) && defined(_MSC_EXTENSIONS)
|
||||
template<int N> struct the_counter;
|
||||
|
||||
template<typename T,int N = 5/*for similarity*/>
|
||||
struct encode_counter
|
||||
{
|
||||
__if_exists(the_counter<N + 256>)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter<T,N + 257>::count));
|
||||
}
|
||||
__if_not_exists(the_counter<N + 256>)
|
||||
{
|
||||
__if_exists(the_counter<N + 64>)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter<T,N + 65>::count));
|
||||
}
|
||||
__if_not_exists(the_counter<N + 64>)
|
||||
{
|
||||
__if_exists(the_counter<N + 16>)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter<T,N + 17>::count));
|
||||
}
|
||||
__if_not_exists(the_counter<N + 16>)
|
||||
{
|
||||
__if_exists(the_counter<N + 4>)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter<T,N + 5>::count));
|
||||
}
|
||||
__if_not_exists(the_counter<N + 4>)
|
||||
{
|
||||
__if_exists(the_counter<N>)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter<T,N + 1>::count));
|
||||
}
|
||||
__if_not_exists(the_counter<N>)
|
||||
{
|
||||
BOOST_STATIC_CONSTANT(unsigned,count=N);
|
||||
typedef the_counter<N> type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
# define BOOST_TYPEOF_INDEX(T) (encode_counter<T>::count)
|
||||
# define BOOST_TYPEOF_NEXT_INDEX(next)
|
||||
# else
|
||||
template<int N> struct encode_counter : encode_counter<N - 1> {};
|
||||
template<> struct encode_counter<0> {};
|
||||
|
||||
//Need to default to a larger value than 4, as due to MSVC's ETI errors. (sizeof(int)==4)
|
||||
char (*encode_index(...))[5];
|
||||
|
||||
# define BOOST_TYPEOF_INDEX(T) (sizeof(*boost::type_of::encode_index((boost::type_of::encode_counter<1005>*)0)))
|
||||
# define BOOST_TYPEOF_NEXT_INDEX(next) friend char (*encode_index(encode_counter<next>*))[next];
|
||||
# endif
|
||||
|
||||
//Typeof code
|
||||
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC,==1300)
|
||||
template<typename ID>
|
||||
struct msvc_extract_type
|
||||
{
|
||||
template<bool>
|
||||
struct id2type_impl;
|
||||
|
||||
typedef id2type_impl<true> id2type;
|
||||
};
|
||||
|
||||
template<typename T, typename ID>
|
||||
struct msvc_register_type : msvc_extract_type<ID>
|
||||
{
|
||||
template<>
|
||||
struct id2type_impl<true> //VC7.0 specific bugfeature
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
};
|
||||
#elif BOOST_WORKAROUND(BOOST_MSVC,>=1400)
|
||||
struct msvc_extract_type_default_param {};
|
||||
|
||||
template<typename ID, typename T = msvc_extract_type_default_param>
|
||||
struct msvc_extract_type;
|
||||
|
||||
template<typename ID>
|
||||
struct msvc_extract_type<ID, msvc_extract_type_default_param> {
|
||||
template<bool>
|
||||
struct id2type_impl;
|
||||
|
||||
typedef id2type_impl<true> id2type;
|
||||
};
|
||||
|
||||
template<typename ID, typename T>
|
||||
struct msvc_extract_type : msvc_extract_type<ID,msvc_extract_type_default_param>
|
||||
{
|
||||
template<>
|
||||
struct id2type_impl<true> //VC8.0 specific bugfeature
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
template<bool>
|
||||
struct id2type_impl;
|
||||
|
||||
typedef id2type_impl<true> id2type;
|
||||
};
|
||||
|
||||
template<typename T, typename ID>
|
||||
struct msvc_register_type : msvc_extract_type<ID, T>
|
||||
{
|
||||
};
|
||||
# else
|
||||
template<typename ID>
|
||||
struct msvc_extract_type
|
||||
{
|
||||
struct id2type;
|
||||
};
|
||||
|
||||
template<typename T, typename ID>
|
||||
struct msvc_register_type : msvc_extract_type<ID>
|
||||
{
|
||||
typedef msvc_extract_type<ID> base_type;
|
||||
struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
};
|
||||
# endif
|
||||
// EAN: preprocess this block out on advice of Peder Holt
|
||||
// to eliminate errors in type_traits/common_type.hpp
|
||||
# if 0 //BOOST_WORKAROUND(BOOST_MSVC,==1310)
|
||||
template<const std::type_info& ref_type_info>
|
||||
struct msvc_typeid_wrapper {
|
||||
typedef typename msvc_extract_type<msvc_typeid_wrapper>::id2type id2type;
|
||||
typedef typename id2type::type wrapped_type;
|
||||
typedef typename wrapped_type::type type;
|
||||
};
|
||||
//This class is used for registering the type T. encode_type<T> is mapped against typeid(encode_type<T>).
|
||||
//msvc_typeid_wrapper<typeid(encode_type<T>)> will now have a type typedef that equals encode_type<T>.
|
||||
template<typename T>
|
||||
struct encode_type
|
||||
{
|
||||
typedef encode_type<T> input_type;
|
||||
//Invoke registration of encode_type<T>. typeid(encode_type<T>) is now mapped to encode_type<T>. Do not use registered_type for anything.
|
||||
//The reason for registering encode_type<T> rather than T, is that VC handles typeid(function reference) poorly. By adding another
|
||||
//level of indirection, we solve this problem.
|
||||
typedef typename msvc_register_type<input_type,msvc_typeid_wrapper<typeid(input_type)> >::id2type registered_type;
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template<typename T> typename disable_if<
|
||||
typename is_function<T>::type,
|
||||
typename encode_type<T>::input_type>::type encode_start(T const&);
|
||||
|
||||
template<typename T> typename enable_if<
|
||||
typename is_function<T>::type,
|
||||
typename encode_type<T>::input_type>::type encode_start(T&);
|
||||
|
||||
template<typename Organizer, typename T>
|
||||
msvc_register_type<T,Organizer> typeof_register_type(const T&);
|
||||
|
||||
|
||||
# define BOOST_TYPEOF(expr) \
|
||||
boost::type_of::msvc_typeid_wrapper<typeid(boost::type_of::encode_start(expr))>::type
|
||||
|
||||
# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr)
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
|
||||
struct name {\
|
||||
enum {_typeof_register_value=sizeof(typeid(boost::type_of::typeof_register_type<name>(expr)))};\
|
||||
typedef typename boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef typename id2type::type type;\
|
||||
};
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
|
||||
struct name {\
|
||||
enum {_typeof_register_value=sizeof(typeid(boost::type_of::typeof_register_type<name>(expr)))};\
|
||||
typedef boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef id2type::type type;\
|
||||
};
|
||||
|
||||
# else
|
||||
template<int ID>
|
||||
struct msvc_typeid_wrapper {
|
||||
typedef typename msvc_extract_type<mpl::int_<ID> >::id2type id2type;
|
||||
typedef typename id2type::type type;
|
||||
};
|
||||
//Workaround for ETI-bug for VC6 and VC7
|
||||
template<>
|
||||
struct msvc_typeid_wrapper<1> {
|
||||
typedef msvc_typeid_wrapper<1> type;
|
||||
};
|
||||
//Workaround for ETI-bug for VC7.1
|
||||
template<>
|
||||
struct msvc_typeid_wrapper<4> {
|
||||
typedef msvc_typeid_wrapper<4> type;
|
||||
};
|
||||
|
||||
//Tie it all together
|
||||
template<typename T>
|
||||
struct encode_type
|
||||
{
|
||||
//Get the next available compile time constants index
|
||||
BOOST_STATIC_CONSTANT(unsigned,value=BOOST_TYPEOF_INDEX(T));
|
||||
//Instantiate the template
|
||||
typedef typename msvc_register_type<T,mpl::int_<value> >::id2type type;
|
||||
//Set the next compile time constants index
|
||||
BOOST_STATIC_CONSTANT(unsigned,next=value+1);
|
||||
//Increment the compile time constant (only needed when extensions are not active
|
||||
BOOST_TYPEOF_NEXT_INDEX(next);
|
||||
};
|
||||
|
||||
template<class T>
|
||||
struct sizer
|
||||
{
|
||||
typedef char(*type)[encode_type<T>::value];
|
||||
};
|
||||
# if BOOST_WORKAROUND(BOOST_MSVC,>=1310)
|
||||
template<typename T> typename disable_if<
|
||||
typename is_function<T>::type,
|
||||
typename sizer<T>::type>::type encode_start(T const&);
|
||||
|
||||
template<typename T> typename enable_if<
|
||||
typename is_function<T>::type,
|
||||
typename sizer<T>::type>::type encode_start(T&);
|
||||
# else
|
||||
template<typename T>
|
||||
typename sizer<T>::type encode_start(T const&);
|
||||
# endif
|
||||
template<typename Organizer, typename T>
|
||||
msvc_register_type<T,Organizer> typeof_register_type(const T&,Organizer* =0);
|
||||
|
||||
# define BOOST_TYPEOF(expr) \
|
||||
boost::type_of::msvc_typeid_wrapper<sizeof(*boost::type_of::encode_start(expr))>::type
|
||||
|
||||
# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr)
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
|
||||
struct name {\
|
||||
BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr)));\
|
||||
typedef typename boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef typename id2type::type type;\
|
||||
};
|
||||
|
||||
# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
|
||||
struct name {\
|
||||
BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type<name>(expr)));\
|
||||
typedef boost::type_of::msvc_extract_type<name>::id2type id2type;\
|
||||
typedef id2type::type type;\
|
||||
};
|
||||
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
#endif//BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED
|
60
boost/boost/typeof/native.hpp
Normal file
60
boost/boost/typeof/native.hpp
Normal file
@ -0,0 +1,60 @@
|
||||
// Copyright (C) 2006 Arkadiy Vertleyb
|
||||
// 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_NATIVE_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_NATIVE_HPP_INCLUDED
|
||||
|
||||
#ifndef MSVC_TYPEOF_HACK
|
||||
|
||||
#ifdef BOOST_NO_SFINAE
|
||||
|
||||
namespace boost { namespace type_of {
|
||||
|
||||
template<class T>
|
||||
T& ensure_obj(const T&);
|
||||
|
||||
}}
|
||||
|
||||
#else
|
||||
|
||||
#include <boost/type_traits/is_function.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
||||
namespace boost { namespace type_of {
|
||||
# ifdef BOOST_NO_SFINAE
|
||||
template<class T>
|
||||
T& ensure_obj(const T&);
|
||||
# else
|
||||
template<typename T>
|
||||
typename enable_if<is_function<T>, T&>::type
|
||||
ensure_obj(T&);
|
||||
|
||||
template<typename T>
|
||||
typename disable_if<is_function<T>, T&>::type
|
||||
ensure_obj(const T&);
|
||||
# endif
|
||||
}}
|
||||
|
||||
#endif//BOOST_NO_SFINAE
|
||||
|
||||
#define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr))
|
||||
#define BOOST_TYPEOF_TPL BOOST_TYPEOF
|
||||
|
||||
#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \
|
||||
struct name {\
|
||||
typedef BOOST_TYPEOF_TPL(expr) type;\
|
||||
};
|
||||
|
||||
#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \
|
||||
struct name {\
|
||||
typedef BOOST_TYPEOF(expr) type;\
|
||||
};
|
||||
|
||||
#endif//MSVC_TYPEOF_HACK
|
||||
|
||||
#define BOOST_TYPEOF_REGISTER_TYPE(x)
|
||||
#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params)
|
||||
|
||||
#endif//BOOST_TYPEOF_NATIVE_HPP_INCLUDED
|
||||
|
203
boost/boost/typeof/typeof.hpp
Normal file
203
boost/boost/typeof/typeof.hpp
Normal file
@ -0,0 +1,203 @@
|
||||
// Copyright (C) 2004 Arkadiy Vertleyb
|
||||
// Distributed under the 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_TYPEOF_TYPEOF_HPP_INCLUDED
|
||||
#define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
|
||||
|
||||
#if defined(BOOST_TYPEOF_COMPLIANT)
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_TYPEOF_EMULATION) && defined(BOOST_TYPEOF_NATIVE)
|
||||
# error both typeof emulation and native mode requested
|
||||
#endif
|
||||
|
||||
#if defined(__COMO__)
|
||||
# ifdef __GNUG__
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# define BOOST_TYPEOF_KEYWORD typeof
|
||||
# endif
|
||||
# else
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# error native typeof is not supported
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC)
|
||||
# ifdef __GNUC__
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# define BOOST_TYPEOF_KEYWORD __typeof__
|
||||
# endif
|
||||
# else
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# error native typeof is not supported
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# define BOOST_TYPEOF_KEYWORD __typeof__
|
||||
# endif
|
||||
|
||||
#elif defined(__MWERKS__)
|
||||
# if(__MWERKS__ <= 0x3003) // 8.x
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# define BOOST_TYPEOF_KEYWORD __typeof__
|
||||
# else
|
||||
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
|
||||
# endif
|
||||
# else // 9.x
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# define BOOST_TYPEOF_KEYWORD __typeof__
|
||||
# endif
|
||||
# endif
|
||||
#elif defined __CODEGEARC__
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
|
||||
# endif
|
||||
#elif defined __BORLANDC__
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
|
||||
# endif
|
||||
# else
|
||||
# define BOOST_TYPEOF_EMULATION_UNSUPPORTED
|
||||
# endif
|
||||
#elif defined __DMC__
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# include <boost/typeof/dmc/typeof_impl.hpp>
|
||||
# define MSVC_TYPEOF_HACK
|
||||
# endif
|
||||
#elif defined(_MSC_VER)
|
||||
# if (_MSC_VER <= 1300) // 6.5, 7.0
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# include <boost/typeof/msvc/typeof_impl.hpp>
|
||||
# define MSVC_TYPEOF_HACK
|
||||
# else
|
||||
# error typeof emulation is not supported
|
||||
# endif
|
||||
# elif (_MSC_VER >= 1310) // 7.1 ->
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef _MSC_EXTENSIONS
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# else
|
||||
# define BOOST_TYPEOF_NATIVE
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# ifdef BOOST_TYPEOF_NATIVE
|
||||
# include <boost/typeof/msvc/typeof_impl.hpp>
|
||||
# define MSVC_TYPEOF_HACK
|
||||
# endif
|
||||
# endif
|
||||
#elif defined(__HP_aCC)
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# error native typeof is not supported
|
||||
# endif
|
||||
|
||||
#elif defined(__DECCXX)
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# error native typeof is not supported
|
||||
# endif
|
||||
|
||||
#elif defined(__BORLANDC__)
|
||||
# if (__BORLANDC__ < 0x590)
|
||||
# define BOOST_TYPEOF_NO_FUNCTION_TYPES
|
||||
# define BOOST_TYPEOF_NO_MEMBER_FUNCTION_TYPES
|
||||
# endif
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# error native typeof is not supported
|
||||
# endif
|
||||
|
||||
#else //unknown compiler
|
||||
# ifndef BOOST_TYPEOF_NATIVE
|
||||
# ifndef BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_EMULATION
|
||||
# endif
|
||||
# else
|
||||
# ifndef BOOST_TYPEOF_KEYWORD
|
||||
# define BOOST_TYPEOF_KEYWORD typeof
|
||||
# endif
|
||||
# endif
|
||||
|
||||
#endif
|
||||
|
||||
#define BOOST_TYPEOF_UNIQUE_ID()\
|
||||
BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__
|
||||
|
||||
#define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\
|
||||
<boost/typeof/incr_registration_group.hpp>
|
||||
|
||||
#ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED
|
||||
# include <boost/typeof/unsupported.hpp>
|
||||
#elif defined BOOST_TYPEOF_EMULATION
|
||||
# define BOOST_TYPEOF_TEXT "using typeof emulation"
|
||||
# include <boost/typeof/message.hpp>
|
||||
# include <boost/typeof/typeof_impl.hpp>
|
||||
# include <boost/typeof/type_encoding.hpp>
|
||||
# include <boost/typeof/template_encoding.hpp>
|
||||
# include <boost/typeof/modifiers.hpp>
|
||||
# include <boost/typeof/pointers_data_members.hpp>
|
||||
# include <boost/typeof/register_functions.hpp>
|
||||
# include <boost/typeof/register_fundamental.hpp>
|
||||
|
||||
#elif defined(BOOST_TYPEOF_NATIVE)
|
||||
# define BOOST_TYPEOF_TEXT "using native typeof"
|
||||
# include <boost/typeof/message.hpp>
|
||||
# include <boost/typeof/native.hpp>
|
||||
#else
|
||||
# error typeof configuration error
|
||||
#endif
|
||||
|
||||
// auto
|
||||
#define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr
|
||||
#define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr
|
||||
|
||||
#endif//BOOST_TYPEOF_TYPEOF_HPP_INCLUDED
|
44
boost/boost/utility/declval.hpp
Normal file
44
boost/boost/utility/declval.hpp
Normal file
@ -0,0 +1,44 @@
|
||||
// common_type.hpp ---------------------------------------------------------//
|
||||
|
||||
// Copyright 2010 Vicente J. Botet Escriba
|
||||
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// See http://www.boost.org/LICENSE_1_0.txt
|
||||
|
||||
#ifndef BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
|
||||
#define BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
|
||||
|
||||
#include <boost/config.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
#include <boost/type_traits/add_rvalue_reference.hpp>
|
||||
|
||||
//----------------------------------------------------------------------------//
|
||||
// //
|
||||
// C++03 implementation of //
|
||||
// Written by Vicente J. Botet Escriba //
|
||||
//~ 20.3.4 Function template declval [declval]
|
||||
//~ 1 The library provides the function template declval to simplify the definition of expressions which occur as
|
||||
//~ unevaluated operands.
|
||||
//~ 2 Remarks: If this function is used, the program is ill-formed.
|
||||
//~ 3 Remarks: The template parameter T of declval may be an incomplete type.
|
||||
//~ [ Example:
|
||||
|
||||
//~ template <class To, class From>
|
||||
//~ decltype(static_cast<To>(declval<From>())) convert(From&&);
|
||||
|
||||
//~ declares a function template convert which only participats in overloading if the type From can be
|
||||
//~ explicitly converted to type To. For another example see class template common_type (20.7.6.6). —end
|
||||
//~ example ]
|
||||
// //
|
||||
//----------------------------------------------------------------------------//
|
||||
|
||||
namespace boost {
|
||||
|
||||
template <typename T>
|
||||
typename add_rvalue_reference<T>::type declval(); //noexcept; // as unevaluated operand
|
||||
|
||||
} // namespace boost
|
||||
|
||||
#endif // BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP
|
@ -19,7 +19,7 @@
|
||||
// BOOST_VERSION / 100 % 1000 is the minor version
|
||||
// BOOST_VERSION / 100000 is the major version
|
||||
|
||||
#define BOOST_VERSION 104400
|
||||
#define BOOST_VERSION 104601
|
||||
|
||||
//
|
||||
// BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION
|
||||
@ -27,7 +27,7 @@
|
||||
// number, y is the minor version number, and z is the patch level if not 0.
|
||||
// This is used by <config/auto_link.hpp> to select which library version to link to.
|
||||
|
||||
#define BOOST_LIB_VERSION "1_44"
|
||||
#define BOOST_LIB_VERSION "1_46_1"
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -31,6 +31,9 @@ typedef boost::match_flag_type match_flag_type;
|
||||
#ifdef BOOST_MSVC
|
||||
#pragma warning(disable:4309)
|
||||
#endif
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:981 383)
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
|
@ -22,6 +22,10 @@
|
||||
#define BOOST_REGEX_ICU_INSTANTIATE
|
||||
#include <boost/regex/icu.hpp>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:981 2259 383)
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
namespace re_detail{
|
||||
|
@ -44,6 +44,9 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:383)
|
||||
#endif
|
||||
|
||||
namespace boost{
|
||||
|
||||
@ -221,19 +224,3 @@ int WINAPI DllEntryPoint(HINSTANCE , unsigned long , void*)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(__IBMCPP__) && defined(BOOST_REGEX_DYN_LINK)
|
||||
//
|
||||
// Is this correct - linker complains without it ?
|
||||
//
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -100,7 +100,7 @@ BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants
|
||||
"p",
|
||||
"P",
|
||||
"N",
|
||||
"g",
|
||||
"gk",
|
||||
"K",
|
||||
"R",
|
||||
};
|
||||
|
@ -29,6 +29,10 @@
|
||||
#include <cstring>
|
||||
#include <cstdio>
|
||||
|
||||
#ifdef BOOST_INTEL
|
||||
#pragma warning(disable:981)
|
||||
#endif
|
||||
|
||||
#if defined(BOOST_NO_STDC_NAMESPACE) || defined(__NetBSD__)
|
||||
namespace std{
|
||||
# ifndef BOOST_NO_SWPRINTF
|
||||
|
Loading…
Reference in New Issue
Block a user