Skip to content
Snippets Groups Projects
Commit b5ed3f15 authored by Olivier BICHLER's avatar Olivier BICHLER
Browse files

Fixed unsupported std::void_t

parent a677e993
No related branches found
No related tags found
2 merge requests!318[Upd] release verision 0.5.0,!272[Add] Possibility to create a GenericOperator from any Operator
Pipeline #60812 passed
......@@ -34,12 +34,23 @@ namespace py = pybind11;
namespace Aidge {
#if __cplusplus >= 201703L || (defined(_MSVC_LANG) && _MSVC_LANG >= 201703L)
#define AIDGE_DYNATTR_HAVE_CPP17
#endif
#if defined(AIDGE_DYNATTR_HAVE_CPP17) || defined(__cpp_lib_void_t)
using std::void_t;
#else
template <typename...>
using void_t = void;
#endif
// Detection idiom to check if a type T has a less-than operator
template <typename T, typename = void>
struct has_less_than_operator : std::false_type {};
template <typename T>
struct has_less_than_operator<T, std::void_t<decltype(std::declval<T>() < std::declval<T>())>> : std::true_type {};
struct has_less_than_operator<T, void_t<decltype(std::declval<T>() < std::declval<T>())>> : std::true_type {};
///\todo store also a fix-sized code that indicates the type
///\todo managing complex types or excluding non-trivial, non-aggregate types
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment