compilation fixes for OSX, added some boost files

metadata
Wenzel Jakob 2010-09-29 18:06:18 +02:00
parent f74e40f8cc
commit 5ee46b1f47
248 changed files with 14547 additions and 6734 deletions

View File

@ -1,16 +1,16 @@
#ifndef PLY_PLY_HPP_INCLUDED
#define PLY_PLY_HPP_INCLUDED
#include <tr1/cstdint>
#include <boost/cstdint.hpp>
namespace ply {
typedef std::tr1::int8_t int8;
typedef std::tr1::int16_t int16;
typedef std::tr1::int32_t int32;
typedef std::tr1::uint8_t uint8;
typedef std::tr1::uint16_t uint16;
typedef std::tr1::uint32_t uint32;
typedef boost::int8_t int8;
typedef boost::int16_t int16;
typedef boost::int32_t int32;
typedef boost::uint8_t uint8;
typedef boost::uint16_t uint16;
typedef boost::uint32_t uint32;
typedef float float32;
typedef double float64;

View File

@ -1,46 +0,0 @@
// Copyright David Abrahams 2006. Distributed under the Boost
// Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONCEPT_ASSERT_DWA2006430_HPP
# define BOOST_CONCEPT_ASSERT_DWA2006430_HPP
# include <boost/config.hpp>
# include <boost/detail/workaround.hpp>
// The old protocol used a constraints() member function in concept
// checking classes. If the compiler supports SFINAE, we can detect
// that function and seamlessly support the old concept checking
// classes. In this release, backward compatibility with the old
// concept checking classes is enabled by default, where available.
// The old protocol is deprecated, though, and backward compatibility
// will no longer be the default in the next release.
# if !defined(BOOST_NO_OLD_CONCEPT_SUPPORT) \
&& !defined(BOOST_NO_SFINAE) \
\
&& !(BOOST_WORKAROUND(__GNUC__, == 3) && BOOST_WORKAROUND(__GNUC_MINOR__, < 4)) \
&& !(BOOST_WORKAROUND(__GNUC__, == 2))
// Note: gcc-2.96 through 3.3.x have some SFINAE, but no ability to
// check for the presence of particularmember functions.
# define BOOST_OLD_CONCEPT_SUPPORT
# endif
# ifdef BOOST_MSVC
# include <boost/concept/detail/msvc.hpp>
# elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
# include <boost/concept/detail/borland.hpp>
# else
# include <boost/concept/detail/general.hpp>
# endif
// Usage, in class or function context:
//
// BOOST_CONCEPT_ASSERT((UnaryFunctionConcept<F,bool,int>));
//
# define BOOST_CONCEPT_ASSERT(ModelInParens) \
BOOST_CONCEPT_ASSERT_FN(void(*)ModelInParens)
#endif // BOOST_CONCEPT_ASSERT_DWA2006430_HPP

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_ACCUMULATE_HPP_INCLUDED
#define BOOST_MPL_ACCUMULATE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
// Copyright David Abrahams 2001-2002
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: accumulate.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(State)
, typename BOOST_MPL_AUX_NA_PARAM(ForwardOp)
>
struct accumulate
: fold<Sequence,State,ForwardOp>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,accumulate,(Sequence,State,ForwardOp))
};
BOOST_MPL_AUX_NA_SPEC(3, accumulate)
}}
#endif // BOOST_MPL_ACCUMULATE_HPP_INCLUDED

View File

@ -0,0 +1,21 @@
#ifndef BOOST_MPL_ALIAS_HPP_INCLUDED
#define BOOST_MPL_ALIAS_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: alias.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace {
namespace mpl = boost::mpl;
}
#endif // BOOST_MPL_ALIAS_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
#ifndef BOOST_MPL_ARITHMETIC_HPP_INCLUDED
#define BOOST_MPL_ARITHMETIC_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: arithmetic.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/plus.hpp>
#include <boost/mpl/minus.hpp>
#include <boost/mpl/times.hpp>
#include <boost/mpl/divides.hpp>
#include <boost/mpl/modulus.hpp>
#include <boost/mpl/negate.hpp>
#include <boost/mpl/multiplies.hpp> // deprecated
#endif // BOOST_MPL_ARITHMETIC_HPP_INCLUDED

View File

@ -0,0 +1,38 @@
#ifndef BOOST_MPL_AS_SEQUENCE_HPP_INCLUDED
#define BOOST_MPL_AS_SEQUENCE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2002-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: as_sequence.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/single_view.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct as_sequence
: if_< is_sequence<T>, T, single_view<T> >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,as_sequence,(T))
};
BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, as_sequence)
}}
#endif // BOOST_MPL_AS_SEQUENCE_HPP_INCLUDED

View File

@ -0,0 +1,120 @@
#ifndef BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
#define BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: joint_iter.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/aux_/lambda_spec.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
# include <boost/type_traits/is_same.hpp>
#endif
namespace boost { namespace mpl {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template<
typename Iterator1
, typename LastIterator1
, typename Iterator2
>
struct joint_iter
{
typedef Iterator1 base;
typedef forward_iterator_tag category;
};
template<
typename LastIterator1
, typename Iterator2
>
struct joint_iter<LastIterator1,LastIterator1,Iterator2>
{
typedef Iterator2 base;
typedef forward_iterator_tag category;
};
template< typename I1, typename L1, typename I2 >
struct deref< joint_iter<I1,L1,I2> >
{
typedef typename joint_iter<I1,L1,I2>::base base_;
typedef typename deref<base_>::type type;
};
template< typename I1, typename L1, typename I2 >
struct next< joint_iter<I1,L1,I2> >
{
typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > type;
};
template< typename L1, typename I2 >
struct next< joint_iter<L1,L1,I2> >
{
typedef joint_iter< L1,L1,typename mpl::next<I2>::type > type;
};
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<
typename Iterator1
, typename LastIterator1
, typename Iterator2
>
struct joint_iter;
template< bool > struct joint_iter_impl
{
template< typename I1, typename L1, typename I2 > struct result_
{
typedef I1 base;
typedef forward_iterator_tag category;
typedef joint_iter< typename mpl::next<I1>::type,L1,I2 > next;
typedef typename deref<I1>::type type;
};
};
template<> struct joint_iter_impl<true>
{
template< typename I1, typename L1, typename I2 > struct result_
{
typedef I2 base;
typedef forward_iterator_tag category;
typedef joint_iter< L1,L1,typename mpl::next<I2>::type > next;
typedef typename deref<I2>::type type;
};
};
template<
typename Iterator1
, typename LastIterator1
, typename Iterator2
>
struct joint_iter
: joint_iter_impl< is_same<Iterator1,LastIterator1>::value >
::template result_<Iterator1,LastIterator1,Iterator2>
{
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(3, joint_iter)
}}
#endif // BOOST_MPL_AUX_JOINT_ITER_HPP_INCLUDED

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_BACK_HPP_INCLUDED
#define BOOST_MPL_BACK_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/back_fwd.hpp>
#include <boost/mpl/aux_/back_impl.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct back
: back_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,back,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, back)
}}
#endif // BOOST_MPL_BACK_HPP_INCLUDED

View File

@ -0,0 +1,35 @@
#ifndef BOOST_MPL_BASE_HPP_INCLUDED
#define BOOST_MPL_BASE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: base.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct base
{
typedef typename T::base type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,base,(T))
};
BOOST_MPL_AUX_NA_SPEC(1, base)
}}
#endif // BOOST_MPL_BASE_HPP_INCLUDED

View File

@ -0,0 +1,19 @@
#ifndef BOOST_MPL_BEGIN_HPP_INCLUDED
#define BOOST_MPL_BEGIN_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: begin.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
#endif // BOOST_MPL_BEGIN_HPP_INCLUDED

View File

@ -0,0 +1,23 @@
#ifndef BOOST_MPL_BITAND_HPP_INCLUDED
#define BOOST_MPL_BITAND_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitand.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME bitand_
#define AUX778076_OP_PREFIX bitand
#define AUX778076_OP_TOKEN &
#include <boost/mpl/aux_/arithmetic_op.hpp>
#endif // BOOST_MPL_BITAND_HPP_INCLUDED

View File

@ -0,0 +1,23 @@
#ifndef BOOST_MPL_BITOR_HPP_INCLUDED
#define BOOST_MPL_BITOR_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME bitor_
#define AUX778076_OP_PREFIX bitor
#define AUX778076_OP_TOKEN |
#include <boost/mpl/aux_/arithmetic_op.hpp>
#endif // BOOST_MPL_BITOR_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
#ifndef BOOST_MPL_BITWISE_HPP_INCLUDED
#define BOOST_MPL_BITWISE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitwise.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bitand.hpp>
#include <boost/mpl/bitor.hpp>
#include <boost/mpl/bitxor.hpp>
#include <boost/mpl/shift_left.hpp>
#include <boost/mpl/shift_right.hpp>
#endif // BOOST_MPL_BITWISE_HPP_INCLUDED

View File

@ -0,0 +1,23 @@
#ifndef BOOST_MPL_BITXOR_HPP_INCLUDED
#define BOOST_MPL_BITXOR_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitxor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME bitxor_
#define AUX778076_OP_PREFIX bitxor
#define AUX778076_OP_TOKEN ^
#include <boost/mpl/aux_/arithmetic_op.hpp>
#endif // BOOST_MPL_BITXOR_HPP_INCLUDED

View File

@ -0,0 +1,58 @@
#ifndef BOOST_MPL_COPY_HPP_INCLUDED
#define BOOST_MPL_COPY_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: copy.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Sequence
, typename Inserter
>
struct copy_impl
: fold<
Sequence
, typename Inserter::state
, typename Inserter::operation
>
{
};
template<
typename Sequence
, typename Inserter
>
struct reverse_copy_impl
: reverse_fold<
Sequence
, typename Inserter::state
, typename Inserter::operation
>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(2, copy)
}}
#endif // BOOST_MPL_COPY_HPP_INCLUDED

View File

@ -0,0 +1,96 @@
#ifndef BOOST_MPL_COPY_IF_HPP_INCLUDED
#define BOOST_MPL_COPY_IF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: copy_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/protect.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
#include <boost/mpl/aux_/config/forwarding.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Operation
, typename Predicate
>
struct copy_if_op
{
template< typename Sequence, typename T > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: eval_if<
typename apply1<Predicate,T>::type
, apply2<Operation,Sequence,T>
, identity<Sequence>
>
{
#else
{
typedef typename eval_if<
typename apply1<Predicate,T>::type
, apply2<Operation,Sequence,T>
, identity<Sequence>
>::type type;
#endif
};
};
template<
typename Sequence
, typename Predicate
, typename Inserter
>
struct copy_if_impl
: fold<
Sequence
, typename Inserter::state
, protect< aux::copy_if_op<
typename Inserter::operation
, Predicate
> >
>
{
};
template<
typename Sequence
, typename Predicate
, typename Inserter
>
struct reverse_copy_if_impl
: reverse_fold<
Sequence
, typename Inserter::state
, protect< aux::copy_if_op<
typename Inserter::operation
, Predicate
> >
>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, copy_if)
}}
#endif // BOOST_MPL_COPY_IF_HPP_INCLUDED

View File

@ -0,0 +1,40 @@
#ifndef BOOST_MPL_COUNT_HPP_INCLUDED
#define BOOST_MPL_COUNT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/count_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/count_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct count
: count_impl< typename sequence_tag<Sequence>::type >
::template apply<Sequence,T>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,count,(Sequence,T))
};
BOOST_MPL_AUX_NA_SPEC(2, count)
}}
#endif // BOOST_MPL_COUNT_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
#ifndef BOOST_MPL_COUNT_FWD_HPP_INCLUDED
#define BOOST_MPL_COUNT_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct count_impl;
template< typename Sequence, typename T > struct count;
}}
#endif // BOOST_MPL_COUNT_FWD_HPP_INCLUDED

View File

@ -0,0 +1,79 @@
#ifndef BOOST_MPL_COUNT_IF_HPP_INCLUDED
#define BOOST_MPL_COUNT_IF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2002
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: count_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/aux_/msvc_eti_base.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/config/forwarding.hpp>
namespace boost { namespace mpl {
namespace aux {
template< typename Predicate >
struct next_if
{
template<
typename N
, typename T
>
struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: eval_if<
typename apply1<Predicate,T>::type
, next<N>
, identity<N>
>
{
#else
{
typedef typename eval_if<
typename apply1<Predicate,T>::type
, next<N>
, identity<N>
>::type type;
#endif
};
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Predicate)
>
struct count_if
: aux::msvc_eti_base< typename fold<
Sequence
, integral_c<unsigned long,0>
, protect< aux::next_if<Predicate> >
>::type >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,count_if,(Sequence,Predicate))
};
BOOST_MPL_AUX_NA_SPEC(2, count_if)
}}
#endif // BOOST_MPL_COUNT_IF_HPP_INCLUDED

View File

@ -0,0 +1,58 @@
#ifndef BOOST_MPL_DEQUE_HPP_INCLUDED
#define BOOST_MPL_DEQUE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: deque.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/vector.hpp>
# include <boost/mpl/aux_/na.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_DEQUE_HEADER \
BOOST_PP_CAT(vector, BOOST_MPL_LIMIT_VECTOR_SIZE).hpp \
/**/
#else
# define AUX778076_DEQUE_HEADER \
BOOST_PP_CAT(vector, BOOST_MPL_LIMIT_VECTOR_SIZE)##.hpp \
/**/
#endif
# include BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_DEQUE_HEADER)
# undef AUX778076_DEQUE_HEADER
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER deque.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/vector.hpp>
# define AUX778076_SEQUENCE_NAME deque
# define AUX778076_SEQUENCE_BASE_NAME vector
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_VECTOR_SIZE
# include <boost/mpl/aux_/sequence_wrapper.hpp>
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_DEQUE_HPP_INCLUDED

View File

@ -0,0 +1,21 @@
#ifndef BOOST_MPL_DIVIDES_HPP_INCLUDED
#define BOOST_MPL_DIVIDES_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: divides.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME divides
#define AUX778076_OP_TOKEN /
#include <boost/mpl/aux_/arithmetic_op.hpp>
#endif // BOOST_MPL_DIVIDES_HPP_INCLUDED

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_EMPTY_HPP_INCLUDED
#define BOOST_MPL_EMPTY_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/empty_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/empty_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct empty
: empty_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,empty,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, empty)
}}
#endif // BOOST_MPL_EMPTY_HPP_INCLUDED

View File

@ -0,0 +1,59 @@
#ifndef BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
#define BOOST_MPL_EMPTY_BASE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_base.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#include <boost/type_traits/is_empty.hpp>
// should be always the last #include directive
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost { namespace mpl {
// empty base class, guaranteed to have no members; inheritance from
// 'empty_base' through the 'inherit' metafunction is a no-op - see
// "mpl/inherit.hpp> header for the details
struct empty_base {};
template< typename T >
struct is_empty_base
: false_
{
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using false_::value;
#endif
};
template<>
struct is_empty_base<empty_base>
: true_
{
#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
using true_::value;
#endif
};
}}
namespace boost {
BOOST_TT_AUX_BOOL_TRAIT_SPEC1(is_empty, mpl::empty_base, true)
}
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_MPL_EMPTY_BASE_HPP_INCLUDED

View File

@ -0,0 +1,42 @@
#ifndef BOOST_MPL_EMPTY_SEQUENCE_HPP_INCLUDED
#define BOOST_MPL_EMPTY_SEQUENCE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2004
// Copyright Alexander Nasonov 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: empty_sequence.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_fwd.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/iterator_tags.hpp>
namespace boost { namespace mpl {
struct empty_sequence
{
struct tag;
struct begin { typedef random_access_iterator_tag category; };
typedef begin end;
};
template<>
struct size_impl<empty_sequence::tag>
{
template< typename Sequence > struct apply
: int_<0>
{
};
};
}}
#endif // #ifndef BOOST_MPL_EMPTY_SEQUENCE_HPP_INCLUDED

View File

