I have stumbled across following lambda syntax, which I do not understand:
#include <iostream>
template<typename Callback>
void do_it(Callback callback) {
callback();
}
template<typename T>
void p() {
std::cout << __PRETTY_FUNCTION__ << std::endl;
}
int main() {
auto a = <:&:> { };
p<decltype(a)>();
do_it(<:&:> { std::cout << "Hello" << std::endl; }); //this
}
Program above produces an output:
void p() [with T = main()::__lambda0]
Hello
Could you explain, what does <:&:> {/* ... */}
mean? Is it possible to declare this way a lambda which takes an argument?