
Stjepan Rajko wrote:
On Sat, Aug 9, 2008 at 6:57 AM, Isaac Dupree <isaacdupree@charter.net> wrote:
Is there a macro library in Boost for making forwarding functions (the thing that can only be done perfectly in C++0x, with decltype, rvalue references and perhaps parameter packs)?
Perhaps the Boost.Functional/Forward library might be helpful to you (not a macro library for forwarding functions, but a more elegant solution for function objects). It was accepted into boost but I'm not sure whether it has made it to trunk yet. Here is the review announcement with links:
I see.. Only *declaring* the many-overloads once, might be helpful to the compiler (although there wasn't evidence presented either way -- just that the *preprocessing* wasn't the main overhead on most compilers). For fixed-number-of-argument forwarding, it's rather less efficient. I just wish one could do "using some_class::static_function" at namespace scope... Another issue about I ran into perfect forwarding: about C++0x's "constexpr". I was having trouble figuring out for sure... but it looked like it doesn't like const-reference or templated rvalue-reference arguments for constexpr function types. Which would mean that there's no perfect forwarding in the presence of constexpr (a constexpr function with all non-reference arguments would be the only way). (Did I miss something? Is it worth installing ConceptGCC to see if I can play around with it (on linux))? -Isaac