LeechCraft
0.6.70-18450-gabe19ee3b0
Modular cross-platform feature rich live environment.
Toggle main menu visibility
Loading...
Searching...
No Matches
typelisttest.cpp
Go to the documentation of this file.
1
/**********************************************************************
2
* LeechCraft - modular cross-platform feature rich internet client.
3
* Copyright (C) 2006-2014 Georg Rudoy
4
*
5
* Distributed under the Boost Software License, Version 1.0.
6
* (See accompanying file LICENSE or copy at https://www.boost.org/LICENSE_1_0.txt)
7
**********************************************************************/
8
9
#include "
typelisttest.h
"
10
#include <QtTest>
11
#include <
typelist.h
>
12
#include <
typelevel.h
>
13
14
QTEST_MAIN (
LC::Util::TypelistTest
)
15
16
namespace
LC
17
{
18
namespace
Util
19
{
20
void
TypelistTest::testHasTypeTrue ()
21
{
22
static_assert
(
HasType<struct Foo>
(Typelist<struct Bar, struct Baz, struct Foo> {}),
"test failed"
);
23
}
24
25
void
TypelistTest::testHasTypeFalse ()
26
{
27
static_assert
(!
HasType<struct Foo>
(Typelist<struct Bar, struct Baz, struct Qux> {}),
"test failed"
);
28
}
29
30
template
<
typename
T>
31
using
IsVoid_t
= std::is_same<T, void>;
32
33
void
TypelistTest::testFilter ()
34
{
35
using
List_t =
Typelist<struct Foo, struct Bar, void, void, int, double, void>
;
36
using
Expected_t =
Typelist<struct Foo, struct Bar, int, double>
;
37
using
Removed_t =
Typelist<void, void, void>
;
38
39
static_assert
(std::is_same<Removed_t, Filter_t<IsVoid_t, List_t>>::value,
"test failed"
);
40
static_assert
(std::is_same<Expected_t, Filter_t<Not<IsVoid_t>::Result_t, List_t>>::value,
"test failed"
);
41
}
42
}
43
}
LC::Util::TypelistTest
Definition
typelisttest.h:18
LC::Util
Definition
icoreproxy.h:34
LC::Util::HasType
constexpr bool HasType(List< Args... >)
Definition
typelist.h:95
LC::Util::IsVoid_t
std::is_same< T, void > IsVoid_t
Definition
typelisttest.cpp:31
LC
Definition
constants.h:15
LC::Util::Typelist
Definition
typelist.h:19
typelevel.h
typelist.h
typelisttest.h
src
util
sll
tests
typelisttest.cpp
Generated by
1.17.0