I've seen two recent answers using _1
as a pure C++0x solution (no explicit mention of boost lambdas).
Is there such an animal as std::_1
I would think that having native lambdas will make such a construct redundant.
A Google code search for std::_1
brings two results from the same project so that's inconclusive.
Yes, they are part of C++0x inside the std::placeholders
namespace, from the latest draft (n3126) §20.8.10.1.3 "Placeholders":
namespace std {
namespace placeholders {
// M is the implementation-defined number of placeholders
extern unspecified _1;
extern unspecified _2;
.
.
.
extern unspecified _M;
}
}
They are actually included in TR1 (n1836 §3.6.4; n1455) along with bind
, which are taken from the Boost.Bind library.
Yes, they are part of C++0x. I haven't double-checked the TR1 specs, but I suspect they were added there (TR1 was essentially a library-only extension to C++03, so it couldn't rely on lambdas), and then, since it's already there in TR1, it'd be needlessly disruptive to remove it again in C++0x, even though it's no longer really necessary once you have true lambdas.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With