Skip to content

Commit

Permalink
Move C++11 enumerate converter from 'Module' to 'SC_Module'.
Browse files Browse the repository at this point in the history
  • Loading branch information
kouchy committed Sep 19, 2019
1 parent a46afa9 commit 6cc383f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
6 changes: 0 additions & 6 deletions src/Module/Module.hpp
Expand Up @@ -21,12 +21,6 @@
#include "Module/SC_Module.hpp"
#endif

// convert strongly typed enum to integer
template <typename E>
constexpr typename std::underlying_type<E>::type operator+(E e) noexcept {
return static_cast<typename std::underlying_type<E>::type>(e);
}

namespace aff3ct
{
namespace module
Expand Down
6 changes: 0 additions & 6 deletions src/Module/Module.hxx
Expand Up @@ -4,12 +4,6 @@ namespace aff3ct
{
namespace module
{
// convert strongly typed enum to integer
template <typename E>
constexpr typename std::underlying_type<E>::type operator+(E e) noexcept {
return static_cast<typename std::underlying_type<E>::type>(e);
}

template <typename T>
inline Socket& Module
::create_socket_in(Task& task, const std::string &name, const size_t n_elmts)
Expand Down
4 changes: 4 additions & 0 deletions src/Module/SC_Module.hpp
Expand Up @@ -14,6 +14,10 @@

#include "Module/Task.hpp"

// convert strongly typed enum to integer
template <typename E>
constexpr typename std::underlying_type<E>::type operator+(E e) noexcept;

namespace aff3ct
{
namespace module
Expand Down
6 changes: 6 additions & 0 deletions src/Module/SC_Module.hxx
@@ -1,5 +1,11 @@
#include "Module/SC_Module.hpp"

// convert strongly typed enum to integer
template <typename E>
constexpr typename std::underlying_type<E>::type operator+(E e) noexcept {
return static_cast<typename std::underlying_type<E>::type>(e);
}

namespace aff3ct
{
namespace module
Expand Down

0 comments on commit 6cc383f

Please sign in to comment.