@ -0,0 +1,19 @@
#ifndef BOOST_MPL_END_HPP_INCLUDED
#define BOOST_MPL_END_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
#endif // BOOST_MPL_END_HPP_INCLUDED

View File

@ -0,0 +1,112 @@
#ifndef BOOST_MPL_EQUAL_HPP_INCLUDED
#define BOOST_MPL_EQUAL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/iter_fold_if_impl.hpp>
#include <boost/mpl/aux_/iter_apply.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/always.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/void.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/msvc_eti_base.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Predicate
, typename LastIterator1
, typename LastIterator2
>
struct equal_pred
{
template<
typename Iterator2
, typename Iterator1
>
struct apply
{
typedef typename and_<
not_< is_same<Iterator1,LastIterator1> >
, not_< is_same<Iterator2,LastIterator2> >
, aux::iter_apply2<Predicate,Iterator1,Iterator2>
>::type type;
};
};
template<
typename Sequence1
, typename Sequence2
, typename Predicate
>
struct equal_impl
{
typedef typename begin<Sequence1>::type first1_;
typedef typename begin<Sequence2>::type first2_;
typedef typename end<Sequence1>::type last1_;
typedef typename end<Sequence2>::type last2_;
typedef aux::iter_fold_if_impl<
first1_
, first2_
, next<>
, protect< aux::equal_pred<Predicate,last1_,last2_> >
, void_
, always<false_>
> fold_;
typedef typename fold_::iterator iter1_;
typedef typename fold_::state iter2_;
typedef and_<
is_same<iter1_,last1_>
, is_same<iter2_,last2_>
> result_;
typedef typename result_::type type;
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence1)
, typename BOOST_MPL_AUX_NA_PARAM(Sequence2)
, typename Predicate = is_same<_,_>
>
struct equal
: aux::msvc_eti_base<
typename aux::equal_impl<Sequence1,Sequence2,Predicate>::type
>::type
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,equal,(Sequence1,Sequence2))
};
BOOST_MPL_AUX_NA_SPEC(2, equal)
}}
#endif // BOOST_MPL_EQUAL_HPP_INCLUDED

View File

@ -0,0 +1,42 @@
#ifndef BOOST_MPL_ERASE_HPP_INCLUDED
#define BOOST_MPL_ERASE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/erase_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/config/msvc_typename.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(First)
, typename BOOST_MPL_AUX_NA_PARAM(Last)
>
struct erase
: erase_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence,First,Last >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,erase,(Sequence,First,Last))
};
BOOST_MPL_AUX_NA_SPEC(3,erase)
}}
#endif // BOOST_MPL_ERASE_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
#ifndef BOOST_MPL_ERASE_FWD_HPP_INCLUDED
#define BOOST_MPL_ERASE_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct erase_impl;
template< typename Sequence, typename First, typename Last > struct erase;
}}
#endif // BOOST_MPL_ERASE_FWD_HPP_INCLUDED

View File

@ -0,0 +1,41 @@
#ifndef BOOST_MPL_ERASE_KEY_HPP_INCLUDED
#define BOOST_MPL_ERASE_KEY_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/erase_key_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/erase_key_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/config/msvc_typename.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Key)
>
struct erase_key
: erase_key_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence,Key >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,erase_key,(Sequence,Key))
};
BOOST_MPL_AUX_NA_SPEC(2,erase_key)
}}
#endif // BOOST_MPL_ERASE_KEY_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
#ifndef BOOST_MPL_ERASE_KEY_FWD_HPP_INCLUDED
#define BOOST_MPL_ERASE_KEY_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: erase_key_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct erase_key_impl;
template< typename Sequence, typename Key > struct erase_key;
}}
#endif // BOOST_MPL_ERASE_KEY_FWD_HPP_INCLUDED

View File

@ -0,0 +1,46 @@
#ifndef BOOST_MPL_FILTER_VIEW_HPP_INCLUDED
#define BOOST_MPL_FILTER_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: filter_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/aux_/filter_iter.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Predicate)
>
struct filter_view
{
private:
typedef typename lambda<Predicate>::type pred_;
typedef typename begin<Sequence>::type first_;
typedef typename end<Sequence>::type last_;
public:
struct tag;
typedef filter_view type;
typedef typename aux::next_filter_iter< first_,last_,pred_ >::type begin;
typedef aux::filter_iter< last_,last_,pred_ > end;
};
BOOST_MPL_AUX_NA_SPEC(2, filter_view)
}}
#endif // BOOST_MPL_FILTER_VIEW_HPP_INCLUDED

View File

@ -0,0 +1,116 @@
#ifndef BOOST_MPL_FOR_EACH_HPP_INCLUDED
#define BOOST_MPL_FOR_EACH_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2008
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: for_each.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/mpl/aux_/unwrap.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/utility/value_init.hpp>
namespace boost { namespace mpl {
namespace aux {
template< bool done = true >
struct for_each_impl
{
template<
typename Iterator
, typename LastIterator
, typename TransformFunc
, typename F
>
static void execute(
Iterator*
, LastIterator*
, TransformFunc*
, F
)
{
}
};
template<>
struct for_each_impl<false>
{
template<
typename Iterator
, typename LastIterator
, typename TransformFunc
, typename F
>
static void execute(
Iterator*
, LastIterator*
, TransformFunc*
, F f
)
{
typedef typename deref<Iterator>::type item;
typedef typename apply1<TransformFunc,item>::type arg;
// dwa 2002/9/10 -- make sure not to invoke undefined behavior
// when we pass arg.
value_initialized<arg> x;
aux::unwrap(f, 0)(boost::get(x));
typedef typename mpl::next<Iterator>::type iter;
for_each_impl<boost::is_same<iter,LastIterator>::value>
::execute((iter*)0, (LastIterator*)0, (TransformFunc*)0, f);
}
};
} // namespace aux
// agurt, 17/mar/02: pointer default parameters are necessary to workaround
// MSVC 6.5 function template signature's mangling bug
template<
typename Sequence
, typename TransformOp
, typename F
>
inline
void for_each(F f, Sequence* = 0, TransformOp* = 0)
{
BOOST_MPL_ASSERT(( is_sequence<Sequence> ));
typedef typename begin<Sequence>::type first;
typedef typename end<Sequence>::type last;
aux::for_each_impl< boost::is_same<first,last>::value >
::execute((first*)0, (last*)0, (TransformOp*)0, f);
}
template<
typename Sequence
, typename F
>
inline
void for_each(F f, Sequence* = 0)
{
for_each<Sequence, identity<> >(f);
}
}}
#endif // BOOST_MPL_FOR_EACH_HPP_INCLUDED

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_FRONT_HPP_INCLUDED
#define BOOST_MPL_FRONT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/front_fwd.hpp>
#include <boost/mpl/aux_/front_impl.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct front
: front_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,front,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, front)
}}
#endif // BOOST_MPL_FRONT_HPP_INCLUDED

View File

@ -0,0 +1,41 @@
#ifndef BOOST_MPL_HAS_KEY_HPP_INCLUDED
#define BOOST_MPL_HAS_KEY_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/has_key_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/has_key_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(AssociativeSequence)
, typename BOOST_MPL_AUX_NA_PARAM(Key)
>
struct has_key
: has_key_impl< typename sequence_tag<AssociativeSequence>::type >
::template apply<AssociativeSequence,Key>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,has_key,(AssociativeSequence,Key))
};
BOOST_MPL_AUX_NA_SPEC(2, has_key)
}}
#endif // BOOST_MPL_HAS_KEY_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
#ifndef BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
#define BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_key_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct has_key_impl;
template< typename AssociativeSequence, typename Key > struct has_key;
}}
#endif // BOOST_MPL_HAS_KEY_FWD_HPP_INCLUDED

View File

@ -0,0 +1,60 @@
#ifndef BOOST_MPL_INDEX_IF_HPP_INCLUDED
#define BOOST_MPL_INDEX_IF_HPP_INCLUDED
// Copyright Eric Friedman 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: index_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/find_if_pred.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/iter_fold_if.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/void.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/type_traits/is_same.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Predicate)
>
struct index_if
{
typedef typename iter_fold_if<
Sequence
, int_<0>
, next<>
, aux::find_if_pred<Predicate>
>::type result_;
typedef typename end<Sequence>::type not_found_;
typedef typename first<result_>::type result_index_;
typedef typename second<result_>::type result_iterator_;
typedef typename if_<
is_same< result_iterator_,not_found_ >
, void_
, result_index_
>::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,index_if,(Sequence,Predicate))
};
BOOST_MPL_AUX_NA_SPEC(2, index_if)
}}
#endif // BOOST_MPL_INDEX_IF_HPP_INCLUDED

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_INDEX_OF_HPP_INCLUDED
#define BOOST_MPL_INDEX_OF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Eric Friedman 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: index_of.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/index_if.hpp>
#include <boost/mpl/same_as.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct index_of
: index_if< Sequence,same_as<T> >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,index_of,(Sequence,T))
};
BOOST_MPL_AUX_NA_SPEC(2, index_of)
}}
#endif // BOOST_MPL_INDEX_OF_HPP_INCLUDED

View File

@ -0,0 +1,229 @@
#if !defined(BOOST_PP_IS_ITERATING)
///// header body
#ifndef BOOST_MPL_INHERIT_HPP_INCLUDED
#define BOOST_MPL_INHERIT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: inherit.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/empty_base.hpp>
# include <boost/mpl/aux_/na_spec.hpp>
# include <boost/mpl/aux_/lambda_support.hpp>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER inherit.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/arity.hpp>
# include <boost/mpl/aux_/preprocessor/params.hpp>
# include <boost/mpl/aux_/preprocessor/default_params.hpp>
# include <boost/mpl/aux_/preprocessor/enum.hpp>
# include <boost/mpl/aux_/config/ctps.hpp>
# include <boost/mpl/aux_/config/dtp.hpp>
# include <boost/preprocessor/iterate.hpp>
# include <boost/preprocessor/dec.hpp>
# include <boost/preprocessor/cat.hpp>
namespace boost { namespace mpl {
// 'inherit<T1,T2,..,Tn>' metafunction; returns an unspecified class type
// produced by public derivation from all metafunction's parameters
// (T1,T2,..,Tn), except the parameters of 'empty_base' class type;
// regardless the position and number of 'empty_base' parameters in the
// metafunction's argument list, derivation from them is always a no-op;
// for instance:
// inherit<her>::type == her
// inherit<her,my>::type == struct unspecified : her, my {};
// inherit<empty_base,her>::type == her
// inherit<empty_base,her,empty_base,empty_base>::type == her
// inherit<her,empty_base,my>::type == struct unspecified : her, my {};
// inherit<empty_base,empty_base>::type == empty_base
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template<
typename BOOST_MPL_AUX_NA_PARAM(T1)
, typename BOOST_MPL_AUX_NA_PARAM(T2)
>
struct inherit2
: T1, T2
{
typedef inherit2 type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, inherit2, (T1,T2))
};
template< typename T1 >
struct inherit2<T1,empty_base>
{
typedef T1 type;
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (T1,empty_base))
};
template< typename T2 >
struct inherit2<empty_base,T2>
{
typedef T2 type;
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (empty_base,T2))
};
// needed to disambiguate the previous two in case when both
// T1 and T2 == empty_base
template<>
struct inherit2<empty_base,empty_base>
{
typedef empty_base type;
BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2, inherit2, (empty_base,empty_base))
};
#else
namespace aux {
template< bool C1, bool C2 >
struct inherit2_impl
{
template< typename Derived, typename T1, typename T2 > struct result_
: T1, T2
{
typedef Derived type_;
};
};
template<>
struct inherit2_impl<false,true>
{
template< typename Derived, typename T1, typename T2 > struct result_
: T1
{
typedef T1 type_;
};
};
template<>
struct inherit2_impl<true,false>
{
template< typename Derived, typename T1, typename T2 > struct result_
: T2
{
typedef T2 type_;
};
};
template<>
struct inherit2_impl<true,true>
{
template< typename Derived, typename T1, typename T2 > struct result_
{
typedef T1 type_;
};
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(T1)
, typename BOOST_MPL_AUX_NA_PARAM(T2)
>
struct inherit2
: aux::inherit2_impl<
is_empty_base<T1>::value
, is_empty_base<T2>::value
>::template result_< inherit2<T1,T2>,T1,T2 >
{
typedef typename inherit2::type_ type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(2, inherit2, (T1,T2))
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_MPL_AUX_NA_SPEC(2, inherit2)
#define BOOST_PP_ITERATION_PARAMS_1 \
(3,(3, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/inherit.hpp>))
#include BOOST_PP_ITERATE()
}}
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_INHERIT_HPP_INCLUDED
///// iteration
#else
#define n_ BOOST_PP_FRAME_ITERATION(1)
template<
BOOST_MPL_PP_DEFAULT_PARAMS(n_, typename T, na)
>
struct BOOST_PP_CAT(inherit,n_)
: inherit2<
typename BOOST_PP_CAT(inherit,BOOST_PP_DEC(n_))<
BOOST_MPL_PP_PARAMS(BOOST_PP_DEC(n_), T)
>::type
, BOOST_PP_CAT(T,n_)
>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
n_
, BOOST_PP_CAT(inherit,n_)
, (BOOST_MPL_PP_PARAMS(n_, T))
)
};
BOOST_MPL_AUX_NA_SPEC(n_, BOOST_PP_CAT(inherit,n_))
#if n_ == BOOST_MPL_LIMIT_METAFUNCTION_ARITY
/// primary template
template<
BOOST_MPL_PP_DEFAULT_PARAMS(n_, typename T, empty_base)
>
struct inherit
: BOOST_PP_CAT(inherit,n_)<BOOST_MPL_PP_PARAMS(n_, T)>
{
};
// 'na' specialization
template<>
struct inherit< BOOST_MPL_PP_ENUM(5, na) >
{
template<
#if !defined(BOOST_MPL_CFG_NO_DEFAULT_PARAMETERS_IN_NESTED_TEMPLATES)
BOOST_MPL_PP_DEFAULT_PARAMS(n_, typename T, empty_base)
#else
BOOST_MPL_PP_PARAMS(n_, typename T)
#endif
>
struct apply
: inherit< BOOST_MPL_PP_PARAMS(n_, T) >
{
};
};
BOOST_MPL_AUX_NA_SPEC_LAMBDA(n_, inherit)
BOOST_MPL_AUX_NA_SPEC_ARITY(n_, inherit)
BOOST_MPL_AUX_NA_SPEC_TEMPLATE_ARITY(n_, n_, inherit)
#endif
#undef n_
#endif // BOOST_PP_IS_ITERATING

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_INHERIT_FRONT_TO_BACK_HPP_INCLUDED
#define BOOST_MPL_INHERIT_FRONT_TO_BACK_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: inherit_linearly.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/empty_base.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Types_)
, typename BOOST_MPL_AUX_NA_PARAM(Node_)
, typename Root_ = empty_base
>
struct inherit_linearly
: fold<Types_,Root_,Node_>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,inherit_linearly,(Types_,Node_,Root_))
};
BOOST_MPL_AUX_NA_SPEC(2, inherit_linearly)
}}
#endif // BOOST_MPL_INHERIT_FRONT_TO_BACK_HPP_INCLUDED

View File

@ -0,0 +1,41 @@
#ifndef BOOST_MPL_INSERT_HPP_INCLUDED
#define BOOST_MPL_INSERT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/insert_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/insert_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Pos_or_T)
, typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct insert
: insert_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence,Pos_or_T,T >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,insert,(Sequence,Pos_or_T,T))
};
BOOST_MPL_AUX_NA_SPEC(3, insert)
}}
#endif // BOOST_MPL_INSERT_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
#ifndef BOOST_MPL_INSERT_FWD_HPP_INCLUDED
#define BOOST_MPL_INSERT_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct insert_impl;
template< typename Sequence, typename Pos_or_T, typename T > struct insert;
}}
#endif // BOOST_MPL_INSERT_FWD_HPP_INCLUDED

View File

