merge new MPL version from 'mplbook' branch

[SVN r24874]
This commit is contained in:
Aleksey Gurtovoy
2004-09-02 15:41:37 +00:00
parent e2e70427cc
commit 1689c8ef83
1216 changed files with 89913 additions and 36752 deletions
+18 -19
View File
@@ -1,28 +1,28 @@
//-----------------------------------------------------------------------------
// boost fsm/handler.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the 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_FSM_HANDLER_INCLUDED
#define BOOST_FSM_HANDLER_INCLUDED
#include "boost/mpl/if.hpp"
#include "boost/mpl/fold.hpp"
#include "boost/mpl/front.hpp"
#include "boost/type_traits/is_same.hpp"
// 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.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/if.hpp>
#include <boost/mpl/fold.hpp>
#include <boost/mpl/front.hpp>
#include <boost/type_traits/is_same.hpp>
#include <typeinfo>
#include <cassert>
namespace fsm {
namespace aux {
namespace fsm { namespace aux {
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
@@ -140,7 +140,6 @@ struct STT_impl_gen
> type;
};
} // namespace aux
} // namespace fsm
}}
#endif // BOOST_FSM_HANDLER_INCLUDED
+14 -15
View File
@@ -1,22 +1,22 @@
//-----------------------------------------------------------------------------
// boost fsm/base_event.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the 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_FSM_BASE_EVENT_INCLUDED
#define BOOST_FSM_BASE_EVENT_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.
// $Source$
// $Date$
// $Revision$
#include <memory>
namespace fsm {
namespace aux {
namespace fsm { namespace aux {
// represent an abstract base for FSM events
@@ -34,7 +34,6 @@ struct base_event
virtual std::auto_ptr<base_event> do_clone() const = 0;
};
} // namespace aux
} // namespace fsm
}}
#endif // BOOST_FSM_BASE_EVENT_INCLUDED
+14 -15
View File
@@ -1,22 +1,22 @@
//-----------------------------------------------------------------------------
// boost fsm/event.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the 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_FSM_EVENT_INCLUDED
#define BOOST_FSM_EVENT_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.
// $Source$
// $Date$
// $Revision$
#include "base_event.hpp"
namespace fsm {
namespace aux {
namespace fsm { namespace aux {
template< typename Derived >
struct event
@@ -34,7 +34,6 @@ struct event
}
};
} // namespace aux
} // namespace fsm
}}
#endif // BOOST_FSM_EVENT_INCLUDED
+15 -16
View File
@@ -1,22 +1,22 @@
//-----------------------------------------------------------------------------
// boost fsm/state.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the 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_FSM_STATE_INCLUDED
#define BOOST_FSM_STATE_INCLUDED
#include "boost/mpl/integral_c.hpp"
// 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.
namespace fsm {
namespace aux {
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/integral_c.hpp>
namespace fsm { namespace aux {
namespace mpl = boost::mpl;
@@ -37,7 +37,6 @@ struct state
}
};
} // namespace aux
} // namespace fsm
}}
#endif // BOOST_FSM_STATE_INCLUDED
+14 -15
View File
@@ -1,22 +1,22 @@
//-----------------------------------------------------------------------------
// boost fsm/transition.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the 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_FSM_TRANSITION_INCLUDED
#define BOOST_FSM_TRANSITION_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.
// $Source$
// $Date$
// $Revision$
#include <cassert>
namespace fsm {
namespace aux {
namespace fsm { namespace aux {
// represent a signle transition between states |From| and |To|
@@ -42,7 +42,6 @@ struct transition
}
};
} // namespace aux
} // namespace fsm
}}
#endif // BOOST_FSM_TRANSITION_INCLUDED
+11 -10
View File
@@ -1,17 +1,18 @@
//-----------------------------------------------------------------------------
// boost fsm/example/player.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
// Copyright Aleksey Gurtovoy 2002-2004
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// Distributed under the Boost Software License, Version 1.0.
// (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.
// $Source$
// $Date$
// $Revision$
#include "state_machine.hpp"
#include "boost/mpl/list.hpp"
#include <boost/mpl/list.hpp>
#include <iostream>
+13 -12
View File
@@ -1,23 +1,24 @@
//-----------------------------------------------------------------------------
// boost fsm/state_machine.hpp header file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the 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_FSM_STATE_MACHINE_INCLUDED
#define BOOST_FSM_STATE_MACHINE_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.
// $Source$
// $Date$
// $Revision$
#include "aux_/event.hpp"
#include "aux_/state.hpp"
#include "aux_/transition.hpp"
#include "aux_/STT_impl_gen.hpp"
#include "boost/shared_ptr.hpp"
#include <boost/shared_ptr.hpp>
#include <queue>
#include <memory>
+15 -14
View File
@@ -1,18 +1,19 @@
//-----------------------------------------------------------------------------
// boost mpl/example/inherit_linearly.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "boost/mpl/inherit_linearly.hpp"
#include "boost/mpl/int.hpp"
#include "boost/mpl/list.hpp"
// 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.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/inherit_linearly.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/list.hpp>
#include <iostream>
+15 -14
View File
@@ -1,18 +1,19 @@
//-----------------------------------------------------------------------------
// boost mpl/example/inherit_multiply.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "boost/mpl/inherit.hpp"
#include "boost/mpl/inherit_linearly.hpp"
#include "boost/mpl/list.hpp"
// 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.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/inherit.hpp>
#include <boost/mpl/inherit_linearly.hpp>
#include <boost/mpl/list.hpp>
#include <iostream>
+33 -30
View File
@@ -1,27 +1,30 @@
//-----------------------------------------------------------------------------
// boost mpl/example/integer.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2001-02
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "boost/mpl/multiplies.hpp"
#include "boost/mpl/list.hpp"
#include "boost/mpl/lower_bound.hpp"
#include "boost/mpl/transform_view.hpp"
#include "boost/mpl/sizeof.hpp"
#include "boost/mpl/int.hpp"
#include "boost/mpl/identity.hpp"
#include "boost/mpl/base.hpp"
#include "boost/mpl/apply_if.hpp"
#include "boost/mpl/apply.hpp"
#include "boost/mpl/begin_end.hpp"
#include "boost/mpl/assert_is_same.hpp"
// 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.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/multiplies.hpp>
#include <boost/mpl/list.hpp>
#include <boost/mpl/lower_bound.hpp>
#include <boost/mpl/transform_view.hpp>
#include <boost/mpl/sizeof.hpp>
#include <boost/mpl/int.hpp>
#include <boost/mpl/identity.hpp>
#include <boost/mpl/base.hpp>
#include <boost/mpl/eval_if.hpp>
#include <boost/mpl/deref.hpp>
#include <boost/mpl/begin_end.hpp>
#include <boost/mpl/assert.hpp>
#include <boost/type_traits/is_same.hpp>
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
@@ -44,10 +47,10 @@ struct integer
>::type >::type iter_;
typedef typename mpl::end<builtins_>::type last_;
typedef typename mpl::apply_if<
typedef typename mpl::eval_if<
boost::is_same<iter_,last_>
, mpl::identity< big_int<bit_size> >
, mpl::apply0<iter_>
, mpl::deref<iter_>
>::type type;
};
@@ -57,8 +60,8 @@ typedef integer<15>::type int15;
typedef integer<32>::type int32;
typedef integer<100>::type int100;
BOOST_MPL_ASSERT_IS_SAME(int1, char);
BOOST_MPL_ASSERT_IS_SAME(int5, char);
BOOST_MPL_ASSERT_IS_SAME(int15, short);
BOOST_MPL_ASSERT_IS_SAME(int32, int);
BOOST_MPL_ASSERT_IS_SAME(int100, big_int<100>);
BOOST_MPL_ASSERT(( boost::is_same< int1, char > ));
BOOST_MPL_ASSERT(( boost::is_same< int5, char > ));
BOOST_MPL_ASSERT(( boost::is_same< int15, short > ));
BOOST_MPL_ASSERT(( boost::is_same< int32, int > ));
BOOST_MPL_ASSERT(( boost::is_same< int100, big_int<100> > ));
-74
View File
@@ -1,74 +0,0 @@
//-----------------------------------------------------------------------------
// boost mpl/example/lambda2.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "boost/mpl/v2_1.hpp"
#include "boost/mpl/not.hpp"
#include "boost/mpl/or.hpp"
#include "boost/mpl/less.hpp"
#include "boost/mpl/equal_to.hpp"
#include "boost/mpl/multiplies.hpp"
#include "boost/mpl/prior.hpp"
#include "boost/mpl/find_if.hpp"
#include "boost/mpl/count_if.hpp"
#include "boost/mpl/filter_view.hpp"
#include "boost/mpl/sizeof.hpp"
#include "boost/static_assert.hpp"
namespace mpl = boost::mpl;
using namespace mpl::placeholders;
using namespace mpl::v2_1;
typedef EVAL(apply_(lambda(is_same(_,_)), int, int)) r;
BOOST_STATIC_ASSERT(r::value);
typedef eval<
count_if(
list(int,char,long,int)
, lambda(is_same(_,int))
)
>::type res;
BOOST_STATIC_ASSERT(res::value == 2);
typedef eval<
find_if(
filter_view(
list(int,float,char,long,double)
, lambda(not_(is_float(_)))
)
, lambda( or_(
is_same(_,short)
, less(sizeof_(_),sizeof_(int))
) )
)
>::type iter;
typedef eval< is_same(iter::type,char) >::type res2;
BOOST_STATIC_ASSERT(res2::value);
METAFUNCTION(factorial, (N)
, if_( equal_to( N, int_<0> )
, int_<1>
, multiplies( N, factorial( prior(N) ) )
)
)
typedef EVAL(factorial(int_<1>)) fact;
//BOOST_STATIC_ASSERT(fact::value == 1);
+16 -16
View File
@@ -1,26 +1,26 @@
//-----------------------------------------------------------------------------
// boost mpl/example/tuple_from_list.cpp source file
// See http://www.boost.org for updates, documentation, and revision history.
//-----------------------------------------------------------------------------
//
// Copyright (c) 2002
// Aleksey Gurtovoy
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#include "boost/mpl/fold_backward.hpp"
#include "boost/mpl/list.hpp"
#include "boost/mpl/assert_is_same.hpp"
#include "boost/tuple/tuple.hpp"
// 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.
// $Source$
// $Date$
// $Revision$
#include <boost/mpl/reverse_fold.hpp>
#include <boost/mpl/list.hpp>
#include <boost/tuple/tuple.hpp>
#include <iostream>
using namespace boost::mpl;
template< typename Types > struct tuple_gen
: fold_backward<
: reverse_fold<
Types
, boost::tuples::null_type
, boost::tuples::cons<_2,_1>