1 /*=============================================================================
2 Copyright (c) 2001-2007 Joel de Guzman
4 Distributed under the Boost Software License, Version 1.0. (See accompanying
5 file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 ==============================================================================*/
9 #include <boost/function.hpp>
10 #include <boost/phoenix/core.hpp>
11 #include <boost/phoenix/operator.hpp>
12 #include <boost/phoenix/stl/cmath.hpp>
13 #include <boost/detail/lightweight_test.hpp>
17 double eps = 0.000001;
18 using namespace boost::phoenix::arg_names;
19 boost::function<bool(double, double)> f = fabs(_1 - _2) < eps;
21 double x = boost::phoenix::pow(_1,_2)(2.,0.);
23 BOOST_TEST(f(0.0, 0 * eps));
24 BOOST_TEST(!f(0.0, eps));
25 BOOST_TEST(fabs(x-1.) < eps );