Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
normalize.hpp
Go to the documentation of this file.
1
6#pragma once
7
8#include <type_traits>
9
10namespace core {
11
12template < typename T >
13struct normalize { };
14
15template < class ReturnType >
16using normalizationResult = typename std::decay_t < typename std::invoke_result_t < decltype ( core::normalize < ReturnType >::eval ), ReturnType && > >;
17
24template < typename T >
25struct has_eval {
26private:
27 template < class U >
28 static std::true_type test ( U * )
29 requires ( std::is_pointer_v < decltype ( & U::eval ) > );
30 static std::false_type test ( ... );
31public:
36 static const bool value = decltype ( has_eval::test ( std::declval < std::decay_t < T > * > ( ) ) )::value;
37};
38
39} /* namespace core */
Definition: normalize.hpp:10
typename std::decay_t< typename std::invoke_result_t< decltype(core::normalize< ReturnType >::eval), ReturnType && > > normalizationResult
Definition: normalize.hpp:16
Type trait to determine existence of eval static method. A boolean field namd value is set to true if...
Definition: normalize.hpp:25
static const bool value
True if the type decayed type T has clone method.
Definition: normalize.hpp:36
Definition: normalize.hpp:13