News for hackers. Stuff that matters.
Re:Ill-Advised C++ Rant, Part 2 (2016) by alkonaut on Thursday October 26, 2017 @01:29AM (#15556580)
If you use nameof(Cat) then the string "Cat" is included. If you use nameof(some_pet) then the array ["Cat", "Dog"] is included. It's zero cost for something you don't use and it's exactly the same cost as you would have paid by manually adding this.
Re:Ill-Advised C++ Rant, Part 2 (2016) by sidlls on Thursday October 26, 2017 @01:40AM (#15556624)
Ah, right, I see: the compiler only adds these things if it detects that it's necessary (i.e. there must be at least one use). Can't argue with that.