Is there a way to test that a default constructor does not exist?
c++, c++03, testing
Solution
You can use `static_assert(!std::is_default_constructible<T>::value, "Boo");`. Make sure to `#include <type_traits>`.
Problem
I am writing a test driver for a type this is explicitly supposed to not be default constructable. Is there any way to assert in my test driver that this is the case? I can verify manually via compilation errors, but I want something that will protect against future changes that may misguidedly add a default constructor. Edit: I'm stuck in an environment with C++03. Keeping that in mind, are there any other options than `is_default_constructable`?