@ -0,0 +1,41 @@
#ifndef BOOST_MPL_INSERT_RANGE_HPP_INCLUDED
#define BOOST_MPL_INSERT_RANGE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_range.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/insert_range_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/insert_range_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Pos)
, typename BOOST_MPL_AUX_NA_PARAM(Range)
>
struct insert_range
: insert_range_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence,Pos,Range >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(3,insert_range,(Sequence,Pos,Range))
};
BOOST_MPL_AUX_NA_SPEC(3, insert_range)
}}
#endif // BOOST_MPL_INSERT_RANGE_HPP_INCLUDED

View File

@ -0,0 +1,24 @@
#ifndef BOOST_MPL_INSERT_RANGE_FWD_HPP_INCLUDED
#define BOOST_MPL_INSERT_RANGE_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: insert_range_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct insert_range_impl;
template< typename Sequence, typename Pos, typename Range > struct insert_range;
}}
#endif // BOOST_MPL_INSERT_RANGE_FWD_HPP_INCLUDED

View File

@ -0,0 +1,67 @@
#ifndef BOOST_MPL_IS_PLACEHOLDER_HPP_INCLUDED
#define BOOST_MPL_IS_PLACEHOLDER_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: is_placeholder.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/arg_fwd.hpp>
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/yes_no.hpp>
#include <boost/mpl/aux_/type_wrapper.hpp>
#include <boost/mpl/aux_/nttp_decl.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
namespace boost { namespace mpl {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template< typename T >
struct is_placeholder
: bool_<false>
{
};
template< BOOST_MPL_AUX_NTTP_DECL(int, N) >
struct is_placeholder< arg<N> >
: bool_<true>
{
};
#else
namespace aux {
aux::no_tag is_placeholder_helper(...);
template< BOOST_MPL_AUX_NTTP_DECL(int, N) >
aux::yes_tag is_placeholder_helper(aux::type_wrapper< arg<N> >*);
} // namespace aux
template< typename T >
struct is_placeholder
{
static aux::type_wrapper<T>* get();
BOOST_STATIC_CONSTANT(bool, value =
sizeof(aux::is_placeholder_helper(get())) == sizeof(aux::yes_tag)
);
typedef bool_<value> type;
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
}}
#endif // BOOST_MPL_IS_PLACEHOLDER_HPP_INCLUDED

View File

@ -0,0 +1,35 @@
#ifndef BOOST_MPL_ITERATOR_CATEGORY_HPP_INCLUDED
#define BOOST_MPL_ITERATOR_CATEGORY_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: iterator_category.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Iterator)
>
struct iterator_category
{
typedef typename Iterator::category type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,iterator_category,(Iterator))
};
BOOST_MPL_AUX_NA_SPEC(1, iterator_category)
}}
#endif // BOOST_MPL_ITERATOR_CATEGORY_HPP_INCLUDED

View File

@ -0,0 +1,65 @@
#ifndef BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
#define BOOST_MPL_JOINT_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: joint_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/joint_iter.hpp>
#include <boost/mpl/plus.hpp>
#include <boost/mpl/size_fwd.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
namespace aux {
struct joint_view_tag;
}
template<>
struct size_impl< aux::joint_view_tag >
{
template < typename JointView > struct apply
: plus<
size<typename JointView::sequence1_>
, size<typename JointView::sequence2_>
>
{};
};
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence1_)
, typename BOOST_MPL_AUX_NA_PARAM(Sequence2_)
>
struct joint_view
{
typedef typename mpl::begin<Sequence1_>::type first1_;
typedef typename mpl::end<Sequence1_>::type last1_;
typedef typename mpl::begin<Sequence2_>::type first2_;
typedef typename mpl::end<Sequence2_>::type last2_;
// agurt, 25/may/03: for the 'size_traits' implementation above
typedef Sequence1_ sequence1_;
typedef Sequence2_ sequence2_;
typedef joint_view type;
typedef aux::joint_view_tag tag;
typedef joint_iter<first1_,last1_,first2_> begin;
typedef joint_iter<last1_,last1_,last2_> end;
};
BOOST_MPL_AUX_NA_SPEC(2, joint_view)
}}
#endif // BOOST_MPL_JOINT_VIEW_HPP_INCLUDED

View File

@ -0,0 +1,42 @@
#ifndef BOOST_MPL_KEY_TYPE_HPP_INCLUDED
#define BOOST_MPL_KEY_TYPE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: key_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/key_type_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(AssociativeSequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct key_type
: apply_wrap2<
key_type_impl< typename sequence_tag<AssociativeSequence>::type >
, AssociativeSequence, T>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,key_type,(AssociativeSequence,T))
};
BOOST_MPL_AUX_NA_SPEC(2, key_type)
}}
#endif // BOOST_MPL_KEY_TYPE_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
#ifndef BOOST_MPL_KEY_TYPE_FWD_HPP_INCLUDED
#define BOOST_MPL_KEY_TYPE_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: key_type_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct key_type_impl;
template< typename AssociativeSequence, typename T > struct key_type;
}}
#endif // BOOST_MPL_KEY_TYPE_FWD_HPP_INCLUDED

View File

@ -0,0 +1,60 @@
#ifndef BOOST_MPL_LIST_C_HPP_INCLUDED
#define BOOST_MPL_LIST_C_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: list_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/list.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_LIST_C_HEADER \
BOOST_PP_CAT(BOOST_PP_CAT(list,BOOST_MPL_LIMIT_LIST_SIZE),_c).hpp \
/**/
#else
# define AUX778076_LIST_C_HEADER \
BOOST_PP_CAT(BOOST_PP_CAT(list,BOOST_MPL_LIMIT_LIST_SIZE),_c)##.hpp \
/**/
#endif
# include BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_C_HEADER)
# undef AUX778076_LIST_C_HEADER
# include <climits>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER list_c.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/list.hpp>
# define AUX778076_SEQUENCE_NAME list_c
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_LIST_SIZE
# define AUX778076_SEQUENCE_NAME_N(n) BOOST_PP_CAT(BOOST_PP_CAT(list,n),_c)
# define AUX778076_SEQUENCE_INTEGRAL_WRAPPER
# include <boost/mpl/aux_/sequence_wrapper.hpp>
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_LIST_C_HPP_INCLUDED

View File

@ -0,0 +1,143 @@
#ifndef BOOST_MPL_LOWER_BOUND_HPP_INCLUDED
#define BOOST_MPL_LOWER_BOUND_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: lower_bound.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
# define BOOST_MPL_CFG_STRIPPED_DOWN_LOWER_BOUND_IMPL
#endif
#if !defined(BOOST_MPL_CFG_STRIPPED_DOWN_LOWER_BOUND_IMPL)
# include <boost/mpl/minus.hpp>
# include <boost/mpl/divides.hpp>
# include <boost/mpl/size.hpp>
# include <boost/mpl/advance.hpp>
# include <boost/mpl/begin_end.hpp>
# include <boost/mpl/long.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/prior.hpp>
# include <boost/mpl/deref.hpp>
# include <boost/mpl/apply.hpp>
# include <boost/mpl/aux_/value_wknd.hpp>
#else
# include <boost/mpl/not.hpp>
# include <boost/mpl/find.hpp>
# include <boost/mpl/bind.hpp>
#endif
#include <boost/config.hpp>
namespace boost { namespace mpl {
#if defined(BOOST_MPL_CFG_STRIPPED_DOWN_LOWER_BOUND_IMPL)
// agurt 23/oct/02: has a wrong complexity etc., but at least it works
// feel free to contribute a better implementation!
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
, typename Predicate = less<>
, typename pred_ = typename lambda<Predicate>::type
>
struct lower_bound
: find_if< Sequence, bind1< not_<>, bind2<pred_,_,T> > >
{
};
#else
namespace aux {
template<
typename Distance
, typename Predicate
, typename T
, typename DeferredIterator
>
struct lower_bound_step_impl;
template<
typename Distance
, typename Predicate
, typename T
, typename DeferredIterator
>
struct lower_bound_step
{
typedef typename eval_if<
Distance
, lower_bound_step_impl<Distance,Predicate,T,DeferredIterator>
, DeferredIterator
>::type type;
};
template<
typename Distance
, typename Predicate
, typename T
, typename DeferredIterator
>
struct lower_bound_step_impl
{
typedef typename divides< Distance, long_<2> >::type offset_;
typedef typename DeferredIterator::type iter_;
typedef typename advance< iter_,offset_ >::type middle_;
typedef typename apply2<
Predicate
, typename deref<middle_>::type
, T
>::type cond_;
typedef typename prior< minus< Distance, offset_> >::type step_;
typedef lower_bound_step< offset_,Predicate,T,DeferredIterator > step_forward_;
typedef lower_bound_step< step_,Predicate,T,next<middle_> > step_backward_;
typedef typename eval_if<
cond_
, step_backward_
, step_forward_
>::type type;
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
, typename Predicate = less<>
>
struct lower_bound
{
private:
typedef typename lambda<Predicate>::type pred_;
typedef typename size<Sequence>::type size_;
public:
typedef typename aux::lower_bound_step<
size_,pred_,T,begin<Sequence>
>::type type;
};
#endif // BOOST_MPL_CFG_STRIPPED_DOWN_LOWER_BOUND_IMPL
BOOST_MPL_AUX_NA_SPEC(2, lower_bound)
}}
#endif // BOOST_MPL_LOWER_BOUND_HPP_INCLUDED

View File

@ -0,0 +1,57 @@
#ifndef BOOST_MPL_MAP_HPP_INCLUDED
#define BOOST_MPL_MAP_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: map.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/map.hpp>
# include <boost/mpl/aux_/na.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_MAP_HEADER \
BOOST_PP_CAT(map, BOOST_MPL_LIMIT_MAP_SIZE).hpp \
/**/
#else
# define AUX778076_MAP_HEADER \
BOOST_PP_CAT(map, BOOST_MPL_LIMIT_MAP_SIZE)##.hpp \
/**/
#endif
# include BOOST_PP_STRINGIZE(boost/mpl/map/AUX778076_MAP_HEADER)
# undef AUX778076_MAP_HEADER
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER map.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/map.hpp>
# define AUX778076_SEQUENCE_NAME map
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_MAP_SIZE
# include <boost/mpl/aux_/sequence_wrapper.hpp>
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_MAP_HPP_INCLUDED

View File

@ -0,0 +1,19 @@
#ifndef BOOST_MPL_MAX_HPP_INCLUDED
#define BOOST_MPL_MAX_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: max.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/min_max.hpp>
#endif // BOOST_MPL_MAX_HPP_INCLUDED

View File

@ -0,0 +1,72 @@
#ifndef BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
#define BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: max_element.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
#include <boost/mpl/iter_fold.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/aux_/common_name_wknd.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
BOOST_MPL_AUX_COMMON_NAME_WKND(max_element)
namespace aux {
template< typename Predicate >
struct select_max
{
template< typename OldIterator, typename Iterator >
struct apply
{
typedef typename apply2<
Predicate
, typename deref<OldIterator>::type
, typename deref<Iterator>::type
>::type condition_;
typedef typename if_<
condition_
, Iterator
, OldIterator
>::type type;
};
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename Predicate = less<_,_>
>
struct max_element
: iter_fold<
Sequence
, typename begin<Sequence>::type
, protect< aux::select_max<Predicate> >
>
{
};
BOOST_MPL_AUX_NA_SPEC(1, max_element)
}}
#endif // BOOST_MPL_MAX_ELEMENT_HPP_INCLUDED

View File

@ -0,0 +1,19 @@
#ifndef BOOST_MPL_MIN_HPP_INCLUDED
#define BOOST_MPL_MIN_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: min.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/min_max.hpp>
#endif // BOOST_MPL_MIN_HPP_INCLUDED

View File

@ -0,0 +1,40 @@
#ifndef BOOST_MPL_MIN_ELEMENT_HPP_INCLUDED
#define BOOST_MPL_MIN_ELEMENT_HPP_INCLUDED
// Copyright David Abrahams 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: min_element.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/max_element.hpp>
#include <boost/mpl/not.hpp>
namespace boost { namespace mpl {
BOOST_MPL_AUX_COMMON_NAME_WKND(min_element)
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename Predicate = less<_,_>
>
struct min_element
: max_element<
Sequence
, mpl::not_<Predicate>
>
{
};
BOOST_MPL_AUX_NA_SPEC(1, min_element)
}}
#endif // BOOST_MPL_MIN_ELEMENT_HPP_INCLUDED

View File

@ -0,0 +1,46 @@
#ifndef BOOST_MPL_MIN_MAX_HPP_INCLUDED
#define BOOST_MPL_MIN_MAX_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2008
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: min_max.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct min
: if_< less<N1,N2>,N1,N2 >
{
};
template<
typename BOOST_MPL_AUX_NA_PARAM(N1)
, typename BOOST_MPL_AUX_NA_PARAM(N2)
>
struct max
: if_< less<N1,N2>,N2,N1 >
{
};
BOOST_MPL_AUX_NA_SPEC(2, min)
BOOST_MPL_AUX_NA_SPEC(2, max)
}}
#endif // BOOST_MPL_MIN_MAX_HPP_INCLUDED

View File

@ -0,0 +1,22 @@
#ifndef BOOST_MPL_MODULUS_HPP_INCLUDED
#define BOOST_MPL_MODULUS_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: modulus.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME modulus
#define AUX778076_OP_TOKEN %
#define AUX778076_OP_ARITY 2
#include <boost/mpl/aux_/arithmetic_op.hpp>
#endif // BOOST_MPL_MODULUS_HPP_INCLUDED

View File

@ -0,0 +1,53 @@
#ifndef BOOST_MPL_MULTIPLIES_HPP_INCLUDED
#define BOOST_MPL_MULTIPLIES_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: multiplies.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/times.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
#include <boost/mpl/aux_/preprocessor/default_params.hpp>
#include <boost/mpl/aux_/preprocessor/params.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
// backward compatibility header, deprecated
namespace boost { namespace mpl {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
# define AUX778076_OP_ARITY BOOST_MPL_LIMIT_METAFUNCTION_ARITY
#else
# define AUX778076_OP_ARITY 2
#endif
template<
BOOST_MPL_PP_DEFAULT_PARAMS(AUX778076_OP_ARITY, typename N, na)
>
struct multiplies
: times< BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(
AUX778076_OP_ARITY
, multiplies
, ( BOOST_MPL_PP_PARAMS(AUX778076_OP_ARITY, N) )
)
};
BOOST_MPL_AUX_NA_SPEC(AUX778076_OP_ARITY, multiplies)
#undef AUX778076_OP_ARITY
}}
#endif // BOOST_MPL_MULTIPLIES_HPP_INCLUDED

View File

@ -0,0 +1,41 @@
#ifndef BOOST_MPL_ORDER_HPP_INCLUDED
#define BOOST_MPL_ORDER_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: order.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/order_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/order_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(AssociativeSequence)
, typename BOOST_MPL_AUX_NA_PARAM(Key)
>
struct order
: order_impl< typename sequence_tag<AssociativeSequence>::type >
::template apply<AssociativeSequence,Key>
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,order,(AssociativeSequence,Key))
};
BOOST_MPL_AUX_NA_SPEC(2, order)
}}
#endif // BOOST_MPL_ORDER_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
#ifndef BOOST_MPL_ORDER_FWD_HPP_INCLUDED
#define BOOST_MPL_ORDER_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: order_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct order_impl;
template< typename AssociativeSequence, typename Key > struct order;
}}
#endif // BOOST_MPL_ORDER_FWD_HPP_INCLUDED

View File

