kblib
0.2.3
General utilities library for modern C++
traits.cpp
Go to the documentation of this file.
1
#include "
kblib/traits.h
"
2
#include <catch.hpp>
3
4
struct
k
{
5
char
c
[10];
6
};
7
8
static_assert
(not std::is_reference<
kblib::member_of_t
<
decltype
(&
k::c
)>>::value,
9
""
);
10
static_assert
(
kblib::is_iterable<int[10]>::value
,
""
);
11
12
static
void
f(
int
i, std::string s) {}
13
14
TEST_CASE
(
"type_constant"
) {
15
auto
fw =
kblib::type_constant
<
decltype
(f)*, f>{};
16
int
i{};
17
std::string s;
18
f(i, s);
19
fw(i, s);
20
}
kblib::member_of_t
typename member_of< T >::type member_of_t
Definition:
traits.h:297
k
Definition:
traits.cpp:4
k::c
char c[10]
Definition:
traits.cpp:5
kblib::is_iterable
Definition:
traits.h:400
kblib::type_constant
Definition:
traits.h:447
TEST_CASE
TEST_CASE("type_constant")
Definition:
traits.cpp:14
traits.h
Contains some type traits not in the standard library that are useful in the implementation of kblib.
tests
traits.cpp
Generated by
1.9.4