Код: Выделить всё
struct Foo {
constexpr explicit operator bool() const noexcept { return false; }
};
int main() {
if(auto a = Foo{}) // declaration OK
{
}
auto b = Foo{}; // possible to prohibit this?
}
образно Применение.>
Подробнее здесь: https://stackoverflow.com/questions/796 ... -expressio
Мобильная версия