@ -0,0 +1,169 @@
#ifndef BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
#define BOOST_MPL_PAIR_VIEW_HPP_INCLUDED
// Copyright David Abrahams 2003-2004
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pair_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/iterator_category.hpp>
#include <boost/mpl/advance.hpp>
#include <boost/mpl/distance.hpp>
#include <boost/mpl/next_prior.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/min_max.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/aux_/config/ctps.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
namespace aux {
struct pair_iter_tag;
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template< typename Iter1, typename Iter2, typename Category >
struct pair_iter;
template< typename Category > struct prior_pair_iter
{
template< typename Iter1, typename Iter2 > struct apply
{
typedef typename mpl::prior<Iter1>::type i1_;
typedef typename mpl::prior<Iter2>::type i2_;
typedef pair_iter<i1_,i2_,Category> type;
};
};
template<> struct prior_pair_iter<forward_iterator_tag>
{
template< typename Iter1, typename Iter2 > struct apply
{
typedef pair_iter<Iter1,Iter2,forward_iterator_tag> type;
};
};
#endif
}
template<
typename Iter1
, typename Iter2
, typename Category
>
struct pair_iter
{
typedef aux::pair_iter_tag tag;
typedef Category category;
typedef Iter1 first;
typedef Iter2 second;
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
typedef pair<
typename deref<Iter1>::type
, typename deref<Iter2>::type
> type;
typedef typename mpl::next<Iter1>::type i1_;
typedef typename mpl::next<Iter2>::type i2_;
typedef pair_iter<i1_,i2_,Category> next;
typedef apply_wrap2< aux::prior_pair_iter<Category>,Iter1,Iter2 >::type prior;
#endif
};
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template< typename Iter1, typename Iter2, typename C >
struct deref< pair_iter<Iter1,Iter2,C> >
{
typedef pair<
typename deref<Iter1>::type
, typename deref<Iter2>::type
> type;
};
template< typename Iter1, typename Iter2, typename C >
struct next< pair_iter<Iter1,Iter2,C> >
{
typedef typename mpl::next<Iter1>::type i1_;
typedef typename mpl::next<Iter2>::type i2_;
typedef pair_iter<i1_,i2_,C> type;
};
template< typename Iter1, typename Iter2, typename C >
struct prior< pair_iter<Iter1,Iter2,C> >
{
typedef typename mpl::prior<Iter1>::type i1_;
typedef typename mpl::prior<Iter2>::type i2_;
typedef pair_iter<i1_,i2_,C> type;
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<> struct advance_impl<aux::pair_iter_tag>
{
template< typename Iter, typename D > struct apply
{
typedef typename mpl::advance< typename Iter::first,D >::type i1_;
typedef typename mpl::advance< typename Iter::second,D >::type i2_;
typedef pair_iter<i1_,i2_,typename Iter::category> type;
};
};
template<> struct distance_impl<aux::pair_iter_tag>
{
template< typename Iter1, typename Iter2 > struct apply
{
// agurt, 10/nov/04: MSVC 6.5 ICE-s on forwarding
typedef typename mpl::distance<
typename first<Iter1>::type
, typename first<Iter2>::type
>::type type;
};
};
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence1)
, typename BOOST_MPL_AUX_NA_PARAM(Sequence2)
>
struct pair_view
{
typedef nested_begin_end_tag tag;
typedef typename begin<Sequence1>::type iter1_;
typedef typename begin<Sequence2>::type iter2_;
typedef typename min<
typename iterator_category<iter1_>::type
, typename iterator_category<iter2_>::type
>::type category_;
typedef pair_iter<iter1_,iter2_,category_> begin;
typedef pair_iter<
typename end<Sequence1>::type
, typename end<Sequence2>::type
, category_
> end;
};
BOOST_MPL_AUX_NA_SPEC(2, pair_view)
}}
#endif // BOOST_MPL_PAIR_VIEW_HPP_INCLUDED

View File

@ -0,0 +1,53 @@
#ifndef BOOST_MPL_PARTITION_HPP_INCLUDED
#define BOOST_MPL_PARTITION_HPP_INCLUDED
// Copyright Eric Friedman 2002-2003
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: partition.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/stable_partition.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
namespace aux {
template <
typename Sequence
, typename Pred
, typename In1
, typename In2
>
struct partition_impl
: stable_partition_impl<Sequence,Pred,In1,In2>
{
};
template <
typename Sequence
, typename Pred
, typename In1
, typename In2
>
struct reverse_partition_impl
: reverse_stable_partition_impl<Sequence,Pred,In1,In2>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, partition)
}}
#endif // BOOST_MPL_PARTITION_HPP_INCLUDED

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_POP_BACK_HPP_INCLUDED
#define BOOST_MPL_POP_BACK_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_back_fwd.hpp>
#include <boost/mpl/aux_/pop_back_impl.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct pop_back
: pop_back_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,pop_back,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, pop_back)
}}
#endif // BOOST_MPL_POP_BACK_HPP_INCLUDED

View File

@ -0,0 +1,39 @@
#ifndef BOOST_MPL_POP_FRONT_HPP_INCLUDED
#define BOOST_MPL_POP_FRONT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/pop_front_fwd.hpp>
#include <boost/mpl/aux_/pop_front_impl.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
>
struct pop_front
: pop_front_impl< typename sequence_tag<Sequence>::type >
::template apply< Sequence >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,pop_front,(Sequence))
};
BOOST_MPL_AUX_NA_SPEC(1, pop_front)
}}
#endif // BOOST_MPL_POP_FRONT_HPP_INCLUDED

View File

@ -0,0 +1,74 @@
#ifndef BOOST_MPL_PRINT_HPP_INCLUDED
#define BOOST_MPL_PRINT_HPP_INCLUDED
// Copyright David Abrahams 2003
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: print.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/identity.hpp>
namespace boost { namespace mpl {
namespace aux {
#if defined(BOOST_MSVC)
# pragma warning(push, 3)
// we only want one warning from MSVC, so turn off the other one
# pragma warning(disable: 4307)
#elif defined(__MWERKS__)
# pragma warn_hidevirtual on
struct print_base { virtual void f() {} };
#endif
#if defined(__EDG_VERSION__)
template <class T>
struct dependent_unsigned
{
static const unsigned value = 1;
};
#endif
} // namespace aux
template <class T>
struct print
: mpl::identity<T>
#if defined(__MWERKS__)
, aux::print_base
#endif
{
#if defined(BOOST_MSVC)
enum { n = sizeof(T) + -1 };
#elif defined(__MWERKS__)
void f(int);
#else
enum {
n =
# if defined(__EDG_VERSION__)
aux::dependent_unsigned<T>::value > -1
# else
sizeof(T) > -1
# endif
};
#endif
};
#if defined(BOOST_MSVC)
# pragma warning(pop)
#elif defined(__MWERKS__)
# pragma warn_hidevirtual reset
#endif
}}
#endif // BOOST_MPL_PRINT_HPP_INCLUDED

View File

@ -0,0 +1,48 @@
#ifndef BOOST_MPL_RANGE_C_HPP_INCLUDED
#define BOOST_MPL_RANGE_C_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: range_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/integral_c.hpp>
#include <boost/mpl/aux_/range_c/front.hpp>
#include <boost/mpl/aux_/range_c/back.hpp>
#include <boost/mpl/aux_/range_c/size.hpp>
#include <boost/mpl/aux_/range_c/O1_size.hpp>
#include <boost/mpl/aux_/range_c/empty.hpp>
#include <boost/mpl/aux_/range_c/iterator.hpp>
#include <boost/mpl/aux_/range_c/tag.hpp>
namespace boost { namespace mpl {
template<
typename T
, T Start
, T Finish
>
struct range_c
{
typedef aux::half_open_range_tag tag;
typedef T value_type;
typedef range_c type;
typedef integral_c<T,Start> start;
typedef integral_c<T,Finish> finish;
typedef r_iter<start> begin;
typedef r_iter<finish> end;
};
}}
#endif // BOOST_MPL_RANGE_C_HPP_INCLUDED

View File

@ -0,0 +1,52 @@
#ifndef BOOST_MPL_REMOVE_HPP_INCLUDED
#define BOOST_MPL_REMOVE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: remove.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/remove_if.hpp>
#include <boost/mpl/same_as.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Sequence
, typename T
, typename Inserter
>
struct remove_impl
: remove_if_impl< Sequence, same_as<T>, Inserter >
{
};
template<
typename Sequence
, typename T
, typename Inserter
>
struct reverse_remove_impl
: reverse_remove_if_impl< Sequence, same_as<T>, Inserter >
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove)
}}
#endif // BOOST_MPL_REMOVE_HPP_INCLUDED

View File

@ -0,0 +1,55 @@
#ifndef BOOST_MPL_REPLACE_HPP_INCLUDED
#define BOOST_MPL_REPLACE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright John R. Bandela 2000-2002
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: replace.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/replace_if.hpp>
#include <boost/mpl/same_as.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Sequence
, typename OldType
, typename NewType
, typename Inserter
>
struct replace_impl
: replace_if_impl< Sequence, same_as<OldType>, NewType, Inserter >
{
};
template<
typename Sequence
, typename OldType
, typename NewType
, typename Inserter
>
struct reverse_replace_impl
: reverse_replace_if_impl< Sequence, same_as<OldType>, NewType, Inserter >
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, replace)
}}
#endif // BOOST_MPL_REPLACE_HPP_INCLUDED

View File

@ -0,0 +1,88 @@
#ifndef BOOST_MPL_REPLACE_IF_HPP_INCLUDED
#define BOOST_MPL_REPLACE_IF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright John R. Bandela 2000-2002
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: replace_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/transform.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/if.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
#include <boost/mpl/aux_/config/forwarding.hpp>
namespace boost { namespace mpl {
namespace aux {
template< typename Predicate, typename T >
struct replace_if_op
{
template< typename U > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
: if_<
typename apply1<Predicate,U>::type
, T
, U
>
{
#else
{
typedef typename if_<
typename apply1<Predicate,U>::type
, T
, U
>::type type;
#endif
};
};
template<
typename Sequence
, typename Predicate
, typename T
, typename Inserter
>
struct replace_if_impl
: transform1_impl<
Sequence
, protect< aux::replace_if_op<Predicate,T> >
, Inserter
>
{
};
template<
typename Sequence
, typename Predicate
, typename T
, typename Inserter
>
struct reverse_replace_if_impl
: reverse_transform1_impl<
Sequence
, protect< aux::replace_if_op<Predicate,T> >
, Inserter
>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, replace_if)
}}
#endif // BOOST_MPL_REPLACE_IF_HPP_INCLUDED

View File

@ -0,0 +1,38 @@
#ifndef BOOST_MPL_REVERSE_HPP_INCLUDED
#define BOOST_MPL_REVERSE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/copy.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(Inserter)
>
struct reverse
: reverse_copy<
Sequence
, Inserter
>
{
};
BOOST_MPL_AUX_NA_SPEC(1, reverse)
}}
#endif // BOOST_MPL_REVERSE_HPP_INCLUDED

View File

@ -0,0 +1,56 @@
#ifndef BOOST_MPL_ITER_FOLD_BACKWARD_HPP_INCLUDED
#define BOOST_MPL_ITER_FOLD_BACKWARD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
// Copyright Dave Abrahams 2001-2002
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: reverse_iter_fold.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/O1_size.hpp>
#include <boost/mpl/arg.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/aux_/reverse_iter_fold_impl.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(State)
, typename BOOST_MPL_AUX_NA_PARAM(BackwardOp)
, typename ForwardOp = arg<1>
>
struct reverse_iter_fold
{
typedef typename aux::reverse_iter_fold_impl<
::boost::mpl::O1_size<Sequence>::value
, typename begin<Sequence>::type
, typename end<Sequence>::type
, State
, typename lambda<BackwardOp>::type
, typename lambda<ForwardOp>::type
>::state type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(
4
, reverse_iter_fold
, (Sequence,State,BackwardOp,ForwardOp)
)
};
BOOST_MPL_AUX_NA_SPEC(3, reverse_iter_fold)
}}
#endif // BOOST_MPL_ITER_FOLD_BACKWARD_HPP_INCLUDED

View File

@ -0,0 +1,57 @@
#ifndef BOOST_MPL_SET_HPP_INCLUDED
#define BOOST_MPL_SET_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/set.hpp>
# include <boost/mpl/aux_/na.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_SET_HEADER \
BOOST_PP_CAT(set, BOOST_MPL_LIMIT_SET_SIZE).hpp \
/**/
#else
# define AUX778076_SET_HEADER \
BOOST_PP_CAT(set, BOOST_MPL_LIMIT_SET_SIZE)##.hpp \
/**/
#endif
# include BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_HEADER)
# undef AUX778076_SET_HEADER
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER set.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/set.hpp>
# define AUX778076_SEQUENCE_NAME set
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_SET_SIZE
# include <boost/mpl/aux_/sequence_wrapper.hpp>
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_SET_HPP_INCLUDED

View File

@ -0,0 +1,60 @@
#ifndef BOOST_MPL_SET_C_HPP_INCLUDED
#define BOOST_MPL_SET_C_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: set_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/set.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_SET_C_HEADER \
BOOST_PP_CAT(BOOST_PP_CAT(set,BOOST_MPL_LIMIT_SET_SIZE),_c).hpp \
/**/
#else
# define AUX778076_SET_C_HEADER \
BOOST_PP_CAT(BOOST_PP_CAT(set,BOOST_MPL_LIMIT_SET_SIZE),_c)##.hpp \
/**/
#endif
# include BOOST_PP_STRINGIZE(boost/mpl/set/AUX778076_SET_C_HEADER)
# undef AUX778076_SET_C_HEADER
# include <climits>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER set_c.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/set.hpp>
# define AUX778076_SEQUENCE_NAME set_c
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_SET_SIZE
# define AUX778076_SEQUENCE_NAME_N(n) BOOST_PP_CAT(BOOST_PP_CAT(set,n),_c)
# define AUX778076_SEQUENCE_INTEGRAL_WRAPPER
# include <boost/mpl/aux_/sequence_wrapper.hpp>
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_SET_C_HPP_INCLUDED

View File

@ -0,0 +1,22 @@
#ifndef BOOST_MPL_SHIFT_LEFT_HPP_INCLUDED
#define BOOST_MPL_SHIFT_LEFT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: shift_left.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME shift_left
#define AUX778076_OP_TOKEN <<
#include <boost/mpl/aux_/shift_op.hpp>
#endif // BOOST_MPL_SHIFT_LEFT_HPP_INCLUDED

View File

@ -0,0 +1,22 @@
#ifndef BOOST_MPL_SHIFT_RIGHT_HPP_INCLUDED
#define BOOST_MPL_SHIFT_RIGHT_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: shift_right.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME shift_right
#define AUX778076_OP_TOKEN >>
#include <boost/mpl/aux_/shift_op.hpp>
#endif // BOOST_MPL_SHIFT_RIGHT_HPP_INCLUDED

View File

@ -0,0 +1,38 @@
#ifndef BOOST_MPL_SINGLE_VIEW_HPP_INCLUDED
#define BOOST_MPL_SINGLE_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: single_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/single_element_iter.hpp>
#include <boost/mpl/iterator_range.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct single_view
: iterator_range<
aux::sel_iter<T,0>
, aux::sel_iter<T,1>
>
{
};
BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, single_view)
}}
#endif // BOOST_MPL_SINGLE_VIEW_HPP_INCLUDED

View File

@ -0,0 +1,36 @@
#ifndef BOOST_MPL_SIZEOF_HPP_INCLUDED
#define BOOST_MPL_SIZEOF_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2003
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sizeof.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/size_t.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct sizeof_
: mpl::size_t< sizeof(T) >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,sizeof_,(T))
};
BOOST_MPL_AUX_NA_SPEC_NO_ETI(1, sizeof_)
}}
#endif // BOOST_MPL_SIZEOF_HPP_INCLUDED

View File

@ -0,0 +1,27 @@
#ifndef BOOST_MPL_SORT_HPP_INCLUDED
#define BOOST_MPL_SORT_HPP_INCLUDED
// Copyright Eric Friedman 2002-2003
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: sort.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/aux_/sort_impl.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, sort)
}}
#endif // BOOST_MPL_SORT_HPP_INCLUDED

View File

