mirror of
https://github.com/boostorg/callable_traits.git
synced 2026-02-13 00:12:11 +00:00
adding examples, fixing bugs
This commit is contained in:
@@ -5,13 +5,8 @@ Distributed under the Boost Software License, Version 1.0.
|
||||
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
#include <type_traits>
|
||||
#include <callable_traits/callable_traits.hpp>
|
||||
|
||||
// NOTE: Due to non-compliance in MSVC, can_invoke_constexpr
|
||||
// always returns std::false_type on that compiler, which
|
||||
// causes a static assert below to fail.
|
||||
|
||||
namespace ct = callable_traits;
|
||||
|
||||
struct foo {
|
||||
@@ -24,9 +19,9 @@ struct foo {
|
||||
// arguments are valid to INVOKE
|
||||
static_assert(ct::can_invoke(&foo::bar, foo{}, 0), "");
|
||||
|
||||
|
||||
// can_invoke returns std::false_type here because the
|
||||
// arguments are NOT valid to INVOKE
|
||||
static_assert(!ct::can_invoke_constexpr(&foo::bar, foo{}), "");
|
||||
// arguments are NOT valid to INVOKE - foo::bar can't be
|
||||
// invoked like a void member function.
|
||||
static_assert(!ct::can_invoke(&foo::bar, foo{}), "");
|
||||
|
||||
int main() { return 0; }
|
||||
|
||||
Reference in New Issue
Block a user