forked from boostorg/fusion
fixing performance tests, mainly result of issues, and arity issues with unfused typed
[SVN r40515]
This commit is contained in:
@ -16,6 +16,8 @@
|
||||
#include <boost/fusion/adapted/array.hpp>
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <functional>
|
||||
@ -37,11 +39,13 @@ namespace
|
||||
{
|
||||
struct poly_add
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
struct result
|
||||
{
|
||||
typedef Lhs type;
|
||||
};
|
||||
struct result<poly_add(Lhs, Rhs)>
|
||||
: boost::remove_reference<Lhs>
|
||||
{};
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
|
||||
@ -52,11 +56,13 @@ namespace
|
||||
|
||||
struct poly_mult
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
struct result
|
||||
{
|
||||
typedef Lhs type;
|
||||
};
|
||||
struct result<poly_mult(Lhs, Rhs)>
|
||||
: boost::remove_reference<Lhs>
|
||||
{};
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
Lhs operator()(const Lhs& lhs, const Rhs& rhs) const
|
||||
@ -110,14 +116,16 @@ namespace
|
||||
|
||||
struct poly_combine
|
||||
{
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
struct result
|
||||
{
|
||||
typedef Rhs type;
|
||||
};
|
||||
struct result<poly_combine(Lhs, Rhs)>
|
||||
: boost::remove_reference<Rhs>
|
||||
{};
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
typename result<Lhs,Rhs>::type
|
||||
typename result<poly_combine(Lhs,Rhs)>::type
|
||||
operator()(const Lhs& lhs, const Rhs& rhs) const
|
||||
{
|
||||
return rhs + boost::fusion::at_c<0>(lhs) * boost::fusion::at_c<1>(lhs);
|
||||
|
Reference in New Issue
Block a user