Question

Is there a way to use enable_if specifically for boost::fusion callable objects?

template<typename F>
void do_something(F f, enable_if< is_fusion_callable_object<F> >::type * = 0)
{
    // how to define the "is_fusion_callable_object<> ?
}

Here F is a fusion "fused function" can take an arbitrary Sequence as a parameter

Was it helpful?

Solution

I tried something similar, until now without success. My first successful attempt was to create for a different number of template parameters different templates via boost praeprocessor makros. In your examples would this be

template <typename P1, ......>
do_something(boost::fusion::vector<P1, ....> const& v)

Since I had to use VC10 I could not use a solution with variadic templates. Perhaps this helps you further, even the question is rather old.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top