is it somehow possible to use a lambda within a call to assert() ?
When i try the following…
assert([&]() -> bool{
sockaddr_storage addr; int addrlen = sizeof(addr);
return (getsockname(this->m_Socket, (sockaddr*)&addr, &addrlen) != 0) ? false : true;
});
… i get the error
error C2675: unary ‘!’ : ‘`anonymous-namespace’::’ does not define this operator or a conversion to a type acceptable to the
predefined operator
Sure, but assert really only wants a boolean; not a lambda, so you’ll have to call it yourself (this assuming that your lambda is one that returns something you want to assert):