forked from boostorg/fusion
fixing performance tests, mainly result of issues, and arity issues with unfused typed
[SVN r40515]
This commit is contained in:
@ -15,6 +15,8 @@
|
||||
#include <boost/fusion/sequence/intrinsic/at.hpp>
|
||||
#include <boost/fusion/adapted/array.hpp>
|
||||
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <numeric>
|
||||
#include <functional>
|
||||
@ -75,14 +77,15 @@ namespace
|
||||
return result / iter;
|
||||
}
|
||||
|
||||
|
||||
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
|
||||
@ -93,11 +96,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
|
||||
|
@ -13,8 +13,8 @@
|
||||
#include <boost/fusion/functional/adapter/unfused_generic.hpp>
|
||||
#include <boost/fusion/functional/adapter/unfused_rvalue_args.hpp>
|
||||
#include <boost/fusion/functional/adapter/fused_function_object.hpp>
|
||||
#include <boost/fusion/functional/adapter/unfused_typed.hpp>
|
||||
|
||||
#include <boost/utility/result_of.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/timer.hpp>
|
||||
#include <algorithm>
|
||||
@ -264,12 +264,6 @@ int main()
|
||||
std::cout << "without random access " << call_fused(f,res) << std::endl;
|
||||
total += res;
|
||||
}
|
||||
{
|
||||
typedef boost::fusion::vector<int,int,int,int> s;
|
||||
boost::fusion::unfused_typed<F,s> f;
|
||||
std::cout << "unfused_typed<F,s> " << call_unfused(f,res) << std::endl;
|
||||
total += res;
|
||||
}
|
||||
{
|
||||
boost::fusion::unfused_rvalue_args<F> f;
|
||||
std::cout << "unfused_rvalue_args<F> " << call_unfused(f,res) << std::endl;
|
||||
@ -296,13 +290,6 @@ int main()
|
||||
std::cout << "without random access " << call_fused(f,res) << std::endl;
|
||||
total += res;
|
||||
}
|
||||
std::cout << std::endl << "Loopback:" << std::endl;
|
||||
{
|
||||
typedef boost::fusion::vector<int,int,int,int> s;
|
||||
boost::fusion::unfused_typed< boost::fusion::fused_function_object<U>, s > f;
|
||||
std::cout << "unfused_typed<fused_function_object<U>,s > " << call_unfused(f,res) << std::endl;
|
||||
total += res;
|
||||
}
|
||||
{
|
||||
boost::fusion::unfused_rvalue_args< boost::fusion::fused_function_object<U> > f;
|
||||
std::cout << "unfused_rvalue_args<fused_function_object<U> > " << call_unfused(f,res) << std::endl;
|
||||
|
@ -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
|
||||
|
@ -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 Lhs, typename Rhs>
|
||||
struct result
|
||||
{
|
||||
typedef Rhs type;
|
||||
};
|
||||
template<typename Sig>
|
||||
struct result;
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
typename result<Lhs,Rhs>::type
|
||||
struct result<poly_combine(Lhs, Rhs)>
|
||||
: boost::remove_reference<Rhs>
|
||||
{};
|
||||
|
||||
template<typename Lhs, typename Rhs>
|
||||
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);
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <boost/fusion/container/vector.hpp>
|
||||
#include <boost/fusion/container/list.hpp>
|
||||
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <boost/preprocessor/stringize.hpp>
|
||||
#include <boost/preprocessor/enum.hpp>
|
||||
@ -59,11 +61,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
|
||||
|
Reference in New Issue
Block a user