c++ - Forwarding tuple arguments to a function in VS2012 -


i'm trying forward tuple arguments function in vs2012 (update 3).

my understanding this possible in c++11 using variadic templates, unfortunately, vs2012 supports "fake" variadics.

auto values = std::make_tuple(4, 8); auto add = [](int a, int b) -> int { return + b; };  auto result = forward_to_function(add, values); 

i'm hoping there way in vs2012 implement functionality shown above, i'm not sure, possible without true variadics?

i saw mention of such "exploder" in channel 9 video. think recent "going native" (andrei?) reported having full general solution, not presented. there less complete workable solutions talked about.

if can wait, current vs preview compiler has true variadics.

look how boost it: implement whole bunch of args, special flag type default argument indicates missing.

normally, function (not class) overload it. overloading templated functions fine, too: arguments forward_to_function must expanded out can match each parameter type, doing anyway. instead of "..." write fixed number of params. overload definition has different number, many needed program.

—john


Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -