template<typename OptionsValues, typename... Options>
struct eve::decorated_with< OptionsValues, Options >
#include <iostream>
#include <type_traits>
#include <eve/traits/overload.hpp>
#include <eve/module/core.hpp>
{
template<typename Options>
struct func_t :
callable<func_t, Options, conditional_option>
{
template<eve::integral_value T>
};
template<typename Options>
struct other_func_t : callable<other_func_t, Options, relative_conditional_option>
{
template<eve::integral_value T>
};
};
namespace eve::detail
{
{
if constexpr(decltype(mask)::is_complete) return x*x;
}
{
if constexpr(decltype(mask)::is_complete) return x/10;
}
}
template<typename Func, typename Opt>
inline constexpr bool can_be_decorated_with = requires(Func f, Opt o) { f[o]; };
int main()
{
std::cout << eve::func(8) << "\n";
std::cout << eve::func[false](8) << "\n";
std::cout << eve::other_func(80) << "\n";
std::cout << "Is func[bool] supported: "
<< std::boolalpha << can_be_decorated_with<eve::tag_t<eve::func>, bool>
<< "\n";
std::cout << "Is func[eve::keep_between] supported: "
<< "\n";
std::cout << "Is other_func[bool] supported: "
<< std::boolalpha << can_be_decorated_with<eve::tag_t<eve::other_func>, bool>
<< "\n";
std::cout << "Is other_func[eve::keep_between] supported: "
<< std::boolalpha << can_be_decorated_with<eve::tag_t<eve::other_func>,
eve::keep_between>
<< "\n";
}
The concept integral_value<T> is satisfied if and only if T satisfies eve::value and the element type...
Definition value.hpp:51
constexpr auto mul
tuple_callablecomputing the product of its arguments. ! ! @groupheader{Header file}...
Definition mul.hpp:119
#define EVE_CALLABLE_OBJECT(TYPE, NAME)
Generate the generic function interface for an actual eve::callable.
Definition protocol.hpp:131
constexpr detail::condition_key_t condition_key
Keyword for retrieving conditionals decorator.
Definition supports.hpp:195
constexpr auto functor
EVE's Callable Object generator.
Definition supports.hpp:89
#define EVE_REQUIRES(ARCH)
Flag a function to support delayed calls on given architecture.
Definition protocol.hpp:171
#define EVE_DISPATCH_CALL(...)
Generate the proper call to current EVE's Callable Object implementation.
Definition protocol.hpp:148
EVE Main Namespace.
Definition abi.hpp:18
CRTP base class defining an EVE's Callable Object.
Definition default_behaviors.hpp:53
Conditional expression keeping all lanes between two position.
Definition conditional.hpp:523
Wrapper for SIMD registers.
Definition wide.hpp:70
#include <iostream>
#include <type_traits>
#include <eve/traits/overload.hpp>
#include <eve/wide.hpp>
{
using namespace rbr::literals;
inline constexpr auto precise = "precise"_fl;
inline constexpr auto scale = "scale"_fl;
struct precision
{
template<eve::any_options_from<precise, scale> O>
auto process(auto const& base, O const& opt) const
{
auto new_opts = rbr::merge(
options{opt}, base);
return options<
decltype(new_opts)>{new_opts};
}
constexpr auto default_to(auto const& base) const noexcept { return base; }
};
template<typename Options>
struct func_t : callable<func_t, Options, precision>
{
};
};
namespace eve::detail
{
auto func_(
EVE_REQUIRES(cpu_), eve::callable_options
auto const& opt,
int x)
{
return x * (opt[scale] ? 10. : 1.)
+ (opt[precise] ? 3.1416 : 3.2);
}
}
int main()
{
std::cout << eve::func(1) << "\n";
std::cout << eve::func[eve::precise](1) << "\n";
std::cout << eve::func[eve::scale](1) << "\n";
std::cout << eve::func[eve::scale][eve::precise](1) << "\n";
std::cout << eve::func[eve::precise][eve::scale](1) << "\n";
}
Wrapper class around bundle of options passed to eve::callable.
Definition supports.hpp:37