18 #ifndef TYPE_REGISTER_HPP
19 #define TYPE_REGISTER_HPP
20 #include <type_traits>
61 std::ios_base::Init init_output;
62 static bool has_been_called=
false;
63 static_assert(std::is_base_of<item, T>::value,
"type_register can only be used on classes that inherit from item");
64 static_assert(!std::is_abstract<T>::value,
"type_register cannot be used with an abstract class");
70 T* temp =
dynamic_cast<T*
>(__maker__<T>());
74 err(
std::string() +
"Type register has already registered type " + temp->type(),
75 "type_register::init",
"utils/type_register.hpp",
FATAL_ERROR);
82 err(
std::string() +
"type_register could not allocate a type of " +
typeid(T).name(),
83 "type_register::init",
"utils/type_register.hpp",
FATAL_ERROR);