2
0
mirror of https://github.com/boostorg/hof.git synced 2026-02-22 03:22:23 +00:00

Merge pull request #22 from pfultz2/default_construction

Default construction
This commit is contained in:
Paul Fultz II
2015-08-30 01:18:36 -05:00
11 changed files with 230 additions and 44 deletions

View File

@@ -50,6 +50,10 @@
/// constexpr auto alias_value(Alias&&);
///
#ifdef _MSC_VER
#pragma warning(disable: 4579)
#endif
namespace fit {
template<class T>
@@ -134,6 +138,15 @@ namespace detail {
template<class T, class Tag>
struct alias_static_storage
{
#ifdef _MSC_VER
// Since we disable the error for 4579 on MSVC, which leaves the static
// member unitialized at runtime, it is, therefore, only safe to use this
// class on types that are empty with constructors that have no possible
// side effects.
static_assert(std::is_empty<T>::value &&
std::is_literal_type<T>::value &&
std::is_default_constructible<T>::value, "In-class initialization is not yet implemented on MSVC");
#endif
static constexpr T value = T();
};

View File

@@ -170,6 +170,8 @@ struct by_adaptor : Projection, F
return always_ref(*this)(xs...);
}
FIT_INHERIT_DEFAULT(by_adaptor, Projection, F)
template<class P, class G, FIT_ENABLE_IF_CONVERTIBLE(P, Projection), FIT_ENABLE_IF_CONVERTIBLE(G, F)>
constexpr by_adaptor(P&& p, G&& f)
: Projection(fit::forward<P>(p)), F(fit::forward<G>(f))
@@ -199,6 +201,8 @@ struct by_adaptor<Projection, void> : Projection
return always_ref(*this)(xs...);
}
FIT_INHERIT_DEFAULT(by_adaptor, Projection)
template<class P, FIT_ENABLE_IF_CONVERTIBLE(P, Projection)>
constexpr by_adaptor(P&& p)
: Projection(fit::forward<P>(p))

View File

