-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlog_trait.cpp
54 lines (32 loc) · 1.23 KB
/
log_trait.cpp
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
//-----------------------------------------------------------------------------
// Copyright (c) 2018 Benjamin Buch
//
// https://github.com/bebuch/logsys
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at https://www.boost.org/LICENSE_1_0.txt)
//-----------------------------------------------------------------------------
#include <logsys/detail/log_trait.hpp>
namespace{
struct log_required_functions{
void exec()noexcept;
void set_body_exception(std::exception_ptr error)noexcept;
void set_log_exception(std::exception_ptr error)noexcept;
};
struct log_01: log_required_functions{};
using trait_01 = logsys::log_trait< log_01 >;
static_assert(!trait_01::has_body_finished);
struct log_02: log_required_functions{
void body_finished()noexcept;
};
using trait_02 = logsys::log_trait< log_02 >;
static_assert( trait_02::has_body_finished);
struct log_03: log_required_functions{
static std::unique_ptr< log_03 > factory()noexcept;
};
using trait_03 = logsys::log_trait< log_03 >;
static_assert(!trait_03::has_body_finished);
struct log_04: log_03{};
using trait_04 = logsys::log_trait< log_04 >;
static_assert(!trait_04::has_body_finished);
}