/* * Created by Jozef on 02/12/2018. * Copyright 2018 Two Blue Cubes Ltd. All rights reserved. * * Distributed under the Boost Software License, Version 1.0. (See accompanying * file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef TWOBLUECUBES_CATCH_META_HPP_INCLUDED #define TWOBLUECUBES_CATCH_META_HPP_INCLUDED #include namespace Catch { template struct always_false : std::false_type {}; template struct true_given : std::true_type {}; struct is_callable_tester { template true_given()(std::declval()...))> static test(int); template std::false_type static test(...); }; template struct is_callable; template struct is_callable : decltype(is_callable_tester::test(0)) {}; #if defined(__cpp_lib_is_invocable) && __cpp_lib_is_invocable >= 201703 // std::result_of is deprecated in C++17 and removed in C++20. Hence, it is // replaced with std::invoke_result here. Also *_t format is preferred over // typename *::type format. template using FunctionReturnType = std::remove_reference_t>>; #else template using FunctionReturnType = typename std::remove_reference::type>::type>::type; #endif } // namespace Catch namespace mpl_{ struct na; } #endif // TWOBLUECUBES_CATCH_META_HPP_INCLUDED