2013/2/8 oswin krause
Hi,
Is it possible to evaluate, whether a certain argument type given to a functor will lead to a valid expression with the result_of template?
i am trying to achieve the following, maybe there is a better way to do it:
template
Container< typename boost::result_of ::type > transform( Container<T> c, F f, std::disable_if >::type* dummy = 0 ){ //slow default implementation Container<T> res(c.size()); std::transform(c.begin(),c.**end(),res.begin(),f): return res; } //blocked implmentation of transform template
Container< typename boost::result_of ::type > transform( Container<T>, F functor, std::enable_if >::type* dummy = 0 ){ //functor supports fast implementation Container<T> res(c.size()); std::transform(c.blocks().**begin(),c.blocks().end(),res.**blocks().begin(),functor): return res; }
the question is, how valid_expression
could be implemented and right now the only mechanism which get's close to what i want would be checking result_of is valid.
Hmm... I have implemented `has_call