mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Fix various errors from CI
* move Plugins::Version to fair::mq::tools * fix Parser interface * make device a shared pointer in main * provide std::hash template specialization * fix FairMQ.Plugins/FairMQ.PluginsStatic when run with ctest * fix MQ/serialization example * add --no-as-needed flag * GCC 4 does not support member refs, move to pointer types
This commit is contained in:
committed by
Mohammad Al-Turany
parent
ad0f050c99
commit
a26925cbf5
@@ -9,7 +9,9 @@
|
||||
#ifndef FAIR_MQ_TOOLS_CPPSTL_H
|
||||
#define FAIR_MQ_TOOLS_CPPSTL_H
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <type_traits>
|
||||
|
||||
namespace fair
|
||||
{
|
||||
@@ -25,6 +27,18 @@ std::unique_ptr<T> make_unique(Args&& ...args)
|
||||
return std::unique_ptr<T>(new T(std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
// provide an enum hasher to compensate std::hash not supporting enums in C++11
|
||||
template<typename Enum>
|
||||
struct HashEnum
|
||||
{
|
||||
auto operator()(const Enum& e) const noexcept
|
||||
-> typename std::enable_if<std::is_enum<Enum>::value, std::size_t>::type
|
||||
{
|
||||
using _type = typename std::underlying_type<Enum>::type;
|
||||
return std::hash<_type>{}(static_cast<_type>(e));
|
||||
}
|
||||
};
|
||||
|
||||
} /* namespace tools */
|
||||
} /* namespace mq */
|
||||
} /* namespace fair */
|
||||
|
Reference in New Issue
Block a user