Hacker News new | ask | show | jobs
by dataflow 1565 days ago
Funny enough, I am actually not sure if even that is true in the way you're imagining. Bear in mind such a variable would be a constexpr inline template... which would be kind of its entire point. To violate ODR with it you'd not only have to implement your::is_constructible_v, but also use the resulting value in a non-constexpr context (I think [1] alludes to this)... which would be a rather bizarre use for a type trait called 'is_constructible_v'.

Anyway, this discussion is dragging on forever, so I'm just gonna stop here and wrap this up with the following:

As I see it, the only realistic way you could ever generate a buggy program with this is if you're getting nerd-sniped and desperately trying to come up with a counterexample in response to someone's challenge on HN. For practical purposes I see it as a non-issue.

[1] https://eel.is/c++draft/basic.def.odr#5