@ -0,0 +1,75 @@
#ifndef BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
#define BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED
// Copyright Eric Friedman 2002-2003
// Copyright Aleksey Gurtovoy 2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: stable_partition.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/protect.hpp>
#include <boost/mpl/aux_/partition_op.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
#include <boost/mpl/aux_/na.hpp>
namespace boost { namespace mpl {
namespace aux {
template <
typename Sequence
, typename Pred
, typename In
, typename In2
, typename In1 = typename if_na<In,In2>::type
>
struct stable_partition_impl
: fold<
Sequence
, pair< typename In1::state, typename In2::state >
, protect< partition_op<
Pred
, typename In1::operation
, typename In2::operation
> >
>
{
};
template <
typename Sequence
, typename Pred
, typename In
, typename In2
, typename In1 = typename if_na<In,In2>::type
>
struct reverse_stable_partition_impl
: reverse_fold<
Sequence
, pair< typename In1::state, typename In2::state >
, protect< partition_op<
Pred
, typename In1::operation
, typename In2::operation
> >
>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, stable_partition)
}}
#endif // BOOST_MPL_STABLE_PARTITION_HPP_INCLUDED

View File

@ -0,0 +1,49 @@
#ifndef BOOST_MPL_SWITCH_HPP_INCLUDED
#define BOOST_MPL_SWITCH_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: switch.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/find_if.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Body)
, typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct switch_
{
typedef typename find_if<
Body
, apply1< lambda< first<_1> >, T >
>::type iter_;
typedef typename deref<iter_>::type pair_;
typedef typename lambda< typename second<pair_>::type >::type f_;
typedef typename apply1<f_,T>::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,switch_,(Body,T))
};
BOOST_MPL_AUX_NA_SPEC(2, switch_)
}}
#endif // BOOST_MPL_SWITCH_HPP_INCLUDED

View File

@ -0,0 +1,21 @@
#ifndef BOOST_MPL_TIMES_HPP_INCLUDED
#define BOOST_MPL_TIMES_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: times.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#define AUX778076_OP_NAME times
#define AUX778076_OP_TOKEN *
#include <boost/mpl/aux_/arithmetic_op.hpp>
#endif // BOOST_MPL_TIMES_HPP_INCLUDED

View File

@ -0,0 +1,145 @@
#ifndef BOOST_MPL_TRANSFORM_HPP_INCLUDED
#define BOOST_MPL_TRANSFORM_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: transform.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/pair_view.hpp>
#include <boost/mpl/is_sequence.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/bind.hpp>
#include <boost/mpl/or.hpp>
#include <boost/mpl/not.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
namespace boost { namespace mpl {
namespace aux {
template<
typename Seq
, typename Op
, typename In
>
struct transform1_impl
: fold<
Seq
, typename In::state
, bind2< typename lambda< typename In::operation >::type
, _1
, bind1< typename lambda<Op>::type, _2>
>
>
{
};
template<
typename Seq
, typename Op
, typename In
>
struct reverse_transform1_impl
: reverse_fold<
Seq
, typename In::state
, bind2< typename lambda< typename In::operation >::type
, _1
, bind1< typename lambda<Op>::type, _2>
>
>
{
};
template<
typename Seq1
, typename Seq2
, typename Op
, typename In
>
struct transform2_impl
: fold<
pair_view<Seq1,Seq2>
, typename In::state
, bind2< typename lambda< typename In::operation >::type
, _1
, bind2<
typename lambda<Op>::type
, bind1<first<>,_2>
, bind1<second<>,_2>
>
>
>
{
};
template<
typename Seq1
, typename Seq2
, typename Op
, typename In
>
struct reverse_transform2_impl
: reverse_fold<
pair_view<Seq1,Seq2>
, typename In::state
, bind2< typename lambda< typename In::operation >::type
, _1
, bind2< typename lambda< Op >::type
, bind1<first<>,_2>
, bind1<second<>,_2>
>
>
>
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, transform1)
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(4, transform2)
#define AUX778076_TRANSFORM_DEF(name) \
template< \
typename BOOST_MPL_AUX_NA_PARAM(Seq1) \
, typename BOOST_MPL_AUX_NA_PARAM(Seq2OrOperation) \
, typename BOOST_MPL_AUX_NA_PARAM(OperationOrInserter) \
, typename BOOST_MPL_AUX_NA_PARAM(Inserter) \
> \
struct name \
{ \
typedef typename eval_if< \
or_< \
is_na<OperationOrInserter> \
, is_lambda_expression< Seq2OrOperation > \
, not_< is_sequence<Seq2OrOperation> > \
> \
, name##1<Seq1,Seq2OrOperation,OperationOrInserter> \
, name##2<Seq1,Seq2OrOperation,OperationOrInserter,Inserter> \
>::type type; \
}; \
BOOST_MPL_AUX_NA_SPEC(4, name) \
/**/
AUX778076_TRANSFORM_DEF(transform)
AUX778076_TRANSFORM_DEF(reverse_transform)
#undef AUX778076_TRANSFORM_DEF
}}
#endif // BOOST_MPL_TRANSFORM_HPP_INCLUDED

View File

@ -0,0 +1,46 @@
#ifndef BOOST_MPL_TRANSFORM_VIEW_HPP_INCLUDED
#define BOOST_MPL_TRANSFORM_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: transform_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/aux_/transform_iter.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(F)
>
struct transform_view
{
private:
typedef typename lambda<F>::type f_;
typedef typename begin<Sequence>::type first_;
typedef typename end<Sequence>::type last_;
public:
struct tag;
typedef transform_view type;
typedef aux::transform_iter< first_,last_,f_ > begin;
typedef aux::transform_iter< last_,last_,f_ > end;
};
BOOST_MPL_AUX_NA_SPEC(2, transform_view)
}}
#endif // BOOST_MPL_TRANSFORM_VIEW_HPP_INCLUDED

View File

@ -0,0 +1,85 @@
#ifndef BOOST_MPL_UNIQUE_HPP_INCLUDED
#define BOOST_MPL_UNIQUE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright John R. Bandela 2000-2002
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: unique.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/fold.hpp>
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/and.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/pair.hpp>
#include <boost/mpl/apply.hpp>
#include <boost/mpl/aux_/inserter_algorithm.hpp>
#include <boost/mpl/aux_/na.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_spec.hpp>
namespace boost { namespace mpl {
namespace aux {
template< typename Predicate, typename Operation >
struct unique_op
{
template< typename Pair, typename T > struct apply
{
typedef typename Pair::first seq_;
typedef typename Pair::second prior_;
typedef typename eval_if<
and_< is_not_na<prior_>, apply2<Predicate,prior_,T> >
, identity<seq_>
, apply2<Operation,seq_,T>
>::type new_seq_;
typedef pair<new_seq_,T> type;
};
};
template<
typename Sequence
, typename Predicate
, typename Inserter
>
struct unique_impl
: first< typename fold<
Sequence
, pair< typename Inserter::state,na >
, protect< aux::unique_op<Predicate,typename Inserter::operation> >
>::type >
{
};
template<
typename Sequence
, typename Predicate
, typename Inserter
>
struct reverse_unique_impl
: first< typename reverse_fold<
Sequence
, pair< typename Inserter::state,na >
, protect< aux::unique_op<Predicate,typename Inserter::operation> >
>::type >
{
};
} // namespace aux
BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, unique)
}}
#endif // BOOST_MPL_UNIQUE_HPP_INCLUDED

View File

@ -0,0 +1,150 @@
#if !defined(BOOST_PP_IS_ITERATING)
///// header body
#ifndef BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
#define BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2002-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: unpack_args.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/apply.hpp>
# include <boost/mpl/at.hpp>
# include <boost/mpl/size.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/mpl/aux_/lambda_spec.hpp>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER unpack_args.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/arity.hpp>
# include <boost/mpl/aux_/preprocessor/repeat.hpp>
# include <boost/mpl/aux_/config/ctps.hpp>
# include <boost/mpl/aux_/config/forwarding.hpp>
# include <boost/preprocessor/iterate.hpp>
# include <boost/preprocessor/cat.hpp>
namespace boost { namespace mpl {
// local macros, #undef-ined at the end of the header
# define AUX778076_UNPACK(unused, i, Args) \
, typename at_c<Args,i>::type \
/**/
# define AUX778076_UNPACKED_ARGS(n, Args) \
BOOST_MPL_PP_REPEAT(n, AUX778076_UNPACK, Args) \
/**/
namespace aux {
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template< int size, typename F, typename Args >
struct unpack_args_impl;
#else
template< BOOST_MPL_AUX_NTTP_DECL(int, size) > struct unpack_args_impl
{
template< typename F, typename Args > struct apply;
};
#endif
#define BOOST_PP_ITERATION_PARAMS_1 \
(3,(0, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, <boost/mpl/unpack_args.hpp>))
#include BOOST_PP_ITERATE()
}
template<
typename F
>
struct unpack_args
{
template< typename Args > struct apply
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
# if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
: aux::unpack_args_impl< size<Args>::value,F,Args >
# else
: aux::unpack_args_impl< size<Args>::value >
::template apply< F,Args >
# endif
{
#else // BOOST_MPL_CFG_NO_NESTED_FORWARDING
{
typedef typename aux::unpack_args_impl<
size<Args>::value
, F
, Args
>::type type;
#endif
};
};
BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, unpack_args)
# undef AUX778076_UNPACK
# undef AUX778076_UNPACKED_ARGS
}}
#endif // BOOST_MPL_CFG_USE_PREPROCESSED_HEADERS
#endif // BOOST_MPL_UNPACK_ARGS_HPP_INCLUDED
///// iteration, depth == 1
// For gcc 4.4 compatability, we must include the
// BOOST_PP_ITERATION_DEPTH test inside an #else clause.
#else // BOOST_PP_IS_ITERATING
#if BOOST_PP_ITERATION_DEPTH() == 1
# define i_ BOOST_PP_FRAME_ITERATION(1)
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
template< typename F, typename Args >
struct unpack_args_impl<i_,F,Args>
: BOOST_PP_CAT(apply,i_)<
F
AUX778076_UNPACKED_ARGS(i_, Args)
>
{
};
#else
template<> struct unpack_args_impl<i_>
{
template< typename F, typename Args > struct apply
: BOOST_PP_CAT(apply,i_)<
F
AUX778076_UNPACKED_ARGS(i_, Args)
>
{
};
};
#endif
# undef i_
#endif // BOOST_PP_ITERATION_DEPTH()
#endif // BOOST_PP_IS_ITERATING

View File

@ -0,0 +1,141 @@
#ifndef BOOST_MPL_UPPER_BOUND_HPP_INCLUDED
#define BOOST_MPL_UPPER_BOUND_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2001-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: upper_bound.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/less.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x610))
# define BOOST_MPL_CFG_STRIPPED_DOWN_UPPER_BOUND_IMPL
#endif
#if !defined(BOOST_MPL_CFG_STRIPPED_DOWN_UPPER_BOUND_IMPL)
# include <boost/mpl/minus.hpp>
# include <boost/mpl/divides.hpp>
# include <boost/mpl/size.hpp>
# include <boost/mpl/advance.hpp>
# include <boost/mpl/begin_end.hpp>
# include <boost/mpl/long.hpp>
# include <boost/mpl/eval_if.hpp>
# include <boost/mpl/prior.hpp>
# include <boost/mpl/deref.hpp>
# include <boost/mpl/apply.hpp>
# include <boost/mpl/aux_/value_wknd.hpp>
#else
# include <boost/mpl/find.hpp>
# include <boost/mpl/bind.hpp>
#endif
#include <boost/config.hpp>
namespace boost { namespace mpl {
#if defined(BOOST_MPL_CFG_STRIPPED_DOWN_UPPER_BOUND_IMPL)
// agurt 23/oct/02: has a wrong complexity etc., but at least it works;
// feel free to contribute a better implementation!
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
, typename Predicate = less<>
, typename pred_ = typename lambda<Predicate>::type
>
struct upper_bound
: find_if< Sequence, bind2<pred_,T,_> >
{
};
#else
namespace aux {
template<
typename Distance
, typename Predicate
, typename T
, typename DeferredIterator
>
struct upper_bound_step_impl;
template<
typename Distance
, typename Predicate
, typename T
, typename DeferredIterator
>
struct upper_bound_step
{
typedef typename eval_if<
Distance
, upper_bound_step_impl<Distance,Predicate,T,DeferredIterator>
, DeferredIterator
>::type type;
};
template<
typename Distance
, typename Predicate
, typename T
, typename DeferredIterator
>
struct upper_bound_step_impl
{
typedef typename divides< Distance, long_<2> >::type offset_;
typedef typename DeferredIterator::type iter_;
typedef typename advance< iter_,offset_ >::type middle_;
typedef typename apply2<
Predicate
, T
, typename deref<middle_>::type
>::type cond_;
typedef typename prior< minus< Distance, offset_ > >::type step_;
typedef upper_bound_step< offset_,Predicate,T,DeferredIterator > step_forward_;
typedef upper_bound_step< step_,Predicate,T,next<middle_> > step_backward_;
typedef typename eval_if<
cond_
, step_forward_
, step_backward_
>::type type;
};
} // namespace aux
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
, typename Predicate = less<>
>
struct upper_bound
{
private:
typedef typename lambda<Predicate>::type pred_;
typedef typename size<Sequence>::type size_;
public:
typedef typename aux::upper_bound_step<
size_,pred_,T,begin<Sequence>
>::type type;
};
#endif // BOOST_MPL_CFG_STRIPPED_DOWN_UPPER_BOUND_IMPL
BOOST_MPL_AUX_NA_SPEC(2, upper_bound)
}}
#endif // BOOST_MPL_UPPER_BOUND_HPP_INCLUDED

View File

@ -0,0 +1,42 @@
#ifndef BOOST_MPL_VALUE_TYPE_HPP_INCLUDED
#define BOOST_MPL_VALUE_TYPE_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_type.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/value_type_fwd.hpp>
#include <boost/mpl/sequence_tag.hpp>
#include <boost/mpl/apply_wrap.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/lambda_support.hpp>
namespace boost { namespace mpl {
template<
typename BOOST_MPL_AUX_NA_PARAM(AssociativeSequence)
, typename BOOST_MPL_AUX_NA_PARAM(T)
>
struct value_type
: apply_wrap2<
value_type_impl< typename sequence_tag<AssociativeSequence>::type >
, AssociativeSequence, T >
{
BOOST_MPL_AUX_LAMBDA_SUPPORT(2,value_type,(AssociativeSequence,T))
};
BOOST_MPL_AUX_NA_SPEC(2, value_type)
}}
#endif // BOOST_MPL_VALUE_TYPE_HPP_INCLUDED

View File

@ -0,0 +1,25 @@
#ifndef BOOST_MPL_VALUE_TYPE_FWD_HPP_INCLUDED
#define BOOST_MPL_VALUE_TYPE_FWD_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: value_type_fwd.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
namespace boost { namespace mpl {
template< typename Tag > struct value_type_impl;
template< typename AssociativeSequence, typename T > struct value_type;
}}
#endif // BOOST_MPL_VALUE_TYPE_FWD_HPP_INCLUDED

View File

@ -0,0 +1,61 @@
#ifndef BOOST_MPL_VECTOR_C_HPP_INCLUDED
#define BOOST_MPL_VECTOR_C_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2008
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: vector_c.hpp 49271 2008-10-11 06:46:00Z agurtovoy $
// $Date: 2008-10-11 02:46:00 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49271 $
#if !defined(BOOST_MPL_PREPROCESSING_MODE)
# include <boost/mpl/limits/vector.hpp>
# include <boost/mpl/aux_/nttp_decl.hpp>
# include <boost/mpl/aux_/config/preprocessor.hpp>
# include <boost/preprocessor/inc.hpp>
# include <boost/preprocessor/cat.hpp>
# include <boost/preprocessor/stringize.hpp>
#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING)
# define AUX778076_VECTOR_C_HEADER \
BOOST_PP_CAT(BOOST_PP_CAT(vector,BOOST_MPL_LIMIT_VECTOR_SIZE),_c).hpp \
/**/
#else
# define AUX778076_VECTOR_C_HEADER \
BOOST_PP_CAT(BOOST_PP_CAT(vector,BOOST_MPL_LIMIT_VECTOR_SIZE),_c)##.hpp \
/**/
#endif
# include BOOST_PP_STRINGIZE(boost/mpl/vector/AUX778076_VECTOR_C_HEADER)
# undef AUX778076_VECTOR_C_HEADER
# include <climits>
#endif
#include <boost/mpl/aux_/config/use_preprocessed.hpp>
#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE)
# define BOOST_MPL_PREPROCESSED_HEADER vector_c.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#else
# include <boost/mpl/limits/vector.hpp>
# define AUX778076_SEQUENCE_NAME vector_c
# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_VECTOR_SIZE
# define AUX778076_SEQUENCE_NAME_N(n) BOOST_PP_CAT(BOOST_PP_CAT(vector,n),_c)
# define AUX778076_SEQUENCE_CONVERT_CN_TO(z,n,TARGET) TARGET(BOOST_PP_CAT(C,n))
# define AUX778076_SEQUENCE_INTEGRAL_WRAPPER
# include <boost/mpl/aux_/sequence_wrapper.hpp>
#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
#endif // BOOST_MPL_VECTOR_C_HPP_INCLUDED

