-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdaw_can_constant_evaluate_test.cpp
More file actions
65 lines (52 loc) · 1.53 KB
/
Copy pathdaw_can_constant_evaluate_test.cpp
File metadata and controls
65 lines (52 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
// Copyright (c) Darrell Wright
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE or copy at http://www.boost.org/LICENSE_1_0.txt)
//
// Official repository: https://github.com/beached/
//
#include <daw/daw_can_constant_evaluate.h>
#include <daw/daw_cpp_feature_check.h>
#include <string>
struct NotCXExpr {
void operator( )( ) const {}
};
inline static constexpr auto NotCXExpr_v = NotCXExpr{ };
static_assert( not daw::can_constant_evaluate_v<NotCXExpr_v> );
struct CXExpr {
constexpr void operator( )( ) const {}
};
inline static constexpr auto CXExpr_v = CXExpr{ };
static_assert( daw::can_constant_evaluate_v<CXExpr_v> );
#if false // TODO FIX or get rid of
static_assert(
not daw::can_potentially_constant_construct_v<std::string, std::string> );
#endif
struct CXAggEmpty {};
static_assert( daw::can_potentially_constant_construct_v<CXAggEmpty> );
struct CXAggInt {
int a;
};
static_assert( daw::can_potentially_constant_construct_v<CXAggInt, int> );
static_assert( daw::can_potentially_constant_construct_v<int, int> );
class Foo {
public:
Foo( int ) {}
};
static_assert( not daw::can_potentially_constant_construct_v<Foo, int> );
class CFoo {
public:
constexpr CFoo( int ) {}
};
static_assert( daw::can_potentially_constant_construct_v<CFoo, int> );
class Bar {
public:
Bar( Foo ) {}
};
static_assert( not daw::can_potentially_constant_construct_v<Bar, Foo> );
class CBar {
public:
CBar( CFoo ) {}
};
static_assert( not daw::can_potentially_constant_construct_v<CBar, CFoo> );
int main( ) {}