/******************************************************************************** * Copyright (C) 2017 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH * * * * This software is distributed under the terms of the * * GNU Lesser General Public Licence (LGPL) version 3, * * copied verbatim in the file "LICENSE" * ********************************************************************************/ #ifndef FAIR_MQ_TOOLS_CPPSTL_H #define FAIR_MQ_TOOLS_CPPSTL_H #include #include #include namespace fair::mq::tools { // provide an enum hasher to compensate std::hash not supporting enums in C++11 template struct HashEnum { auto operator()(const Enum& e) const noexcept -> typename std::enable_if::value, std::size_t>::type { using _type = typename std::underlying_type::type; return std::hash<_type>{}(static_cast<_type>(e)); } }; } // namespace fair::mq::tools #endif /* FAIR_MQ_TOOLS_CPPSTL_H */