#include <functional> struct T { explicit operator bool() { return true; } }; int main() { T t; if(t) {} // OK auto l = [&]() { if (t) {} // Error }; }
MSVC's behavior looks strangely inconsistent; the only difference between the OK line and the error line is that it is in lambda. This is mistake?
source share