mirror of
https://github.com/boostorg/phoenix.git
synced 2026-02-19 02:32:09 +00:00
Merge branch 'file_tidy' into develop
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Thomas Heller
|
||||
|
||||
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
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)
|
||||
==============================================================================*/
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2011 Thomas Heller
|
||||
|
||||
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/phoenix.hpp>
|
||||
#include <boost/typeof/typeof.hpp>
|
||||
@@ -7,26 +13,26 @@
|
||||
|
||||
int main()
|
||||
{
|
||||
using boost::phoenix::lambda;
|
||||
using boost::phoenix::let;
|
||||
using boost::phoenix::ref;
|
||||
using boost::phoenix::construct;
|
||||
using boost::phoenix::local_names::_a;
|
||||
using boost::phoenix::arg_names::_1;
|
||||
using boost::phoenix::lambda;
|
||||
using boost::phoenix::let;
|
||||
using boost::phoenix::ref;
|
||||
using boost::phoenix::construct;
|
||||
using boost::phoenix::local_names::_a;
|
||||
using boost::phoenix::arg_names::_1;
|
||||
|
||||
BOOST_AUTO(
|
||||
generator
|
||||
, (lambda
|
||||
(
|
||||
_a = val(_1)
|
||||
)
|
||||
[
|
||||
std::cout << _a << " "
|
||||
, _a++
|
||||
])
|
||||
);
|
||||
BOOST_AUTO(
|
||||
generator
|
||||
, (lambda
|
||||
(
|
||||
_a = val(_1)
|
||||
)
|
||||
[
|
||||
std::cout << _a << " "
|
||||
, _a++
|
||||
] )
|
||||
);
|
||||
|
||||
int i = 0;
|
||||
std::vector<int> v(10);
|
||||
std::for_each(v.begin(), v.end(), generator(0));
|
||||
int i = 0;
|
||||
std::vector<int> v(10);
|
||||
std::for_each(v.begin(), v.end(), generator(0));
|
||||
}
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
|
||||
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/phoenix.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
|
||||
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/phoenix.hpp>
|
||||
|
||||
|
||||
@@ -56,11 +56,11 @@ namespace boost { namespace phoenix
|
||||
template <typename This, typename Actor, typename Context>
|
||||
struct result<This(Actor, Context)>
|
||||
: boost::remove_const<
|
||||
typename boost::remove_reference<
|
||||
typename boost::remove_reference<
|
||||
typename evaluator::impl<Actor, Context, proto::empty_env>::result_type
|
||||
>::type
|
||||
>
|
||||
{};
|
||||
>::type
|
||||
>
|
||||
{};
|
||||
|
||||
template <typename Context>
|
||||
typename result<custom_terminal(actor<Expr> const &, Context &)>::type
|
||||
|
||||
@@ -96,22 +96,22 @@ namespace boost { namespace phoenix
|
||||
>::type
|
||||
env_type;
|
||||
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
Lambda
|
||||
, typename result_of::context<
|
||||
scoped_environment<
|
||||
env_type
|
||||
, outer_env_type
|
||||
, locals_type
|
||||
, map_type
|
||||
>
|
||||
, typename result_of::actions<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
Lambda
|
||||
, typename result_of::context<
|
||||
scoped_environment<
|
||||
env_type
|
||||
, outer_env_type
|
||||
, locals_type
|
||||
, map_type
|
||||
>
|
||||
, typename result_of::actions<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename OuterEnv, typename Locals, typename Map, typename Lambda, typename Context>
|
||||
@@ -148,7 +148,7 @@ namespace boost { namespace phoenix
|
||||
>::type
|
||||
env_type;
|
||||
|
||||
scoped_environment<
|
||||
scoped_environment<
|
||||
env_type
|
||||
, outer_env_type
|
||||
, locals_type
|
||||
|
||||
@@ -44,11 +44,11 @@ namespace boost { namespace phoenix
|
||||
, locals(locals)
|
||||
{}
|
||||
|
||||
scoped_environment(scoped_environment const & o)
|
||||
: env(o.env)
|
||||
scoped_environment(scoped_environment const & o)
|
||||
: env(o.env)
|
||||
, outer_env(o.outer_env)
|
||||
, locals(o.locals)
|
||||
{};
|
||||
, locals(o.locals)
|
||||
{};
|
||||
|
||||
Env const & env;
|
||||
OuterEnv const & outer_env;
|
||||
|
||||
@@ -62,56 +62,56 @@ namespace boost { namespace phoenix {
|
||||
template <typename This, typename A0, typename Context>
|
||||
struct result<This(A0, Context)>
|
||||
{
|
||||
typedef
|
||||
typename proto::detail::uncvref<
|
||||
typename result_of::env<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
outer_env_type;
|
||||
|
||||
typedef
|
||||
typename remove_pointer<
|
||||
typename remove_reference<
|
||||
typename fusion::result_of::at_c<
|
||||
outer_env_type
|
||||
, 0
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
actor_type;
|
||||
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
A0 const &
|
||||
, Context const &
|
||||
>::type
|
||||
a0_type;
|
||||
typedef
|
||||
typename proto::detail::uncvref<
|
||||
typename result_of::env<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
outer_env_type;
|
||||
|
||||
typedef
|
||||
vector2<actor_type const *, a0_type>
|
||||
inner_env_type;
|
||||
typedef
|
||||
typename remove_pointer<
|
||||
typename remove_reference<
|
||||
typename fusion::result_of::at_c<
|
||||
outer_env_type
|
||||
, 0
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
actor_type;
|
||||
|
||||
typedef
|
||||
scoped_environment<
|
||||
inner_env_type
|
||||
, outer_env_type
|
||||
, vector0<>
|
||||
, detail::map_local_index_to_tuple<>
|
||||
>
|
||||
env_type;
|
||||
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
actor_type const &
|
||||
, typename result_of::context<
|
||||
inner_env_type
|
||||
, typename result_of::actions<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
A0 const &
|
||||
, Context const &
|
||||
>::type
|
||||
a0_type;
|
||||
|
||||
typedef
|
||||
vector2<actor_type const *, a0_type>
|
||||
inner_env_type;
|
||||
|
||||
typedef
|
||||
scoped_environment<
|
||||
inner_env_type
|
||||
, outer_env_type
|
||||
, vector0<>
|
||||
, detail::map_local_index_to_tuple<>
|
||||
>
|
||||
env_type;
|
||||
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
actor_type const &
|
||||
, typename result_of::context<
|
||||
inner_env_type
|
||||
, typename result_of::actions<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
type;
|
||||
};
|
||||
|
||||
template <typename A0, typename Context>
|
||||
@@ -121,50 +121,50 @@ namespace boost { namespace phoenix {
|
||||
|
||||
//std::cout << typeid(checker).name() << "\n";
|
||||
//std::cout << typeid(checker).name() << "\n";
|
||||
typedef
|
||||
typename proto::detail::uncvref<
|
||||
typename result_of::env<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
outer_env_type;
|
||||
|
||||
typedef
|
||||
typename remove_pointer<
|
||||
typename remove_reference<
|
||||
typename fusion::result_of::at_c<
|
||||
outer_env_type
|
||||
, 0
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
actor_type;
|
||||
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
A0 const &
|
||||
, Context const &
|
||||
>::type
|
||||
a0_type;
|
||||
typedef
|
||||
typename proto::detail::uncvref<
|
||||
typename result_of::env<
|
||||
Context
|
||||
>::type
|
||||
>::type
|
||||
outer_env_type;
|
||||
|
||||
typedef
|
||||
vector2<actor_type const *, a0_type>
|
||||
inner_env_type;
|
||||
typedef
|
||||
typename remove_pointer<
|
||||
typename remove_reference<
|
||||
typename fusion::result_of::at_c<
|
||||
outer_env_type
|
||||
, 0
|
||||
>::type
|
||||
>::type
|
||||
>::type
|
||||
actor_type;
|
||||
|
||||
typedef
|
||||
scoped_environment<
|
||||
inner_env_type
|
||||
, outer_env_type
|
||||
, vector0<>
|
||||
, detail::map_local_index_to_tuple<>
|
||||
>
|
||||
env_type;
|
||||
typedef
|
||||
typename result_of::eval<
|
||||
A0 const &
|
||||
, Context const &
|
||||
>::type
|
||||
a0_type;
|
||||
|
||||
inner_env_type inner_env = {fusion::at_c<0>(phoenix::env(ctx)), phoenix::eval(a0, ctx)};
|
||||
vector0<> locals;
|
||||
env_type env(inner_env, phoenix::env(ctx), locals);
|
||||
typedef
|
||||
vector2<actor_type const *, a0_type>
|
||||
inner_env_type;
|
||||
|
||||
return phoenix::eval(*fusion::at_c<0>(phoenix::env(ctx)), phoenix::context(inner_env, phoenix::actions(ctx)));
|
||||
typedef
|
||||
scoped_environment<
|
||||
inner_env_type
|
||||
, outer_env_type
|
||||
, vector0<>
|
||||
, detail::map_local_index_to_tuple<>
|
||||
>
|
||||
env_type;
|
||||
|
||||
inner_env_type inner_env = {fusion::at_c<0>(phoenix::env(ctx)), phoenix::eval(a0, ctx)};
|
||||
vector0<> locals;
|
||||
env_type env(inner_env, phoenix::env(ctx), locals);
|
||||
|
||||
return phoenix::eval(*fusion::at_c<0>(phoenix::env(ctx)), phoenix::context(inner_env, phoenix::actions(ctx)));
|
||||
//return (*fusion::at_c<0>(phoenix::env(ctx)))(eval(a0, ctx));
|
||||
}
|
||||
};
|
||||
@@ -174,17 +174,17 @@ namespace boost { namespace phoenix {
|
||||
: call<this_eval>
|
||||
{};
|
||||
|
||||
template <typename Dummy>
|
||||
template <typename Dummy>
|
||||
struct is_nullary::when<rule::this_, Dummy>
|
||||
: proto::make<mpl::false_()>
|
||||
{};
|
||||
|
||||
template <typename A0>
|
||||
typename expression::this_<A0>::type const
|
||||
this_(A0 const & a0)
|
||||
{
|
||||
return expression::this_<A0>::make(a0);
|
||||
}
|
||||
template <typename A0>
|
||||
typename expression::this_<A0>::type const
|
||||
this_(A0 const & a0)
|
||||
{
|
||||
return expression::this_<A0>::make(a0);
|
||||
}
|
||||
|
||||
}}
|
||||
|
||||
|
||||
@@ -140,6 +140,8 @@ test-suite phoenix_include :
|
||||
[ run include/statement.cpp ]
|
||||
[ run include/stl.cpp ]
|
||||
[ run include/version.cpp ]
|
||||
[ run include/bind/bind_member_function.cpp ]
|
||||
[ run include/bind/bind_member_variable.cpp ]
|
||||
[ run include/core/actor.cpp ]
|
||||
[ run include/core/argument.cpp ]
|
||||
[ run include/core/arity.cpp ]
|
||||
@@ -149,13 +151,13 @@ test-suite phoenix_include :
|
||||
[ run include/core/function_equal.cpp ]
|
||||
[ run include/core/is_actor.cpp ]
|
||||
[ run include/core/is_nullary.cpp ]
|
||||
[ run include/core/nothing.cpp ]
|
||||
[ run include/core/meta_grammar.cpp ]
|
||||
[ run include/core/limits.cpp ]
|
||||
[ run include/core/meta_grammar.cpp ]
|
||||
[ run include/core/nothing.cpp ]
|
||||
[ run include/core/reference.cpp ]
|
||||
[ run include/core/terminal.cpp ]
|
||||
[ run include/core/value.cpp ]
|
||||
[ run include/core/visit_each.cpp ]
|
||||
[ run include/core/reference.cpp ]
|
||||
[ run include/function/function.cpp : : : : function_function ]
|
||||
[ run include/fusion/at.cpp ]
|
||||
[ run include/object/const_cast.cpp ]
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
/*=============================================================================
|
||||
Copyright (c) 2001-2007 Joel de Guzman
|
||||
|
||||
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/phoenix/bind/bind_function.hpp>
|
||||
#include <boost/phoenix/core/argument.hpp>
|
||||
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
|
||||
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/range.hpp>
|
||||
#include <boost/range/irange.hpp>
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
|
||||
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/phoenix.hpp>
|
||||
#include <boost/signals2.hpp>
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
/*==============================================================================
|
||||
Copyright (c) 2005-2010 Joel de Guzman
|
||||
Copyright (c) 2010 Thomas Heller
|
||||
|
||||
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/phoenix.hpp>
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
@@ -184,16 +184,16 @@ main()
|
||||
}
|
||||
|
||||
{
|
||||
{
|
||||
{
|
||||
// $$$ Fixme. This should not be failing $$$
|
||||
//int x = (let(_a = lambda[val(1)])[_a])()();
|
||||
//BOOST_TEST(x == 1);
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
{
|
||||
int x = (let(_a = lambda[val(1)])[bind(_a)])();
|
||||
BOOST_TEST(x == 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -59,20 +59,20 @@ int main()
|
||||
std::cout << _1 << " "
|
||||
, this_(_1 - 1)
|
||||
]
|
||||
, val(0)
|
||||
, val(0)
|
||||
));
|
||||
|
||||
/*
|
||||
f((
|
||||
if_else(
|
||||
/*
|
||||
f((
|
||||
if_else(
|
||||
_1 == 0
|
||||
, _1
|
||||
,this_(_1 - 1)
|
||||
)
|
||||
));
|
||||
*/
|
||||
|
||||
f((
|
||||
*/
|
||||
|
||||
f((
|
||||
if_else(
|
||||
_1 != 0
|
||||
,this_(_1 - 1)
|
||||
@@ -120,5 +120,5 @@ int main()
|
||||
)
|
||||
)
|
||||
));
|
||||
*/
|
||||
*/
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user