mirror of
https://github.com/boostorg/hof.git
synced 2026-01-21 04:52:20 +00:00
29 lines
526 B
C++
29 lines
526 B
C++
#include "test.hpp"
|
|
#include <fit/lift.hpp>
|
|
#include <tuple>
|
|
|
|
template<class T, class U>
|
|
constexpr T sum(T x, U y)
|
|
{
|
|
return x + y;
|
|
}
|
|
|
|
FIT_LIFT_CLASS(max_f, std::max);
|
|
FIT_LIFT_CLASS(sum_f, sum);
|
|
|
|
FIT_TEST_CASE()
|
|
{
|
|
FIT_TEST_CHECK(max_f()(3, 4) == std::max(3, 4));
|
|
|
|
FIT_TEST_CHECK(sum_f()(1, 2) == 3);
|
|
FIT_STATIC_TEST_CHECK(sum_f()(1, 2) == 3);
|
|
}
|
|
|
|
#if FIT_HAS_GENERIC_LAMBDA
|
|
FIT_TEST_CASE()
|
|
{
|
|
FIT_TEST_CHECK(FIT_LIFT(std::max)(3, 4) == std::max(3, 4));
|
|
FIT_TEST_CHECK(FIT_LIFT(sum)(1, 2) == 3);
|
|
}
|
|
#endif
|