37 ms·
Quick survey std::variant<std::string,bool> v {"abc"}; Q: Which type is used ? (Since I'm asking a question, you know there is a gotcha). Answer: "abc" i
by Davidbrcz 9y ago
Quick survey
std::variant<std::string,bool> v {"abc"};
Q: Which type is used ?
(Since I'm asking a question, you know there is a gotcha).
Answer: "abc" is const char*, which can be converted to bool and is picked because the way variant is designed.