View File

@ -0,0 +1,64 @@
#ifndef BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
#define BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2002
// Copyright David Abrahams 2000-2002
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: zip_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
#include <boost/mpl/transform.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/iterator_tags.hpp>
#include <boost/mpl/next.hpp>
#include <boost/mpl/lambda.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
namespace boost { namespace mpl {
template< typename IteratorSeq >
struct zip_iterator
{
typedef forward_iterator_tag category;
typedef typename transform1<
IteratorSeq
, deref<_1>
>::type type;
typedef zip_iterator<
typename transform1<
IteratorSeq
, mpl::next<_1>
>::type
> next;
};
template<
typename BOOST_MPL_AUX_NA_PARAM(Sequences)
>
struct zip_view
{
private:
typedef typename transform1< Sequences, mpl::begin<_1> >::type first_ones_;
typedef typename transform1< Sequences, mpl::end<_1> >::type last_ones_;
public:
typedef nested_begin_end_tag tag;
typedef zip_iterator<first_ones_> begin;
typedef zip_iterator<last_ones_> end;
};
BOOST_MPL_AUX_NA_SPEC(1, zip_view)
}}
#endif // BOOST_MPL_ZIP_VIEW_HPP_INCLUDED

View File

@ -0,0 +1,88 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_ARRAY_HPP_INCLUDED
# define BOOST_TR1_ARRAY_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
#ifdef BOOST_HAS_TR1_ARRAY
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(array)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(array))
# endif
#else
#include <boost/array.hpp>
#include <boost/static_assert.hpp>
#include <boost/type_traits/integral_constant.hpp>
#include <boost/detail/workaround.hpp>
namespace std{ namespace tr1{
using ::boost::array;
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
// [6.1.3.2] Tuple creation functions
using ::boost::swap;
#endif
#if !defined(BOOST_TR1_USE_OLD_TUPLE)
}} namespace boost{ namespace fusion{
#endif
// [6.2.2.5] Tuple interface to class template array
template <class T> struct tuple_size; // forward declaration
template <int I, class T> struct tuple_element; // forward declaration
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template <class T, size_t N>
struct tuple_size< ::boost::array<T, N> >
: public ::boost::integral_constant< ::std::size_t, N>{};
template <int I, class T, size_t N>
struct tuple_element<I, ::boost::array<T, N> >
{
#if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570))
BOOST_STATIC_ASSERT(I < (int)N);
BOOST_STATIC_ASSERT(I >= 0);
#endif
typedef T type;
};
#endif
template <int I, class T, size_t N>
T& get( ::boost::array<T, N>& a)
{
BOOST_STATIC_ASSERT(I < N);
BOOST_STATIC_ASSERT(I >= 0);
return a[I];
}
template <int I, class T, size_t N>
const T& get(const array<T, N>& a)
{
BOOST_STATIC_ASSERT(I < N);
BOOST_STATIC_ASSERT(I >= 0);
return a[I];
}
#if !defined(BOOST_TR1_USE_OLD_TUPLE)
}} namespace std{ namespace tr1{
using ::boost::fusion::tuple_size;
using ::boost::fusion::tuple_element;
using ::boost::fusion::get;
#endif
} } // namespaces
#endif
#endif

View File

@ -0,0 +1,267 @@
// (C) Copyright John Maddock 2008.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_CMATH_HPP_INCLUDED
# define BOOST_TR1_CMATH_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
#ifdef BOOST_HAS_TR1_CMATH
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(cmath)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_HEADER(cmath)
# endif
#else
#include <boost/math/tr1.hpp>
namespace std{ namespace tr1{
using boost::math::tr1::assoc_laguerre;
using boost::math::tr1::assoc_laguerref;
using boost::math::tr1::assoc_laguerrel;
// [5.2.1.2] associated Legendre functions:
using boost::math::tr1::assoc_legendre;
using boost::math::tr1::assoc_legendref;
using boost::math::tr1::assoc_legendrel;
// [5.2.1.3] beta function:
using boost::math::tr1::beta;
using boost::math::tr1::betaf;
using boost::math::tr1::betal;
// [5.2.1.4] (complete) elliptic integral of the first kind:
using boost::math::tr1::comp_ellint_1;
using boost::math::tr1::comp_ellint_1f;
using boost::math::tr1::comp_ellint_1l;
// [5.2.1.5] (complete) elliptic integral of the second kind:
using boost::math::tr1::comp_ellint_2;
using boost::math::tr1::comp_ellint_2f;
using boost::math::tr1::comp_ellint_2l;
// [5.2.1.6] (complete) elliptic integral of the third kind:
using boost::math::tr1::comp_ellint_3;
using boost::math::tr1::comp_ellint_3f;
using boost::math::tr1::comp_ellint_3l;
#if 0
// [5.2.1.7] confluent hypergeometric functions:
using boost::math::tr1::conf_hyperg;
using boost::math::tr1::conf_hypergf;
using boost::math::tr1::conf_hypergl;
#endif
// [5.2.1.8] regular modified cylindrical Bessel functions:
using boost::math::tr1::cyl_bessel_i;
using boost::math::tr1::cyl_bessel_if;
using boost::math::tr1::cyl_bessel_il;
// [5.2.1.9] cylindrical Bessel functions (of the first kind):
using boost::math::tr1::cyl_bessel_j;
using boost::math::tr1::cyl_bessel_jf;
using boost::math::tr1::cyl_bessel_jl;
// [5.2.1.10] irregular modified cylindrical Bessel functions:
using boost::math::tr1::cyl_bessel_k;
using boost::math::tr1::cyl_bessel_kf;
using boost::math::tr1::cyl_bessel_kl;
// [5.2.1.11] cylindrical Neumann functions;
// cylindrical Bessel functions (of the second kind):
using boost::math::tr1::cyl_neumann;
using boost::math::tr1::cyl_neumannf;
using boost::math::tr1::cyl_neumannl;
// [5.2.1.12] (incomplete) elliptic integral of the first kind:
using boost::math::tr1::ellint_1;
using boost::math::tr1::ellint_1f;
using boost::math::tr1::ellint_1l;
// [5.2.1.13] (incomplete) elliptic integral of the second kind:
using boost::math::tr1::ellint_2;
using boost::math::tr1::ellint_2f;
using boost::math::tr1::ellint_2l;
// [5.2.1.14] (incomplete) elliptic integral of the third kind:
using boost::math::tr1::ellint_3;
using boost::math::tr1::ellint_3f;
using boost::math::tr1::ellint_3l;
// [5.2.1.15] exponential integral:
using boost::math::tr1::expint;
using boost::math::tr1::expintf;
using boost::math::tr1::expintl;
// [5.2.1.16] Hermite polynomials:
using boost::math::tr1::hermite;
using boost::math::tr1::hermitef;
using boost::math::tr1::hermitel;
#if 0
// [5.2.1.17] hypergeometric functions:
using boost::math::tr1::hyperg;
using boost::math::tr1::hypergf;
using boost::math::tr1::hypergl;
#endif
// [5.2.1.18] Laguerre polynomials:
using boost::math::tr1::laguerre;
using boost::math::tr1::laguerref;
using boost::math::tr1::laguerrel;
// [5.2.1.19] Legendre polynomials:
using boost::math::tr1::legendre;
using boost::math::tr1::legendref;
using boost::math::tr1::legendrel;
// [5.2.1.20] Riemann zeta function:
using boost::math::tr1::riemann_zeta;
using boost::math::tr1::riemann_zetaf;
using boost::math::tr1::riemann_zetal;
// [5.2.1.21] spherical Bessel functions (of the first kind):
using boost::math::tr1::sph_bessel;
using boost::math::tr1::sph_besself;
using boost::math::tr1::sph_bessell;
// [5.2.1.22] spherical associated Legendre functions:
using boost::math::tr1::sph_legendre;
using boost::math::tr1::sph_legendref;
using boost::math::tr1::sph_legendrel;
// [5.2.1.23] spherical Neumann functions;
// spherical Bessel functions (of the second kind):
using boost::math::tr1::sph_neumann;
using boost::math::tr1::sph_neumannf;
using boost::math::tr1::sph_neumannl;
// types
using boost::math::tr1::double_t;
using boost::math::tr1::float_t;
// functions
using boost::math::tr1::acosh;
using boost::math::tr1::acoshf;
using boost::math::tr1::acoshl;
using boost::math::tr1::asinh;
using boost::math::tr1::asinhf;
using boost::math::tr1::asinhl;
using boost::math::tr1::atanh;
using boost::math::tr1::atanhf;
using boost::math::tr1::atanhl;
using boost::math::tr1::cbrt;
using boost::math::tr1::cbrtf;
using boost::math::tr1::cbrtl;
using boost::math::tr1::copysign;
using boost::math::tr1::copysignf;
using boost::math::tr1::copysignl;
using boost::math::tr1::erf;
using boost::math::tr1::erff;
using boost::math::tr1::erfl;
using boost::math::tr1::erfc;
using boost::math::tr1::erfcf;
using boost::math::tr1::erfcl;
#if 0
using boost::math::tr1::exp2;
using boost::math::tr1::exp2f;
using boost::math::tr1::exp2l;
#endif
using boost::math::tr1::expm1;
using boost::math::tr1::expm1f;
using boost::math::tr1::expm1l;
#if 0
using boost::math::tr1::fdim;
using boost::math::tr1::fdimf;
using boost::math::tr1::fdiml;
using boost::math::tr1::fma;
using boost::math::tr1::fmaf;
using boost::math::tr1::fmal;
#endif
using boost::math::tr1::fmax;
using boost::math::tr1::fmaxf;
using boost::math::tr1::fmaxl;
using boost::math::tr1::fmin;
using boost::math::tr1::fminf;
using boost::math::tr1::fminl;
using boost::math::tr1::hypot;
using boost::math::tr1::hypotf;
using boost::math::tr1::hypotl;
#if 0
using boost::math::tr1::ilogb;
using boost::math::tr1::ilogbf;
using boost::math::tr1::ilogbl;
#endif
using boost::math::tr1::lgamma;
using boost::math::tr1::lgammaf;
using boost::math::tr1::lgammal;
#if 0
using boost::math::tr1::llrint;
using boost::math::tr1::llrintf;
using boost::math::tr1::llrintl;
#endif
using boost::math::tr1::llround;
using boost::math::tr1::llroundf;
using boost::math::tr1::llroundl;
using boost::math::tr1::log1p;
using boost::math::tr1::log1pf;
using boost::math::tr1::log1pl;
#if 0
using boost::math::tr1::log2;
using boost::math::tr1::log2f;
using boost::math::tr1::log2l;
using boost::math::tr1::logb;
using boost::math::tr1::logbf;
using boost::math::tr1::logbl;
using boost::math::tr1::lrint;
using boost::math::tr1::lrintf;
using boost::math::tr1::lrintl;
#endif
using boost::math::tr1::lround;
using boost::math::tr1::lroundf;
using boost::math::tr1::lroundl;
#if 0
using boost::math::tr1::nan;
using boost::math::tr1::nanf;
using boost::math::tr1::nanl;
using boost::math::tr1::nearbyint;
using boost::math::tr1::nearbyintf;
using boost::math::tr1::nearbyintl;
#endif
using boost::math::tr1::nextafter;
using boost::math::tr1::nextafterf;
using boost::math::tr1::nextafterl;
using boost::math::tr1::nexttoward;
using boost::math::tr1::nexttowardf;
using boost::math::tr1::nexttowardl;
#if 0
using boost::math::tr1::remainder;
using boost::math::tr1::remainderf;
using boost::math::tr1::remainderl;
using boost::math::tr1::remquo;
using boost::math::tr1::remquof;
using boost::math::tr1::remquol;
using boost::math::tr1::rint;
using boost::math::tr1::rintf;
using boost::math::tr1::rintl;
#endif
using boost::math::tr1::round;
using boost::math::tr1::roundf;
using boost::math::tr1::roundl;
#if 0
using boost::math::tr1::scalbln;
using boost::math::tr1::scalblnf;
using boost::math::tr1::scalblnl;
using boost::math::tr1::scalbn;
using boost::math::tr1::scalbnf;
using boost::math::tr1::scalbnl;
#endif
using boost::math::tr1::tgamma;
using boost::math::tr1::tgammaf;
using boost::math::tr1::tgammal;
using boost::math::tr1::trunc;
using boost::math::tr1::truncf;
using boost::math::tr1::truncl;
// C99 macros defined as C++ templates
using boost::math::tr1::signbit;
using boost::math::tr1::fpclassify;
using boost::math::tr1::isfinite;
using boost::math::tr1::isinf;
using boost::math::tr1::isnan;
using boost::math::tr1::isnormal;
#if 0
using boost::math::tr1::isgreater;
using boost::math::tr1::isgreaterequal;
using boost::math::tr1::isless;
using boost::math::tr1::islessequal;
using boost::math::tr1::islessgreater;
using boost::math::tr1::isunordered;
#endif
} } // namespaces
#endif // BOOST_HAS_TR1_CMATH
#endif // BOOST_TR1_CMATH_HPP_INCLUDED

View File

