Commit 5f504291 authored by Krystian Kuzniarek's avatar Krystian Kuzniarek Committed by Mateusz Szychowski (Muttley)

include: optional: add has_equalto_operator type_trait

parent edcc6c6a
......@@ -14,6 +14,7 @@
#include <iostream>
#include <tuple>
#include <functional>
#include <type_traits>
namespace Pistache {
......@@ -81,6 +82,17 @@ namespace types {
struct is_move_constructible :
std::is_constructible<T, typename std::add_rvalue_reference<T>::type> {};
// Workaround for C++14 defect (CWG 1558)
template <typename... Ts> struct make_void { typedef void type; };
template <typename... Ts> using void_t = typename make_void<Ts...>::type;
template <typename, typename = void_t<>>
struct has_equalto_operator : std::false_type {};
template <typename T>
struct has_equalto_operator<
T, void_t<decltype(std::declval<T>() == std::declval<T>())>>
: std::true_type {};
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment