Quantcast
Channel: Bartek's coding blog
Viewing all articles
Browse latest Browse all 325

[Quick Case] Surprising Conversions of const char* to bool

$
0
0

Surprising conversions of const char* and bool, C++

If you have two function overloads foo(): one is taking const std::string& and the other taking bool. Which one of them will be selected when you call foo("hello world"); ?

Let’s see where such a case might bite us and cause troubles?

Read more...

Viewing all articles
Browse latest Browse all 325

Trending Articles