@ -0,0 +1,244 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_COMPLEX_HPP_INCLUDED
# define BOOST_TR1_COMPLEX_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
# include <complex>
#ifndef BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG
#include <boost/math/complex.hpp>
namespace std {
namespace tr1 {
using boost::math::acos;
using boost::math::asin;
using boost::math::atan;
using boost::math::acosh;
using boost::math::asinh;
using boost::math::atanh;
using boost::math::fabs;
} }
#else
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(complex)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(complex))
# endif
#endif
#ifndef BOOST_HAS_TR1_COMPLEX_OVERLOADS
#include <boost/tr1/detail/math_overloads.hpp>
#include <boost/assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/config/no_tr1/cmath.hpp>
namespace std{
#ifdef BOOST_NO_STDC_NAMESPACE
using :: atan2;
#endif
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template <class T>
inline BOOST_TR1_MATH_RETURN(double) arg(const T& t)
{
return ::std::atan2(0.0, static_cast<double>(t));
}
#else
inline double arg(const double& t)
{
return ::std::atan2(0.0, t);
}
#endif
inline long double arg(const long double& t)
{
return ::std::atan2(0.0L, static_cast<long double>(t));
}
inline float arg(const float& t)
{
return ::std::atan2(0.0F, static_cast<float>(t));
}
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template <class T>
inline BOOST_TR1_MATH_RETURN(double) norm(const T& t)
{
double r = static_cast<double>(t);
return r*r;
}
#else
inline double norm(const double& t)
{
return t*t;
}
#endif
inline long double norm(const long double& t)
{
long double l = t;
return l*l;
}
inline float norm(const float& t)
{
float f = t;
return f*f;
}
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template <class T>
inline BOOST_TR1_MATH_RETURN(std::complex<double>) conj(const T& t)
{
return ::std::conj(std::complex<double>(static_cast<double>(t)));
}
#else
inline std::complex<double> conj(const double& t)
{
return ::std::conj(std::complex<double>(t));
}
#endif
inline std::complex<long double> conj(const long double& t)
{
return ::std::conj(std::complex<long double>(t));
}
inline std::complex<float> conj(const float& t)
{
std::complex<float> ct(t);
ct = ::std::conj(ct);
return ct;
}
#if !BOOST_WORKAROUND(__BORLANDC__, <=0x570) && !BOOST_WORKAROUND(BOOST_MSVC, < 1310)
inline complex<double> polar(const char& rho, const char& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const unsigned char& rho, const unsigned char& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const signed char& rho, const signed char& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const short& rho, const short& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const unsigned short& rho, const unsigned short& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const int& rho, const int& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const unsigned int& rho, const unsigned int& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const long& rho, const long& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const unsigned long& rho, const unsigned long& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
#ifdef BOOST_HAS_LONG_LONG
inline complex<double> polar(const long long& rho, const long long& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const unsigned long long& rho, const unsigned long long& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
#elif defined(BOOST_HAS_MS_INT64)
inline complex<double> polar(const __int64& rho, const __int64& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
inline complex<double> polar(const unsigned __int64& rho, const unsigned __int64& theta = 0)
{ return ::std::polar(static_cast<double>(rho), static_cast<double>(theta)); }
#endif
template<class T, class U>
inline complex<typename boost::tr1_detail::promote_to_real<T, U>::type>
polar(const T& rho, const U& theta)
{
typedef typename boost::tr1_detail::promote_to_real<T, U>::type real_type;
return std::polar(static_cast<real_type>(rho), static_cast<real_type>(theta));
}
#endif
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template <class T>
inline BOOST_TR1_MATH_RETURN(double) imag(const T& )
{
return 0;
}
#else
inline double imag(const double& )
{
return 0;
}
#endif
inline long double imag(const long double& )
{
return 0;
}
inline float imag(const float& )
{
return 0;
}
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template <class T>
inline BOOST_TR1_MATH_RETURN(double) real(const T& t)
{
return static_cast<double>(t);
}
#else
inline double real(const double& t)
{
return t;
}
#endif
inline long double real(const long double& t)
{
return t;
}
inline float real(const float& t)
{
return t;
}
template<class T, class U>
inline complex<typename boost::tr1_detail::largest_real<T, U>::type>
pow(const complex<T>& x, const complex<U>& y)
{
typedef complex<typename boost::tr1_detail::largest_real<T, U>::type> result_type;
typedef typename boost::mpl::if_<boost::is_same<result_type, complex<T> >, result_type const&, result_type>::type cast1_type;
typedef typename boost::mpl::if_<boost::is_same<result_type, complex<U> >, result_type const&, result_type>::type cast2_type;
cast1_type x1(x);
cast2_type y1(y);
return std::pow(x1, y1);
}
template<class T, class U>
inline complex<typename boost::tr1_detail::promote_to_real<T, U>::type>
pow (const complex<T>& x, const U& y)
{
typedef typename boost::tr1_detail::promote_to_real<T, U>::type real_type;
typedef complex<typename boost::tr1_detail::promote_to_real<T, U>::type> result_type;
typedef typename boost::mpl::if_<boost::is_same<result_type, complex<T> >, result_type const&, result_type>::type cast1_type;
real_type r = y;
cast1_type x1(x);
std::complex<real_type> y1(r);
return std::pow(x1, y1);
}
template<class T, class U>
inline complex<typename boost::tr1_detail::promote_to_real<T, U>::type>
pow (const T& x, const complex<U>& y)
{
typedef typename boost::tr1_detail::promote_to_real<T, U>::type real_type;
typedef complex<typename boost::tr1_detail::promote_to_real<T, U>::type> result_type;
typedef typename boost::mpl::if_<boost::is_same<result_type, complex<U> >, result_type const&, result_type>::type cast_type;
real_type r = x;
std::complex<real_type> x1(r);
cast_type y1(y);
return std::pow(x1, y1);
}
}
#endif
#endif

View File

@ -0,0 +1,34 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_FUNCTOR_IT_HPP_INCLUDED
# define BOOST_TR1_FUNCTOR_IT_HPP_INCLUDED
# include <boost/iterator/iterator_facade.hpp>
namespace boost{ namespace tr1_details{
template <class Func, class R>
struct functor2iterator : boost::iterator_facade<functor2iterator<Func,R>, const R, std::input_iterator_tag>
{
functor2iterator() : m_func(0){}
functor2iterator(Func& f)
: m_func(&f)
{
m_val = (*m_func)();
}
const R& dereference()const
{ return m_val; }
void increment(){ m_val = (*m_func)(); }
bool equal(const functor2iterator&)const
{ return false; }
private:
Func* m_func;
R m_val;
};
} }
#endif

View File

@ -0,0 +1,58 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_MATH_OVERLOADS_HPP_INCLUDED
# define BOOST_TR1_MATH_OVERLOADS_HPP_INCLUDED
# include <boost/config.hpp>
# ifndef BOOST_NO_SFINAE
# include <boost/utility/enable_if.hpp>
# include <boost/type_traits/is_convertible.hpp>
# define BOOST_TR1_MATH_RETURN(RET) typename ::boost::enable_if< ::boost::is_convertible<T,double>, RET >::type
# else
# define BOOST_TR1_MATH_RETURN(RET) RET
# endif
# include <boost/type_traits/is_floating_point.hpp>
# include <boost/type_traits/is_same.hpp>
# include <boost/mpl/if.hpp>
namespace boost{ namespace tr1_detail{
template <class T, class U>
struct largest_real
{
typedef typename boost::mpl::if_<
boost::is_same<long double, T>,
long double,
typename boost::mpl::if_<
boost::is_same<long double, U>,
long double,
typename boost::mpl::if_<
boost::is_same<double, T>,
double,
typename boost::mpl::if_<
boost::is_same<double, U>,
double,
float
>::type
>::type
>::type
>::type type;
};
template <class T, class U>
struct promote_to_real
{
typedef typename largest_real<
typename boost::mpl::if_< boost::is_floating_point<T>, T, double>::type,
typename boost::mpl::if_< boost::is_floating_point<U>, U, double>::type
>::type type;
};
} }
#endif

View File

@ -0,0 +1,137 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_FUNCTIONAL_HPP_INCLUDED
# define BOOST_TR1_FUNCTIONAL_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
# include <functional>
#if defined(BOOST_HAS_TR1_REFERENCE_WRAPPER) \
|| defined(BOOST_HAS_TR1_RESULT_OF)\
|| defined(BOOST_HAS_TR1_MEM_FN)\
|| defined(BOOST_HAS_TR1_BIND)\
|| defined(BOOST_HAS_TR1_FUNCTION)\
|| defined(BOOST_HAS_TR1_HASH)
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(functional)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(functional))
# endif
#endif
#ifndef BOOST_HAS_TR1_REFERENCE_WRAPPER
#include <boost/ref.hpp>
namespace std{ namespace tr1{
using ::boost::reference_wrapper;
using ::boost::ref;
using ::boost::cref;
} }
#endif // BOOST_HAS_TR1_REFERENCE_WRAPPER
#if !defined(BOOST_HAS_TR1_RESULT_OF)\
&& !defined(BOOST_NO_SFINAE) && \
!defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
//
// we can only actually include result_of.hpp if the compiler
// really does support it, otherwise we just get endless errors...
//
#include <boost/utility/result_of.hpp>
namespace std{ namespace tr1{
using ::boost::result_of;
} }
#endif // BOOST_HAS_TR1_RESULT_OF
#ifndef BOOST_HAS_TR1_MEM_FN
// mem_fn:
#include <boost/mem_fn.hpp>
namespace std{ namespace tr1{
using boost::mem_fn;
} }
#endif // BOOST_HAS_TR1_MEM_FN
#ifndef BOOST_HAS_TR1_BIND
// Bind:
#include <boost/bind.hpp>
namespace std{ namespace tr1{
using ::boost::is_bind_expression;
using ::boost::is_placeholder;
using ::boost::bind;
namespace placeholders {
#ifndef BOOST_BIND_NO_PLACEHOLDERS
using ::_1;
using ::_2;
using ::_3;
using ::_4;
using ::_5;
using ::_6;
using ::_7;
using ::_8;
using ::_9;
#endif
} // placeholders
} }
#endif
#ifndef BOOST_HAS_TR1_FUNCTION
// polymorphic function object wrappers:
#include <boost/function.hpp>
#include <boost/detail/workaround.hpp>
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x582) \
&& !BOOST_WORKAROUND(BOOST_MSVC, < 1310) \
&& !defined(BOOST_FUNCTION_NO_FUNCTION_TYPE_SYNTAX)
namespace std{ namespace tr1{
using ::boost::bad_function_call;
using ::boost::function;
using ::boost::swap;
}}
#endif
#endif // BOOST_HAS_TR1_FUNCTION
#ifndef BOOST_HAS_TR1_HASH
//
// This header can get included by boost/hash.hpp
// leading to cyclic dependencies. As a workaround
// we forward declare boost::hash and include
// the actual header later.
//
namespace boost{
template <class T> struct hash;
}
namespace std{ namespace tr1{
using ::boost::hash;
}}
#include <boost/functional/hash.hpp>
#endif
#endif

View File

@ -0,0 +1,72 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_MEMORY_HPP_INCLUDED
# define BOOST_TR1_MEMORY_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
# include <boost/detail/workaround.hpp>
# include <memory>
#ifndef BOOST_HAS_TR1_SHARED_PTR
//
// This header can get included by boost/shared_ptr.hpp which leads
// to cyclic dependencies, the workaround is to forward declare all
// the boost components, and then include the actual headers afterwards.
// This is fragile, but seems to work, and doesn't require modification
// of boost/shared_ptr.hpp.
//
namespace boost{
class bad_weak_ptr;
template<class T> class weak_ptr;
template<class T> class shared_ptr;
template<class T> void swap(weak_ptr<T> & a, weak_ptr<T> & b);
template<class T> void swap(shared_ptr<T> & a, shared_ptr<T> & b);
template<class T, class U> shared_ptr<T> static_pointer_cast(shared_ptr<U> const & r);
template<class T, class U> shared_ptr<T> dynamic_pointer_cast(shared_ptr<U> const & r);
template<class T, class U> shared_ptr<T> const_pointer_cast(shared_ptr<U> const & r);
template<class D, class T> D * get_deleter(shared_ptr<T> const & p);
template<class T> class enable_shared_from_this;
namespace detail{
class shared_count;
class weak_count;
}
}
namespace std{ namespace tr1{
using ::boost::bad_weak_ptr;
using ::boost::shared_ptr;
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
using ::boost::swap;
#endif
using ::boost::static_pointer_cast;
using ::boost::dynamic_pointer_cast;
using ::boost::const_pointer_cast;
using ::boost::get_deleter;
using ::boost::weak_ptr;
using ::boost::enable_shared_from_this;
} }
#include <boost/shared_ptr.hpp>
#include <boost/weak_ptr.hpp>
#include <boost/enable_shared_from_this.hpp>
#else
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(memory)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(memory))
# endif
#endif
#endif

View File