@@ -88,6 +88,8 @@ struct compressed_pair
: FirstBase(fit::forward<X>(x)), SecondBase(fit::forward<Y>(y))
{}
FIT_INHERIT_DEFAULT(compressed_pair, FirstBase, SecondBase)
template<class Base, class... Xs>
constexpr const Base& get_base(Xs&&... xs) const
{

View File

@@ -22,6 +22,14 @@
#endif
#endif
#ifndef FIT_NO_STD_DEFAULT_CONSTRUCTIBLE
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ < 7
#define FIT_NO_STD_DEFAULT_CONSTRUCTIBLE 1
#else
#define FIT_NO_STD_DEFAULT_CONSTRUCTIBLE 0
#endif
#endif
#define FIT_ENABLE_IF_CONVERTIBLE(...) \
class=typename std::enable_if<std::is_convertible<__VA_ARGS__>::value>::type
@@ -31,15 +39,17 @@
#define FIT_ENABLE_IF_CONSTRUCTIBLE(...) \
class=typename std::enable_if<std::is_constructible<__VA_ARGS__>::value>::type
#ifndef _MSC_VER
#define FIT_INHERIT_DEFAULT(C, ...) \
template<bool FitPrivateEnableBool_##__LINE__=true, \
class=typename std::enable_if<FitPrivateEnableBool_##__LINE__ && fit::detail::is_default_constructible<__VA_ARGS__>::value>::type> \
constexpr C() {}
#else
#define FIT_INHERIT_DEFAULT(C, ...) \
constexpr C() = default;
#endif
#define FIT_INHERIT_DEFAULT_EMPTY(C, ...) \
template<bool FitPrivateEnableBool_##__LINE__=true, \
class=typename std::enable_if<FitPrivateEnableBool_##__LINE__ && \
fit::detail::is_default_constructible<__VA_ARGS__>::value && std::is_empty<__VA_ARGS__>::value \
>::type> \
constexpr C() {}
#if FIT_NO_TYPE_PACK_EXPANSION_IN_TEMPLATE
@@ -84,7 +94,11 @@ struct is_default_constructible_helper
template<class... Xs>
struct is_default_constructible
#if FIT_NO_STD_DEFAULT_CONSTRUCTIBLE
: and_<is_default_constructible_helper<Xs>...>
#else
: and_<std::is_default_constructible<Xs>...>
#endif
{};
template<class T, class... Xs>

View File

@@ -44,12 +44,14 @@ struct reveal_static_const_factory
template<class F>
constexpr reveal_adaptor<F> operator=(const F& f) const
{
static_assert(is_default_constructible<F>::value, "Static functions must be default constructible");
return reveal_adaptor<F>(f);
}
#else
template<class F>
constexpr const reveal_adaptor<F>& operator=(const F&) const
{
static_assert(is_default_constructible<F>::value, "Static functions must be default constructible");
return static_const_var<reveal_adaptor<F>>();
}
#endif

View File

@@ -151,7 +151,18 @@ struct lazy_invoker
typedef detail::compressed_pair<F, Pack> base_type;
typedef lazy_invoker fit_rewritable1_tag;
#ifdef _MSC_VER
FIT_INHERIT_CONSTRUCTOR(lazy_invoker, base_type)
#else
FIT_INHERIT_DEFAULT_EMPTY(lazy_invoker, base_type)
template<class X, class Y,
FIT_ENABLE_IF_CONSTRUCTIBLE(base_type, X&&, Y&&)
>
constexpr lazy_invoker(X&& x, Y&& y)
: base_type(fit::forward<X>(x), fit::forward<Y>(y))
{}
#endif
template<class... Ts>
constexpr const F& base_function(Ts&&... xs) const

View File

@@ -96,7 +96,7 @@ struct pack_holder
: std::conditional<
std::is_empty<T>::value &&
std::is_literal_type<T>::value &&
is_default_constructible<T>::value,
is_default_constructible<T>::value,
alias_static<T, Tag>,
alias<T, Tag>
>

View File

@@ -167,7 +167,6 @@ FIT_FOREACH_UNARY_OP(FIT_UNARY_OP)
template<int N>
struct placeholder
{
#if FIT_HAS_MANGLE_OVERLOAD
template<class... Ts>
constexpr auto operator()(Ts&&... xs) const FIT_RETURNS
@@ -252,7 +251,11 @@ struct partial_ap
{
T val;
FIT_DELGATE_CONSTRUCTOR(partial_ap, T, val);
FIT_INHERIT_DEFAULT_EMPTY(partial_ap, T)
template<class X, class... Xs, FIT_ENABLE_IF_CONSTRUCTIBLE(T, X&&, Xs&&...)>
constexpr partial_ap(X&& x, Xs&&... xs) : val(fit::forward<X>(x), fit::forward<Xs>(xs)...)
{}
FIT_RETURNS_CLASS(partial_ap);

View File

@@ -28,12 +28,14 @@ FIT_TEST_CASE()
// Using mutable_ as a workaround on libc++, since mem_fn does not meet the
// requirements of a FunctionObject
FIT_TEST_CHECK(fit::by(fit::mutable_(std::mem_fn(&foo::x)), add)(foo(1), foo(2)) == 3);
static_assert(fit::detail::is_default_constructible<decltype(fit::by(select_x(), add))>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
auto indirect_add = fit::by(*fit::_, fit::_ + fit::_);
FIT_TEST_CHECK(indirect_add(std::unique_ptr<int>(new int(1)), std::unique_ptr<int>(new int(2))) == 3);
static_assert(fit::detail::is_default_constructible<decltype(indirect_add)>::value, "Not default constructible");
}
struct select_x_1

View File

@@ -128,45 +128,80 @@ FIT_TEST_CASE()
// FIT_TEST_CHECK(p(deref()) == 3);
}
class empty1
struct empty1
{};
class empty2
struct empty2
{};
FIT_TEST_CASE()
{
static constexpr auto p1 = fit::pack(empty1());
FIT_TEST_CHECK(p1(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p1(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p1)>::value, "Pack not empty");
#endif
static constexpr auto p2 = fit::pack(empty1(), empty2());
FIT_TEST_CHECK(p2(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p2(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p2)>::value, "Pack not empty");
#endif
static constexpr auto p3 = fit::pack(empty1(), empty2(), empty1());
FIT_TEST_CHECK(p3(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p3(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p3)>::value, "Pack not empty");
#endif
static constexpr auto p4 = fit::pack(empty1(), fit::pack(empty1(), empty2()));
FIT_TEST_CHECK(p4(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p4(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p4)>::value, "Pack not empty");
#endif
static constexpr auto p5 = fit::pack(fit::pack(), fit::pack(fit::pack()), empty1(), fit::pack(empty1(), empty2()));
FIT_TEST_CHECK(p5(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p5(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p5)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<empty1, empty2>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
static constexpr auto p = fit::pack(empty1());
FIT_TEST_CHECK(p(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<decltype(p)>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
static constexpr auto p = fit::pack(empty1(), empty2());
FIT_TEST_CHECK(p(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<decltype(p)>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
static constexpr auto p = fit::pack(fit::pack(), fit::pack());
FIT_TEST_CHECK(p(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<decltype(p)>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
static constexpr auto p = fit::pack(empty1(), empty2(), empty1());
FIT_TEST_CHECK(p(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<decltype(p)>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
static constexpr auto p = fit::pack(empty1(), fit::pack(empty1(), empty2()));
FIT_TEST_CHECK(p(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<decltype(p)>::value, "Not default constructible");
}
FIT_TEST_CASE()
{
static constexpr auto p = fit::pack(fit::pack(), fit::pack(fit::pack()), empty1(), fit::pack(empty1(), empty2()));
FIT_TEST_CHECK(p(fit::always(0)) == 0);
FIT_STATIC_TEST_CHECK(p(fit::always(0)) == 0);
#ifndef _MSC_VER
static_assert(std::is_empty<decltype(p)>::value, "Pack not empty");
#endif
static_assert(fit::detail::is_default_constructible<decltype(p)>::value, "Not default constructible");
}

View File

@@ -15,6 +15,20 @@ struct square
FIT_PLACEHOLDER_TEST_CONSTEXPR auto operator()(T x) const FIT_RETURNS(x*x);
};
#define CHECK_DEFAULT_CONSTRUCTION_OP(op, name) \
static_assert(fit::detail::is_default_constructible<fit::operators::name>::value, "Operator not default constructible");
FIT_TEST_CASE()
{
static_assert(fit::detail::is_default_constructible<fit::placeholder<1>>::value, "Placeholder not default constructible");
static_assert(fit::detail::is_default_constructible<fit::placeholder<2>>::value, "Placeholder not default constructible");
static_assert(fit::detail::is_default_constructible<fit::placeholder<3>>::value, "Placeholder not default constructible");
FIT_FOREACH_BINARY_OP(CHECK_DEFAULT_CONSTRUCTION_OP)
FIT_FOREACH_ASSIGN_OP(CHECK_DEFAULT_CONSTRUCTION_OP)
FIT_FOREACH_UNARY_OP(CHECK_DEFAULT_CONSTRUCTION_OP)
}
FIT_TEST_CASE()
{
const auto x_square_add = 2 + (4*4);
@@ -43,6 +57,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_add)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_add)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_add(2, 1) == x_add);
FIT_TEST_CHECK(f_add(2, 1) == x_add);
@@ -51,6 +66,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_subtract)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_subtract)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_subtract(2, 1) == x_subtract);
FIT_TEST_CHECK(f_subtract(2, 1) == x_subtract);
@@ -59,6 +75,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_multiply)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_multiply)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_multiply(2, 1) == x_multiply);
FIT_TEST_CHECK(f_multiply(2, 1) == x_multiply);
@@ -67,6 +84,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_divide)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_divide)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_divide(2, 1) == x_divide);
FIT_TEST_CHECK(f_divide(2, 1) == x_divide);
@@ -75,6 +93,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_remainder)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_remainder)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_remainder(2, 1) == x_remainder);
FIT_TEST_CHECK(f_remainder(2, 1) == x_remainder);
@@ -83,6 +102,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_right)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_shift_right)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_shift_right(2, 1) == x_shift_right);
FIT_TEST_CHECK(f_shift_right(2, 1) == x_shift_right);
@@ -91,6 +111,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_left)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_shift_left)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_shift_left(2, 1) == x_shift_left);
FIT_TEST_CHECK(f_shift_left(2, 1) == x_shift_left);
@@ -99,6 +120,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_greater_than)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than(2, 1) == x_greater_than);
FIT_TEST_CHECK(f_greater_than(2, 1) == x_greater_than);
@@ -107,6 +129,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_less_than)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_less_than(2, 1) == x_less_than);
FIT_TEST_CHECK(f_less_than(2, 1) == x_less_than);
@@ -115,6 +138,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_less_than_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_less_than_equal(2, 1) == x_less_than_equal);
FIT_TEST_CHECK(f_less_than_equal(2, 1) == x_less_than_equal);
@@ -123,6 +147,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_greater_than_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than_equal(2, 1) == x_greater_than_equal);
FIT_TEST_CHECK(f_greater_than_equal(2, 1) == x_greater_than_equal);
@@ -131,6 +156,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_equal(2, 1) == x_equal);
FIT_TEST_CHECK(f_equal(2, 1) == x_equal);
@@ -139,6 +165,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_not_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_not_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_not_equal(2, 1) == x_not_equal);
FIT_TEST_CHECK(f_not_equal(2, 1) == x_not_equal);
@@ -147,6 +174,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_and)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_bit_and)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_bit_and(2, 1) == x_bit_and);
FIT_TEST_CHECK(f_bit_and(2, 1) == x_bit_and);
@@ -155,6 +183,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_xor_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_xor_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_xor_(2, 1) == x_xor_);
FIT_TEST_CHECK(f_xor_(2, 1) == x_xor_);
@@ -163,6 +192,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_or)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_bit_or)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_bit_or(2, 1) == x_bit_or);
FIT_TEST_CHECK(f_bit_or(2, 1) == x_bit_or);
@@ -171,6 +201,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_and_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_and_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_and_(true, false) == x_and_);
FIT_TEST_CHECK(f_and_(true, false) == x_and_);
@@ -179,6 +210,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_or_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_or_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_or_(true, false) == x_or_);
FIT_TEST_CHECK(f_or_(true, false) == x_or_);
}
@@ -191,6 +223,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_not_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_not_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_not_(false) == x_not_);
FIT_TEST_CHECK(f_not_(false) == x_not_);
@@ -199,6 +232,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_compl_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_compl_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_compl_(2) == x_compl_);
FIT_TEST_CHECK(f_compl_(2) == x_compl_);
@@ -207,6 +241,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_unary_plus)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_unary_plus)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_unary_plus(2) == x_unary_plus);
FIT_TEST_CHECK(f_unary_plus(2) == x_unary_plus);
@@ -215,6 +250,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_unary_subtract)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_unary_subtract)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_unary_subtract(2) == x_unary_subtract);
FIT_TEST_CHECK(f_unary_subtract(2) == x_unary_subtract);
@@ -223,6 +259,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_dereference)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_dereference)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_dereference(&x_dereference) == x_dereference);
FIT_TEST_CHECK(f_dereference(&x_dereference) == x_dereference);
@@ -233,6 +270,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_increment)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_increment)>::value, "Not default constructible");
f_increment(x_increment);
FIT_TEST_CHECK(x_increment == 3);
@@ -241,6 +279,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_decrement)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_decrement)>::value, "Not default constructible");
f_decrement(x_decrement);
FIT_TEST_CHECK(x_decrement == 1);
#endif
@@ -256,6 +295,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_add)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_add)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_add(2, 1) == x_add);
FIT_TEST_CHECK(f_add(2, 1) == x_add);
@@ -264,6 +304,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_subtract)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_subtract)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_subtract(2, 1) == x_subtract);
FIT_TEST_CHECK(f_subtract(2, 1) == x_subtract);
@@ -272,6 +313,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_multiply)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_multiply)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_multiply(2, 1) == x_multiply);
FIT_TEST_CHECK(f_multiply(2, 1) == x_multiply);
@@ -280,6 +322,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_divide)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_divide)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_divide(2, 1) == x_divide);
FIT_TEST_CHECK(f_divide(2, 1) == x_divide);
@@ -288,6 +331,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_remainder)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_remainder)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_remainder(2, 1) == x_remainder);
FIT_TEST_CHECK(f_remainder(2, 1) == x_remainder);
@@ -296,6 +340,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_right)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_shift_right)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_shift_right(2, 1) == x_shift_right);
FIT_TEST_CHECK(f_shift_right(2, 1) == x_shift_right);
@@ -304,6 +349,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_left)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_shift_left)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_shift_left(2, 1) == x_shift_left);
FIT_TEST_CHECK(f_shift_left(2, 1) == x_shift_left);
@@ -312,6 +358,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_greater_than)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than(2, 1) == x_greater_than);
FIT_TEST_CHECK(f_greater_than(2, 1) == x_greater_than);
@@ -320,6 +367,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_less_than)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_less_than(2, 1) == x_less_than);
FIT_TEST_CHECK(f_less_than(2, 1) == x_less_than);
@@ -328,6 +376,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_less_than_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_less_than_equal(2, 1) == x_less_than_equal);
FIT_TEST_CHECK(f_less_than_equal(2, 1) == x_less_than_equal);
@@ -336,6 +385,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_greater_than_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than_equal(2, 1) == x_greater_than_equal);
FIT_TEST_CHECK(f_greater_than_equal(2, 1) == x_greater_than_equal);
@@ -344,6 +394,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_equal(2, 1) == x_equal);
FIT_TEST_CHECK(f_equal(2, 1) == x_equal);
@@ -352,6 +403,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_not_equal)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_not_equal)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_not_equal(2, 1) == x_not_equal);
FIT_TEST_CHECK(f_not_equal(2, 1) == x_not_equal);
@@ -360,6 +412,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_and)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_bit_and)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_bit_and(2, 1) == x_bit_and);
FIT_TEST_CHECK(f_bit_and(2, 1) == x_bit_and);
@@ -368,6 +421,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_xor_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_xor_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_xor_(2, 1) == x_xor_);
FIT_TEST_CHECK(f_xor_(2, 1) == x_xor_);
@@ -376,6 +430,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_or)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_bit_or)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_bit_or(2, 1) == x_bit_or);
FIT_TEST_CHECK(f_bit_or(2, 1) == x_bit_or);
@@ -384,6 +439,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_and_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_and_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_and_(true, false) == x_and_);
FIT_TEST_CHECK(f_and_(true, false) == x_and_);
@@ -392,6 +448,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_or_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_or_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_or_(true, false) == x_or_);
FIT_TEST_CHECK(f_or_(true, false) == x_or_);
}
@@ -403,6 +460,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_add)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_add)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_add(1) == x_add);
FIT_TEST_CHECK(f_add(1) == x_add);
@@ -411,6 +469,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_subtract)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_subtract)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_subtract(1) == x_subtract);
FIT_TEST_CHECK(f_subtract(1) == x_subtract);
@@ -419,6 +478,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_multiply)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_multiply)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_multiply(1) == x_multiply);
FIT_TEST_CHECK(f_multiply(1) == x_multiply);
@@ -427,6 +487,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_divide)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_divide)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_divide(1) == x_divide);
FIT_TEST_CHECK(f_divide(1) == x_divide);
@@ -435,6 +496,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_remainder)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_remainder)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_remainder(1) == x_remainder);
FIT_TEST_CHECK(f_remainder(1) == x_remainder);
@@ -443,6 +505,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_right)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_shift_right)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_shift_right(1) == x_shift_right);
FIT_TEST_CHECK(f_shift_right(1) == x_shift_right);
@@ -451,6 +514,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_left)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_shift_left)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_shift_left(1) == x_shift_left);
FIT_TEST_CHECK(f_shift_left(1) == x_shift_left);
@@ -459,6 +523,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_greater_than)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than(1) == x_greater_than);
FIT_TEST_CHECK(f_greater_than(1) == x_greater_than);
@@ -467,6 +532,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_less_than)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_less_than(1) == x_less_than);
FIT_TEST_CHECK(f_less_than(1) == x_less_than);
@@ -475,6 +541,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_less_than_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_less_than_equal(1) == x_less_than_equal);
FIT_TEST_CHECK(f_less_than_equal(1) == x_less_than_equal);
@@ -483,6 +550,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_greater_than_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than_equal(1) == x_greater_than_equal);
FIT_TEST_CHECK(f_greater_than_equal(1) == x_greater_than_equal);
@@ -491,6 +559,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_equal(1) == x_equal);
FIT_TEST_CHECK(f_equal(1) == x_equal);
@@ -499,6 +568,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_not_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_not_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_not_equal(1) == x_not_equal);
FIT_TEST_CHECK(f_not_equal(1) == x_not_equal);
@@ -507,6 +577,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_and)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_bit_and)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_bit_and(1) == x_bit_and);
FIT_TEST_CHECK(f_bit_and(1) == x_bit_and);
@@ -515,6 +586,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_xor_)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_xor_)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_xor_(1) == x_xor_);
FIT_TEST_CHECK(f_xor_(1) == x_xor_);
@@ -523,6 +595,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_or)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_bit_or)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_bit_or(1) == x_bit_or);
FIT_TEST_CHECK(f_bit_or(1) == x_bit_or);
@@ -531,6 +604,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_and_)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_and_)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_and_(false) == x_and_);
FIT_TEST_CHECK(f_and_(false) == x_and_);
@@ -539,6 +613,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_or_)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_or_)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_or_(false) == x_or_);
FIT_TEST_CHECK(f_or_(false) == x_or_);
}
@@ -550,6 +625,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_add)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_add)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_add(2) == x_add);
FIT_TEST_CHECK(f_add(2) == x_add);
@@ -558,6 +634,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_subtract)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_subtract)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_subtract(2) == x_subtract);
FIT_TEST_CHECK(f_subtract(2) == x_subtract);
@@ -566,6 +643,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_multiply)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_multiply)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_multiply(2) == x_multiply);
FIT_TEST_CHECK(f_multiply(2) == x_multiply);
@@ -574,6 +652,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_divide)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_divide)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_divide(2) == x_divide);
FIT_TEST_CHECK(f_divide(2) == x_divide);
@@ -582,6 +661,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_remainder)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_remainder)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_remainder(2) == x_remainder);
FIT_TEST_CHECK(f_remainder(2) == x_remainder);
@@ -590,6 +670,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_right)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_shift_right)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_shift_right(2) == x_shift_right);
FIT_TEST_CHECK(f_shift_right(2) == x_shift_right);
@@ -598,6 +679,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_shift_left)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_shift_left)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_shift_left(2) == x_shift_left);
FIT_TEST_CHECK(f_shift_left(2) == x_shift_left);
@@ -606,6 +688,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_greater_than)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than(2) == x_greater_than);
FIT_TEST_CHECK(f_greater_than(2) == x_greater_than);
@@ -614,6 +697,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_less_than)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_less_than(2) == x_less_than);
FIT_TEST_CHECK(f_less_than(2) == x_less_than);
@@ -622,6 +706,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_less_than_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_less_than_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_less_than_equal(2) == x_less_than_equal);
FIT_TEST_CHECK(f_less_than_equal(2) == x_less_than_equal);
@@ -630,6 +715,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_greater_than_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_greater_than_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_greater_than_equal(2) == x_greater_than_equal);
FIT_TEST_CHECK(f_greater_than_equal(2) == x_greater_than_equal);
@@ -638,6 +724,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_equal(2) == x_equal);
FIT_TEST_CHECK(f_equal(2) == x_equal);
@@ -646,6 +733,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_not_equal)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_not_equal)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_not_equal(2) == x_not_equal);
FIT_TEST_CHECK(f_not_equal(2) == x_not_equal);
@@ -654,6 +742,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_and)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_bit_and)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_bit_and(2) == x_bit_and);
FIT_TEST_CHECK(f_bit_and(2) == x_bit_and);
@@ -662,6 +751,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_xor_)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_xor_)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_xor_(2) == x_xor_);
FIT_TEST_CHECK(f_xor_(2) == x_xor_);
@@ -670,6 +760,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_bit_or)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_bit_or)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_bit_or(2) == x_bit_or);
FIT_TEST_CHECK(f_bit_or(2) == x_bit_or);
@@ -678,6 +769,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_and_)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_and_)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_and_(true) == x_and_);
FIT_TEST_CHECK(f_and_(true) == x_and_);
@@ -686,6 +778,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_or_)>::value, "Not copyable");
#endif
static_assert(!fit::detail::is_default_constructible<decltype(f_or_)>::value, "default constructible");
FIT_STATIC_TEST_CHECK(f_or_(true) == x_or_);
FIT_TEST_CHECK(f_or_(true) == x_or_);
}
@@ -698,6 +791,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_not_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_not_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_not_(false) == x_not_);
FIT_TEST_CHECK(f_not_(false) == x_not_);
@@ -706,6 +800,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_compl_)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_compl_)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_compl_(2) == x_compl_);
FIT_TEST_CHECK(f_compl_(2) == x_compl_);
@@ -714,6 +809,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_unary_plus)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_unary_plus)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_unary_plus(2) == x_unary_plus);
FIT_TEST_CHECK(f_unary_plus(2) == x_unary_plus);
@@ -722,6 +818,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_unary_subtract)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_unary_subtract)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_unary_subtract(2) == x_unary_subtract);
FIT_TEST_CHECK(f_unary_subtract(2) == x_unary_subtract);
@@ -730,6 +827,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_dereference)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_dereference)>::value, "Not default constructible");
FIT_STATIC_TEST_CHECK(f_dereference(&x_dereference) == x_dereference);
FIT_TEST_CHECK(f_dereference(&x_dereference) == x_dereference);
@@ -740,6 +838,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_increment)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_increment)>::value, "Not default constructible");
f_increment(x_increment);
FIT_TEST_CHECK(x_increment == 3);
@@ -748,6 +847,7 @@ FIT_TEST_CASE()
#if defined(__GNUC__) && !defined (__clang__) && __GNUC__ == 4 && __GNUC_MINOR__ > 6
static_assert(std::is_copy_constructible<decltype(f_decrement)>::value, "Not copyable");
#endif
static_assert(fit::detail::is_default_constructible<decltype(f_decrement)>::value, "Not default constructible");
f_decrement(x_decrement);
FIT_TEST_CHECK(x_decrement == 1);
#endif