1
0
forked from Alepha/Alepha

I added is_functional.

This commit is contained in:
2021-10-16 23:41:34 -04:00
parent 61841561f9
commit d976ff90b8

37
Meta/is_functional.h Normal file
View File

@ -0,0 +1,37 @@
static_assert( __cplusplus > 201700, "C++17 Required" );
#pragma once
#include <Alepha/Alepha.h>
#include <functional>
namespace Alepha::Hydrogen::Meta
{
inline namespace exports { inline namespace type_traits {} }
namespace detail::type_traits::is_functional
{
inline namespace exports {}
template< typename T, typename= void >
struct is_functional : std::false_type {};
template< typename T >
struct is_functional< T, std::void_t< decltype( std::function< std::declval< T >() > ) > > : std::true_type {};
namespace exports
{
template< typename T >
constexpr bool is_functional_v= is_functional< T >::value;
template< typename T >
struct is_functional : std::bool_constant< bool, is_functional_v< T > > {};
}
}
namespace exports::type_traits
{
using namespace detail::type_traits::is_functional::exports;
}
}