#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <boost/phoenix/core/limits.hpp>
#include <boost/detail/lightweight_test.hpp>
#include <boost/fusion/tuple.hpp>
#include <boost/phoenix/core.hpp>
#include <boost/phoenix/operator.hpp>
#include <boost/phoenix/function.hpp>
#include <boost/phoenix/fusion.hpp>
#include <boost/phoenix/scope.hpp>
#include <typeinfo>
namespace fusion = boost::fusion;
namespace mpl = boost::mpl;
int
main()
{
using boost::phoenix::let;
using boost::phoenix::val;
using boost::phoenix::arg_names::_1;
using boost::phoenix::arg_names::_2;
using boost::phoenix::local_names::_a;
using boost::phoenix::local_names::_b;
{
int y = 0;
#ifdef __OPTIMIZE__
int x = (let(_a = 1)[let(_b = _1)[ _a + 0 ]])(y);
#else
int x = (let(_a = 1)[let(_b = _1)[ _a ]])(y);
#endif
BOOST_TEST(x == 1);
}
{
int y = 1;
int x = (let(_a = 0)[let(_b = _1)[ _b ]])(y);
BOOST_TEST(x == 1);
}
{
#ifdef __OPTIMIZE__
int x = (let(_a = 1)[let(_b = _a)[ _a + 0 ]])();
#else
int x = (let(_a = 1)[let(_b = _a)[ _a ]])();
#endif
BOOST_TEST(x == 1);
}
{
#ifdef __OPTIMIZE__
int x = (let(_a = 1)[let(_b = _a)[ _b + 0 ]])();
#else
int x = (let(_a = 1)[let(_b = _a)[ _b ]])();
#endif
BOOST_TEST(x == 1);
}
{
int y = 1;
int x = (let(_a = _1)[let(_b = _a)[ _a ]])(y);
BOOST_TEST(x == 1);
}
{
int y = 1;
int x = (let(_a = _1)[let(_b = _a)[ _b ]])(y);
BOOST_TEST(x == 1);
}
{
int y = 0;
#ifdef __OPTIMIZE__
int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a + 0 ]])(y);
#else
int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _a ]])(y);
#endif
BOOST_TEST(x == 1);
}
{
int y = 0;
#ifdef __OPTIMIZE__
int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b + 0 ]])(y);
#else
int x = (let(_a = 1, _b = 2)[let(_b = _a)[ _b ]])(y);
#endif
BOOST_TEST(x == 1);
}
{
int y = 0;
#ifdef __OPTIMIZE__
int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ val(_a) ]])(y);
#else
int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _a ]])(y);
#endif
BOOST_TEST(x == 1);
}
{
int y = 0;
#ifdef __OPTIMIZE__
int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ val(_b) ]])(y);
#else
int x = (let(_a = val(1), _b = val(2))[let(_b = _a)[ _b ]])(y);
#endif
BOOST_TEST(x == 1);
}
{
int y = 1;
int x = (let(_a = _1, _b = val(2))[let(_b = _a)[ _a ]])(y);
BOOST_TEST(x == 1);
}
{
int y = 0;
#ifdef __OPTIMIZE__
int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a + 0 ]])(y);
#else
int x = (let(_a = 1, _b = 2)[let(_b = _1)[ _a ]])(y);
#endif
BOOST_TEST(x == 1);
}
return boost::report_errors();
}