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:
Dennis Klein
2017-06-30 16:29:52 +02:00
committed by Mohammad Al-Turany
parent ad0f050c99
commit a26925cbf5
20 changed files with 153 additions and 104 deletions

View File

@@ -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 */