jeudi 23 juin 2016

Unit testing template code

Imagine that I have a lot of template code that I can test with static_asserts, so for example

template <typename Help>
class SomeUtil { ... };

static_assert(std::is_same<SomeUtil<Type>::type, int>::value, "message");

Is the only way to test this by making a main.cpp that just includes this header and compiling it? -fsyntax-only did not seem to work.

Aucun commentaire:

Enregistrer un commentaire