diff --git a/include/rosa/support/type_helper.hpp b/include/rosa/support/type_helper.hpp index fc55969..6f0c794 100644 --- a/include/rosa/support/type_helper.hpp +++ b/include/rosa/support/type_helper.hpp @@ -1,50 +1,50 @@ /******************************************************************************* * * File: type_helper.hpp * * Contents: Helper facilities for type-related stuff. * * Copyright 2017 * * Author: David Juhasz (david.juhasz@tuwien.ac.at) * ******************************************************************************/ #ifndef ROSA_SUPPORT_TYPE_HELPER_HPP #define ROSA_SUPPORT_TYPE_HELPER_HPP #include namespace rosa { /* ************************************************************************** * * Printable * * ************************************************************************** */ // A value of type [u]int8_t is treated as a character when being put to an // output stream, which can result in invisible characters being printed. To // avoid that, such a value needs to be casted to a wider type. It can be done // by using the following template to find a target type to cast our value to. // NOTE: There is a preprocessor macro below which can be used instead of the // tedious typename stuff. template struct PrintableType { - typedef T type; + using Type = T; }; template <> struct PrintableType { - typedef unsigned int type; + using Type = unsigned int; }; template <> struct PrintableType { - typedef int type; + using Type = int; }; -#define PRINTABLE(T) typename PrintableType::type +#define PRINTABLE(T) typename PrintableType::Type } // End namespace rosa #endif // ROSA_SUPPORT_TYPE_HELPER_HPP