C++ guys hate static_if?

Dicebot m.strashun at gmail.com
Thu Mar 14 10:15:11 PDT 2013


On Thursday, 14 March 2013 at 17:09:41 UTC, Andrej Mitrovic wrote:
> On 3/14/13, bearophile <bearophileHUGS at lycos.com> wrote:
>> This is an invalid argument. You can say the same thing for 
>> many
>> (most?) tests done by the compiler. Unit tests can't be sure to
>> verify all code paths inside a function or template.
>
> No, it must do exactly that. If you have so many paths that you 
> can't
> reasonably test all paths then your template or function is too
> complicated to begin with. The benefit here of D over C++ is 
> that unit
> testing is cheap and doesn't require external libraries.
>
> You use template constraints to limit the code paths, and you 
> use
> unittests to verify semantics. Then there's also static 
> assert(0).

Does Phobos pull request tester turns red on failed 100% coverage?
(sarcasm intended)


More information about the Digitalmars-d mailing list