C++17 - why does std::any_cast not support implicit conversion? – stackoverflow.com

Why does std::any_cast throw a bad_any_cast exception when an implicit conversion is possible? For example: std::any a = 10 // holds an int now auto b = std::any_cast<long>(a) // throws ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "C++17 - why does std::any_cast not support implicit conversion? – stackoverflow.com"