2
0
mirror of https://github.com/boostorg/hof.git synced 2026-01-31 20:22:11 +00:00
Files
hof/test/static_def.h
2015-07-29 15:45:33 -07:00

44 lines
703 B
C++

#ifndef GUARD_STATIC_DEF
#define GUARD_STATIC_DEF
#include <fit/function.h>
#include <fit/lambda.h>
namespace fit_test {
#if FIT_HAS_STATIC_LAMBDA
FIT_STATIC_LAMBDA_FUNCTION(fit_sum_lambda) = [](int x, int y)
{
return x + y;
};
#endif
struct fit_sum_f
{
constexpr int operator()(int x, int y) const
{
return x + y;
}
};
#if FIT_HAS_STATIC_LAMBDA
FIT_STATIC_LAMBDA_FUNCTION(fit_sum_fo) = fit_sum_f();
#endif
FIT_STATIC_FUNCTION(fit_sum_constexpr_fo) = fit_sum_f();
FIT_DECLARE_STATIC_VAR(fit_sum_var, fit_sum_f);
// FIT_STATIC_FUNCTION(fit_sum) = [](auto x, auto y)
// {
// return x + y;
// };
template<class T>
T fit_sum(T x, T y)
{
return x + y;
};
}
#endif