🛰️航天仿真算法库 SpaceAST
0.0.1
载入中...
搜索中...
未找到
TypeTraits.hpp
1
20
21
#pragma once
22
23
#include "AstGlobal.h"
24
#include <type_traits>
25
26
AST_NAMESPACE_BEGIN
27
28
30
template
<
typename
F,
typename
... Args>
31
struct
is_callable
{
32
private
:
33
template
<
typename
U>
34
static
auto
test(
int
) ->
decltype
(
35
std::declval<U>()(std::declval<Args>()...),
// 可调用
36
std::true_type{}
37
);
38
39
template
<
typename
>
40
static
std::false_type test(...);
41
42
public
:
43
static
constexpr
bool
value =
decltype
(test<F>(0))::value;
44
};
45
46
47
48
AST_NAMESPACE_END
ast::is_callable
判断类型是否可调用
定义
TypeTraits.hpp:31
src
AstUtil
Util
TypeTraits.hpp
制作者
1.12.0