Recientemente leí un código C ++ como este:
setData(total, &user, ^() {
struct dst_t to = {ip, port};
sendData(to, data);
});
getData(total, ^{
recvData(data, NULL);
});
Nunca he visto ^() {}
ni ^{}
. ¿Qué quieren decir? ¿Algún tipo de función anónima?
^
seguro parece una macro, intente escanear a través de las#define
declaraciones. De hecho, puede ejecutargcc
con la-E
opción de expandir macros:g++ -E main.cpp