X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/0609bc473d94d3a85ce4f0ce2d0b72a6c6a55083..17aced0a546331763cb211027c454fc0930d1f45:/include/xbt/utility.hpp diff --git a/include/xbt/utility.hpp b/include/xbt/utility.hpp index d0d73022ff..03458064d3 100644 --- a/include/xbt/utility.hpp +++ b/include/xbt/utility.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include /** @brief Helper macro to declare enum class @@ -29,6 +30,18 @@ namespace simgrid { namespace xbt { +/** @brief Replacement for C++20's std::type_identity_t + */ +#if __cplusplus >= 201806L // __cpp_lib_type_identity +template using type_identity_t = typename std::type_identity_t; +#else +template struct type_identity { + using type = T; +}; + +template using type_identity_t = typename type_identity::type; +#endif + /** @brief A hash which works with more stuff * * It can hash pairs: the standard hash currently doesn't include this.