@ -0,0 +1,586 @@
// (C) Copyright John Maddock 2005.
// (C) Copyright Henry S. Warren 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_RANDOM_HPP_INCLUDED
# define BOOST_TR1_RANDOM_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
#ifdef BOOST_HAS_TR1_RANDOM
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(random)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(random))
# endif
#else
// Boost.Random:
#include <boost/random.hpp>
#ifndef __SUNPRO_CC
// Sunpros linker complains if we so much as include this...
# include <boost/nondet_random.hpp>
#endif
#include <boost/tr1/detail/functor2iterator.hpp>
#include <boost/type_traits/is_fundamental.hpp>
#include <boost/type_traits/is_same.hpp>
namespace std { namespace tr1{
using ::boost::variate_generator;
template<class UIntType, UIntType a, UIntType c, UIntType m>
class linear_congruential
{
private:
typedef ::boost::random::linear_congruential<UIntType, a, c, m, 0> impl_type;
public:
// types
typedef UIntType result_type;
// parameter values
BOOST_STATIC_CONSTANT(UIntType, multiplier = a);
BOOST_STATIC_CONSTANT(UIntType, increment = c);
BOOST_STATIC_CONSTANT(UIntType, modulus = m);
// constructors and member function
explicit linear_congruential(unsigned long x0 = 1)
: m_gen(x0){}
linear_congruential(const linear_congruential& that)
: m_gen(that.m_gen){}
template<class Gen> linear_congruential(Gen& g)
{
init1(g, ::boost::is_same<Gen,linear_congruential>());
}
void seed(unsigned long x0 = 1)
{ m_gen.seed(x0); }
template<class Gen> void seed(Gen& g)
{
init2(g, ::boost::is_fundamental<Gen>());
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.max)(); }
result_type operator()()
{
return m_gen();
}
bool operator==(const linear_congruential& that)const
{ return m_gen == that.m_gen; }
bool operator!=(const linear_congruential& that)const
{ return m_gen != that.m_gen; }
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const linear_congruential& lcg)
{
return os << lcg.m_gen;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
linear_congruential& lcg)
{
return is >> lcg.m_gen;
}
#endif
private:
template <class Gen>
void init1(Gen& g, const ::boost::true_type&)
{
m_gen = g.m_gen;
}
template <class Gen>
void init1(Gen& g, const ::boost::false_type&)
{
init2(g, ::boost::is_fundamental<Gen>());
}
template <class Gen>
void init2(Gen& g, const ::boost::true_type&)
{
m_gen.seed(static_cast<unsigned long>(g));
}
template <class Gen>
void init2(Gen& g, const ::boost::false_type&)
{
//typedef typename Gen::result_type gen_rt;
boost::tr1_details::functor2iterator<Gen, unsigned long> f1(g), f2;
m_gen.seed(f1, f2);
}
impl_type m_gen;
};
template<class UIntType, int w, int n, int m, int r,
UIntType a, int u, int s, UIntType b, int t, UIntType c, int l>
class mersenne_twister
{
typedef ::boost::random::mersenne_twister
<UIntType, w, n, m, r, a, u, s, b, t, c, l, 0> imp_type;
public:
// types
typedef UIntType result_type;
// parameter values
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(int, state_size = n);
BOOST_STATIC_CONSTANT(int, shift_size = m);
BOOST_STATIC_CONSTANT(int, mask_bits = r);
BOOST_STATIC_CONSTANT(UIntType, parameter_a = a);
BOOST_STATIC_CONSTANT(int, output_u = u);
BOOST_STATIC_CONSTANT(int, output_s = s);
BOOST_STATIC_CONSTANT(UIntType, output_b = b);
BOOST_STATIC_CONSTANT(int, output_t = t);
BOOST_STATIC_CONSTANT(UIntType, output_c = c);
BOOST_STATIC_CONSTANT(int, output_l = l);
// constructors and member function
mersenne_twister(){}
explicit mersenne_twister(unsigned long value)
: m_gen(value == 0 ? 5489UL : value){}
template<class Gen> mersenne_twister(Gen& g)
{
init1(g, ::boost::is_same<mersenne_twister,Gen>());
}
void seed()
{ m_gen.seed(); }
void seed(unsigned long value)
{ m_gen.seed(value == 0 ? 5489UL : value); }
template<class Gen> void seed(Gen& g)
{ init2(g, ::boost::is_fundamental<Gen>()); }
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.max)(); }
result_type operator()()
{ return m_gen(); }
bool operator==(const mersenne_twister& that)const
{ return m_gen == that.m_gen; }
bool operator!=(const mersenne_twister& that)const
{ return m_gen != that.m_gen; }
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const mersenne_twister& lcg)
{
return os << lcg.m_gen;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
mersenne_twister& lcg)
{
return is >> lcg.m_gen;
}
#endif
private:
template <class Gen>
void init1(Gen& g, const ::boost::true_type&)
{
m_gen = g.m_gen;
}
template <class Gen>
void init1(Gen& g, const ::boost::false_type&)
{
init2(g, ::boost::is_fundamental<Gen>());
}
template <class Gen>
void init2(Gen& g, const ::boost::true_type&)
{
m_gen.seed(static_cast<unsigned long>(g == 0 ? 4357UL : g));
}
template <class Gen>
void init2(Gen& g, const ::boost::false_type&)
{
m_gen.seed(g);
}
imp_type m_gen;
};
template<class IntType, IntType m, int s, int r>
class subtract_with_carry
{
public:
// types
typedef IntType result_type;
// parameter values
BOOST_STATIC_CONSTANT(IntType, modulus = m);
BOOST_STATIC_CONSTANT(int, long_lag = r);
BOOST_STATIC_CONSTANT(int, short_lag = s);
// constructors and member function
subtract_with_carry(){}
explicit subtract_with_carry(unsigned long value)
: m_gen(value == 0 ? 19780503UL : value){}
template<class Gen> subtract_with_carry(Gen& g)
{ init1(g, ::boost::is_same<Gen, subtract_with_carry<IntType, m, s, r> >()); }
void seed(unsigned long value = 19780503ul)
{ m_gen.seed(value == 0 ? 19780503UL : value); }
template<class Gen> void seed(Gen& g)
{ init2(g, ::boost::is_fundamental<Gen>()); }
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.max)(); }
result_type operator()()
{ return m_gen(); }
bool operator==(const subtract_with_carry& that)const
{ return m_gen == that.m_gen; }
bool operator!=(const subtract_with_carry& that)const
{ return m_gen != that.m_gen; }
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const subtract_with_carry& lcg)
{
return os << lcg.m_gen;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
subtract_with_carry& lcg)
{
return is >> lcg.m_gen;
}
#endif
private:
template <class Gen>
void init1(Gen& g, const ::boost::true_type&)
{
m_gen = g.m_gen;
}
template <class Gen>
void init1(Gen& g, const ::boost::false_type&)
{
init2(g, ::boost::is_fundamental<Gen>());
}
template <class Gen>
void init2(Gen& g, const ::boost::true_type&)
{
m_gen.seed(static_cast<unsigned long>(g == 0 ? 19780503UL : g));
}
template <class Gen>
void init2(Gen& g, const ::boost::false_type&)
{
m_gen.seed(g);
}
::boost::random::subtract_with_carry<IntType, m, s, r, 0> m_gen;
};
template<class RealType, int w, int s, int r>
class subtract_with_carry_01
{
public:
// types
typedef RealType result_type;
// parameter values
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(int, long_lag = r);
BOOST_STATIC_CONSTANT(int, short_lag = s);
// constructors and member function
subtract_with_carry_01(){}
explicit subtract_with_carry_01(unsigned long value)
: m_gen(value == 0 ? 19780503UL : value){}
template<class Gen> subtract_with_carry_01(Gen& g)
{ init1(g, ::boost::is_same<Gen, subtract_with_carry_01<RealType, w, s, r> >()); }
void seed(unsigned long value = 19780503UL)
{ m_gen.seed(value == 0 ? 19780503UL : value); }
template<class Gen> void seed(Gen& g)
{ init2(g, ::boost::is_fundamental<Gen>()); }
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return (m_gen.max)(); }
result_type operator()()
{ return m_gen(); }
bool operator==(const subtract_with_carry_01& that)const
{ return m_gen == that.m_gen; }
bool operator!=(const subtract_with_carry_01& that)const
{ return m_gen != that.m_gen; }
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const subtract_with_carry_01& lcg)
{
return os << lcg.m_gen;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
subtract_with_carry_01& lcg)
{
return is >> lcg.m_gen;
}
#endif
private:
template <class Gen>
void init1(Gen& g, const ::boost::true_type&)
{
m_gen = g.m_gen;
}
template <class Gen>
void init1(Gen& g, const ::boost::false_type&)
{
init2(g, ::boost::is_fundamental<Gen>());
}
template <class Gen>
void init2(Gen& g, const ::boost::true_type&)
{
m_gen.seed(static_cast<unsigned long>(g == 0 ? 19780503UL : g));
}
template <class Gen>
void init2(Gen& g, const ::boost::false_type&)
{
//typedef typename Gen::result_type gen_rt;
boost::tr1_details::functor2iterator<Gen, unsigned long> f1(g), f2;
m_gen.seed(f1, f2);
}
::boost::random::subtract_with_carry_01<RealType, w, s, r, 0> m_gen;
};
using ::boost::random::discard_block;
template<class UniformRandomNumberGenerator1, int s1, class UniformRandomNumberGenerator2, int s2>
class xor_combine
{
public:
// types
typedef UniformRandomNumberGenerator1 base1_type;
typedef UniformRandomNumberGenerator2 base2_type;
typedef unsigned long result_type;
// parameter values
BOOST_STATIC_CONSTANT(int, shift1 = s1);
BOOST_STATIC_CONSTANT(int, shift2 = s2);
// constructors and member function
xor_combine(){ init_minmax(); }
xor_combine(const base1_type & rng1, const base2_type & rng2)
: m_b1(rng1), m_b2(rng2) { init_minmax(); }
xor_combine(unsigned long s)
: m_b1(s), m_b2(s+1) { init_minmax(); }
template<class Gen> xor_combine(Gen& g)
{
init_minmax();
init1(g, ::boost::is_same<Gen, xor_combine<UniformRandomNumberGenerator1, s1, UniformRandomNumberGenerator2, s2> >());
}
void seed()
{
m_b1.seed();
m_b2.seed();
}
void seed(unsigned long s)
{
m_b1.seed(s);
m_b2.seed(s+1);
}
template<class Gen> void seed(Gen& g)
{
init2(g, ::boost::is_fundamental<Gen>());
}
const base1_type& base1() const
{ return m_b1; }
const base2_type& base2() const
{ return m_b2; }
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return m_min; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION() const
{ return m_max; }
result_type operator()()
{ return (m_b1() << s1) ^ (m_b2() << s2); }
bool operator == (const xor_combine& that)const
{ return (m_b1 == that.m_b1) && (m_b2 == that.m_b2); }
bool operator != (const xor_combine& that)const
{ return !(*this == that); }
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const xor_combine& lcg)
{
return os << lcg.m_b1 << " " << lcg.m_b2;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
xor_combine& lcg)
{
return is >> lcg.m_b1 >> lcg.m_b2;
}
#endif
private:
void init_minmax();
base1_type m_b1;
base2_type m_b2;
result_type m_min;
result_type m_max;
template <class Gen>
void init1(Gen& g, const ::boost::true_type&)
{
m_b1 = g.m_b1;
m_b2 = g.m_b2;
}
template <class Gen>
void init1(Gen& g, const ::boost::false_type&)
{
init2(g, ::boost::is_fundamental<Gen>());
}
template <class Gen>
void init2(Gen& g, const ::boost::true_type&)
{
m_b1.seed(static_cast<unsigned long>(g));
m_b2.seed(static_cast<unsigned long>(g));
}
template <class Gen>
void init2(Gen& g, const ::boost::false_type&)
{
m_b1.seed(g);
m_b2.seed(g);
}
};
template<class UniformRandomNumberGenerator1, int s1, class UniformRandomNumberGenerator2, int s2>
void xor_combine<UniformRandomNumberGenerator1, s1, UniformRandomNumberGenerator2, s2>::init_minmax()
{
//
// The following code is based on that given in "Hacker's Delight"
// by Henry S. Warren, (Addison-Wesley, 2003), and at
// http://www.hackersdelight.org/index.htm.
// Used here by permission.
//
// calculation of minimum value:
//
result_type a = (m_b1.min)() << s1;
result_type b = (m_b1.max)() << s1;
result_type c = (m_b2.min)() << s2;
result_type d = (m_b2.max)() << s2;
result_type m, temp;
m = 0x1uL << ((sizeof(result_type) * CHAR_BIT) - 1);
while (m != 0) {
if (~a & c & m) {
temp = (a | m) & (static_cast<result_type>(0u) - m);
if (temp <= b) a = temp;
}
else if (a & ~c & m) {
temp = (c | m) & (static_cast<result_type>(0u) - m);
if (temp <= d) c = temp;
}
m >>= 1;
}
m_min = a ^ c;
//
// calculation of maximum value:
//
if((((std::numeric_limits<result_type>::max)() >> s1) < (m_b1.max)())
|| ((((std::numeric_limits<result_type>::max)()) >> s2) < (m_b2.max)()))
{
m_max = (std::numeric_limits<result_type>::max)();
return;
}
a = (m_b1.min)() << s1;
b = (m_b1.max)() << s1;
c = (m_b2.min)() << s2;
d = (m_b2.max)() << s2;
m = 0x1uL << ((sizeof(result_type) * CHAR_BIT) - 1);
while (m != 0) {
if (b & d & m) {
temp = (b - m) | (m - 1);
if (temp >= a) b = temp;
else {
temp = (d - m) | (m - 1);
if (temp >= c) d = temp;
}
}
m = m >> 1;
}
m_max = b ^ d;
}
typedef linear_congruential< ::boost::int32_t, 16807, 0, 2147483647> minstd_rand0;
typedef linear_congruential< ::boost::int32_t, 48271, 0, 2147483647> minstd_rand;
typedef mersenne_twister< ::boost::uint32_t, 32,624,397,31,0x9908b0df,11,7,0x9d2c5680,15,0xefc60000,18> mt19937;
typedef subtract_with_carry_01<float, 24, 10, 24> ranlux_base_01;
typedef subtract_with_carry_01<double, 48, 10, 24> ranlux64_base_01;
typedef discard_block<subtract_with_carry< ::boost::int32_t, (1<<24), 10, 24>, 223, 24> ranlux3;
typedef discard_block<subtract_with_carry< ::boost::int32_t, (1<<24), 10, 24>, 389, 24> ranlux4;
typedef discard_block<subtract_with_carry_01<float, 24, 10, 24>, 223, 24> ranlux3_01;
typedef discard_block<subtract_with_carry_01<float, 24, 10, 24>, 389, 24> ranlux4_01;
#ifndef __SUNPRO_CC
using ::boost::random_device;
#endif
using ::boost::uniform_int;
class bernoulli_distribution
{
public:
// types
typedef int input_type;
typedef bool result_type;
// constructors and member function
explicit bernoulli_distribution(double p = 0.5)
: m_dist(p){}
double p() const
{ return m_dist.p(); }
void reset()
{ m_dist.reset(); }
template<class UniformRandomNumberGenerator>
result_type operator()(UniformRandomNumberGenerator& urng)
{
return m_dist(urng);
}
#if !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const bernoulli_distribution& lcg)
{
return os << lcg.m_dist;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
bernoulli_distribution& lcg)
{
return is >> lcg.m_dist;
}
#endif
private:
::boost::bernoulli_distribution<double> m_dist;
};
//using ::boost::bernoulli_distribution;
using ::boost::geometric_distribution;
using ::boost::poisson_distribution;
using ::boost::binomial_distribution;
using ::boost::uniform_real;
using ::boost::exponential_distribution;
using ::boost::normal_distribution;
using ::boost::gamma_distribution;
} }
#endif
#endif

View File

@ -0,0 +1,147 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_TR1_REGEX_HPP_INCLUDED
# define BOOST_TR1_REGEX_HPP_INCLUDED
# include <boost/tr1/detail/config.hpp>
#ifdef BOOST_HAS_TR1_REGEX
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next BOOST_TR1_HEADER(regex)
# else
# include <boost/tr1/detail/config_all.hpp>
# include BOOST_TR1_STD_HEADER(BOOST_TR1_PATH(regex))
# endif
#else
#include <boost/regex.hpp>
namespace std{ namespace tr1{
// [7.5] Regex constants
namespace regex_constants {
using ::boost::regex_constants::syntax_option_type;
using ::boost::regex_constants::icase;
using ::boost::regex_constants::nosubs;
using ::boost::regex_constants::optimize;
using ::boost::regex_constants::collate;
using ::boost::regex_constants::ECMAScript;
using ::boost::regex_constants::basic;
using ::boost::regex_constants::extended;
using ::boost::regex_constants::awk;
using ::boost::regex_constants::grep;
using ::boost::regex_constants::egrep;
using ::boost::regex_constants::match_flag_type;
using ::boost::regex_constants::match_default;
using ::boost::regex_constants::match_not_bol;
using ::boost::regex_constants::match_not_eol;
using ::boost::regex_constants::match_not_bow;
using ::boost::regex_constants::match_not_eow;
using ::boost::regex_constants::match_any;
using ::boost::regex_constants::match_not_null;
using ::boost::regex_constants::match_continuous;
using ::boost::regex_constants::match_prev_avail;
using ::boost::regex_constants::format_default;
using ::boost::regex_constants::format_sed;
using ::boost::regex_constants::format_no_copy;
using ::boost::regex_constants::format_first_only;
using ::boost::regex_constants::error_type;
using ::boost::regex_constants::error_collate;
using ::boost::regex_constants::error_ctype;
using ::boost::regex_constants::error_escape;
using ::boost::regex_constants::error_backref;
using ::boost::regex_constants::error_brack;
using ::boost::regex_constants::error_paren;
using ::boost::regex_constants::error_brace;
using ::boost::regex_constants::error_badbrace;
using ::boost::regex_constants::error_range;
using ::boost::regex_constants::error_space;
using ::boost::regex_constants::error_badrepeat;
using ::boost::regex_constants::error_complexity;
using ::boost::regex_constants::error_stack;
} // namespace regex_constants
// [7.6] Class regex_error
using ::boost::regex_error;
// [7.7] Class template regex_traits
using ::boost::regex_traits;
// [7.8] Class template basic_regex
using ::boost::basic_regex;
using ::boost::regex;
#ifndef BOOST_NO_WREGEX
using ::boost::wregex;
#endif
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x0582)
// [7.8.6] basic_regex swap
using ::boost::swap;
#endif
// [7.9] Class template sub_match
using ::boost::sub_match;
using ::boost::csub_match;
#ifndef BOOST_NO_WREGEX
using ::boost::wcsub_match;
#endif
using ::boost::ssub_match;
#ifndef BOOST_NO_WREGEX
using ::boost::wssub_match;
#endif
// [7.10] Class template match_results
using ::boost::match_results;
using ::boost::cmatch;
#ifndef BOOST_NO_WREGEX
using ::boost::wcmatch;
#endif
using ::boost::smatch;
#ifndef BOOST_NO_WREGEX
using ::boost::wsmatch;
#endif
using ::boost::regex_match;
// [7.11.3] Function template regex_search
using ::boost::regex_search;
// [7.11.4] Function template regex_replace
using ::boost::regex_replace;
// [7.12.1] Class template regex_iterator
using ::boost::regex_iterator;
using ::boost::cregex_iterator;
#ifndef BOOST_NO_WREGEX
using ::boost::wcregex_iterator;
#endif
using ::boost::sregex_iterator;
#ifndef BOOST_NO_WREGEX
using ::boost::wsregex_iterator;
#endif
// [7.12.2] Class template regex_token_iterator
using ::boost::regex_token_iterator;
using ::boost::cregex_token_iterator;
#ifndef BOOST_NO_WREGEX
using ::boost::wcregex_token_iterator;
#endif
using ::boost::sregex_token_iterator;
#ifndef BOOST_NO_WREGEX
using ::boost::wsregex_token_iterator;
#endif
} } // namespaces
#endif
#endif

View File

@ -0,0 +1,27 @@
// (C) Copyright John Maddock 2005.
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// This file exists to prevent std lib headers from accidentally
// including a TR1 extention header; we must suppress this otherwise
// we can end up with cyclic dependencies with some std lib implementations.
//
#ifndef BOOST_TR1_algorithm_INCLUDED
# define BOOST_TR1_algorithm_INCLUDED
# ifndef BOOST_TR1_NO_RECURSION
# define BOOST_TR1_NO_RECURSION
# define BOOST_TR1_NO_algorithm_RECURSION
# endif
# include <boost/tr1/detail/config_all.hpp>
# ifdef BOOST_HAS_INCLUDE_NEXT
# include_next <algorithm>
# else
# include BOOST_TR1_STD_HEADER(algorithm)
# endif
# ifdef BOOST_TR1_NO_algorithm_RECURSION
# undef BOOST_TR1_NO_algorithm_RECURSION
# undef BOOST_TR1_NO_RECURSION
# endif
#endif

Some files were not shown because too many files have changed in this diff Show More