
28 Aug
2009
28 Aug
'09
8:18 a.m.
Ion Gaztañaga wrote:
It's not trivial... And if we more than 2 overloads for each parameter, we'll need to produce a ton of preprocessed code ;-)
Best,
Ion
I've used Boost.Preprocessor to generate 2^n overloads of T&/const T& combinations (based on a post here not too long ago) (when BOOST_HAS_RVALUE_REFS isn't defined) and some additional metaprogramming to capture explicitly generated rvalues (from boost::move), so I think the only thing that's missing is capturing automatically generated rvalues. Right now I hack it with a force_move free function that const_cast/static_cast's its argument to rv<T>& and apply it to auto rvalues. - Jeff