Syntactic sugar for a more expressive way of returning multiple values from a function. Defines a new syntax, using the dollar sign, to bind multiple values together.
WARNING: This is probably a stupid idea, use this at your own risks.
$<int, string> get_username();
return $(0, "root");
int id;
string name;
$(id, name) = get_username();
string name;
$(, name) = get_username();
- it requires C++11
- it's just a wrapper on top of
std::tuple
- it triggers the GCC warning
dollar-in-identifier-extension