Skip to content

Commit

Permalink
iox-eclipse-iceoryx#220 replace cxx::enable_if_t with std::enable_if_t
Browse files Browse the repository at this point in the history
Signed-off-by: Mathias Kraus <[email protected]>
  • Loading branch information
elBoberido committed Nov 23, 2020
1 parent d58d7de commit 8c0c3c2
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ class PortManager
void addEntryToServiceRegistry(const capro::IdString& service, const capro::IdString& instance) noexcept;
void removeEntryFromServiceRegistry(const capro::IdString& service, const capro::IdString& instance) noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const
noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
cxx::optional<ProcessName_t> doesViolateCommunicationPolicy(const capro::ServiceDescription& service
[[gnu::unused]]) const noexcept;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace iox
{
namespace roudi
{
template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
inline cxx::optional<ProcessName_t>
PortManager::doesViolateCommunicationPolicy(const capro::ServiceDescription& service) const noexcept
{
Expand All @@ -34,7 +34,7 @@ PortManager::doesViolateCommunicationPolicy(const capro::ServiceDescription& ser
return cxx::nullopt;
}

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
inline cxx::optional<ProcessName_t> PortManager::doesViolateCommunicationPolicy(const capro::ServiceDescription& service
[[gnu::unused]]) const noexcept
{
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/include/iceoryx_posh/roudi/port_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,13 @@ class PortPool
const ProcessName_t& applicationName,
const mepoo::MemoryInfo& memoryInfo = mepoo::MemoryInfo()) noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>* = nullptr>
iox::popo::SubscriberPortData* constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
const mepoo::MemoryInfo& memoryInfo) noexcept;

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>* = nullptr>
iox::popo::SubscriberPortData* constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_posh/include/iceoryx_posh/roudi/port_pool.inl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace iox
{
namespace roudi
{
template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::ManyToManyPolicy>::value>*>
inline iox::popo::SubscriberPortData* PortPool::constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
Expand All @@ -31,7 +31,7 @@ inline iox::popo::SubscriberPortData* PortPool::constructSubscriber(const capro:
memoryInfo);
}

template <typename T, cxx::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
template <typename T, std::enable_if_t<std::is_same<T, iox::build::OneToManyPolicy>::value>*>
inline iox::popo::SubscriberPortData* PortPool::constructSubscriber(const capro::ServiceDescription& serviceDescription,
const uint64_t& historyRequest,
const ProcessName_t& applicationName,
Expand Down
4 changes: 2 additions & 2 deletions iceoryx_utils/include/iceoryx_utils/cxx/function_ref.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ class function_ref<ReturnType(ArgTypes...)>
/// @brief Creates a function_ref with a callable whose lifetime has to be longer than function_ref
/// @param[in] callable that is not a function_ref
template <typename CallableType,
typename = enable_if_t<not_same<CallableType, function_ref>::value>,
typename = enable_if_t<is_invocable<CallableType, ArgTypes...>::value>>
typename = std::enable_if_t<not_same<CallableType, function_ref>::value>,
typename = std::enable_if_t<is_invocable<CallableType, ArgTypes...>::value>>
function_ref(CallableType&& callable) noexcept;

function_ref(function_ref&& rhs) noexcept;
Expand Down
7 changes: 0 additions & 7 deletions iceoryx_utils/include/iceoryx_utils/cxx/type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ struct has_signature<Callable,
{
};

///
/// @brief enable_if helper type
/// @note Remove once switched to C++14
///
template <bool B, class T = void>
using enable_if_t = typename std::enable_if<B, T>::type;

///
/// @brief Negation of is_same
///
Expand Down

0 comments on commit 8c0c3c2

Please sign in to comment.