Support Class Library
A set of tools providing classes and utility
Predicate.h
Go to the documentation of this file.
1 #pragma once
2 
3 //#ifdef SCL_CPP17
4 //#include <scl/concepts/require.h>
5 #include <scl/macros.h>
8 #include <scl/concepts/Boolean.h>
10 
11 namespace scl{
12  namespace concepts{
18  template <class F, class... Args>
19  struct Predicate{
20  constexpr operator bool() const{
21  using namespace scl::tools;
23  RegularInvocable<F, Args...>{}
24 #ifdef SCL_CPP17
25  && Boolean<meta::invoke_result_t<F, Args...>>{}
26 #else
27  && Boolean<meta::result_of_t<F(Args...)>>{}
28 #endif
29  >();
30  }
31  };
32  }
33 }
34 //#endif
constexpr bool constexpr_assert()
Global namespace of the SCL.
Definition: alias.hpp:3
typename std::result_of< Signature >::type result_of_t
Definition: type_query.h:45
RegularInvocable concept, a type F is regular invocable with Args if it is Invocable and is equality ...
Boolean concept, a type is boolean if it defines all boolean operations.
Definition: Boolean.h:23
General purpose tooling.
Definition: iostream.hpp:4
Predicate concept, a type F is a predicate with Args if it is RegularInvocable and its result is Bool...
Definition: Predicate.h:19
decltype(invoke(std::declval< F >(), std::declval< Args >()...)) invoke_result_t
Definition: invoke.h:109