2
0
mirror of https://github.com/boostorg/hof.git synced 2026-01-27 19:02:13 +00:00
Files
hof/test/repeat.cpp
2016-02-20 18:05:14 -06:00

25 lines
510 B
C++

#include <fit/repeat.hpp>
#include "test.hpp"
struct increment
{
template<class T>
constexpr T operator()(T x) const
{
return x + 1;
}
};
FIT_TEST_CASE()
{
FIT_TEST_CHECK(fit::repeat(std::integral_constant<int, 5>())(increment())(1) == 6);
FIT_STATIC_TEST_CHECK(fit::repeat(std::integral_constant<int, 5>())(increment())(1) == 6);
}
FIT_TEST_CASE()
{
FIT_TEST_CHECK(fit::repeat(5)(increment())(1) == 6);
FIT_STATIC_TEST_CHECK(fit::repeat(5)(increment())(1) == 6);
}