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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
|
| #ifndef BOOST_CONTRACT_DETAIL_DECL_HPP_
| #define BOOST_CONTRACT_DETAIL_DECL_HPP_
|
| // Copyright (C) 2008-2018 Lorenzo Caminiti
| // Distributed under the Boost Software License, Version 1.0 (see accompanying
| // file LICENSE_1_0.txt or a copy at http://www.boost.org/LICENSE_1_0.txt).
| // See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
| // Cannot include core/*.hpp other than config.hpp here (avoid circular incl).
| #include <boost/contract/detail/tvariadic.hpp>
| #if !BOOST_CONTRACT_DETAIL_TVARIADIC
| #include <boost/contract/core/config.hpp>
| #include <boost/preprocessor/repetition/repeat.hpp>
| #include <boost/preprocessor/tuple/elem.hpp>
| #include <boost/preprocessor/arithmetic/inc.hpp>
| #endif
| #include <boost/preprocessor/control/expr_iif.hpp>
| #include <boost/preprocessor/control/iif.hpp>
| #include <boost/preprocessor/punctuation/comma_if.hpp>
|
| /* PUBLIC */
|
| #define BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
| arity, is_friend, has_result, \
| O, VR, F, C, Args, \
| v, r, f, obj, args \
| ) \
| template< \
| class O \
| BOOST_PP_COMMA_IF(has_result) \
| BOOST_PP_EXPR_IIF(has_result, typename VR) \
| , typename F \
| , class C \
| BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
| BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(z, arity, Args) \
| > \
| BOOST_PP_EXPR_IIF(is_friend, friend) \
| boost::contract::specify_precondition_old_postcondition_except< \
| BOOST_PP_EXPR_IIF(has_result, VR)> \
| /* no boost::contract:: here for friends (otherwise need fwd decl) */ \
| public_function( \
| boost::contract::virtual_* v \
| BOOST_PP_COMMA_IF(has_result) \
| BOOST_PP_EXPR_IIF(has_result, VR& r) \
| , F f \
| , C* obj \
| BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
| BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z(z, arity, Args, &, args) \
| )
|
| #if BOOST_CONTRACT_DETAIL_TVARIADIC
| #define BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(z, \
| O, VR, F, C, Args, \
| v, r, f, obj, args \
| ) \
| BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
| ~, /* is_friend = */ 1, /* has_result = */ 0, \
| O, VR, F, C, Args, v, r, f, obj, args \
| ); \
| BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
| ~, /* is_friend = */ 1, /* has_result = */ 1, \
| O, VR, F, C, Args, v, r, f, obj, args \
| );
| #else
| /* PRIVATE */
| #define BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_( \
| z, n, result_O_R_F_C_Args_v_r_f_obj_args) \
| BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
| /* arity = */ n, \
| /* is_friend = */ 1, \
| BOOST_PP_TUPLE_ELEM(11, 0, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 1, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 2, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 3, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 4, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 5, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 6, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 7, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 8, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 9, result_O_R_F_C_Args_v_r_f_obj_args), \
| BOOST_PP_TUPLE_ELEM(11, 10, result_O_R_F_C_Args_v_r_f_obj_args) \
| );
|
| /* PUBLIC */
| #define BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(z, \
| O, VR, F, C, Args, \
| v, r, f, obj, args \
| ) \
| BOOST_PP_REPEAT_ ## z( \
| BOOST_PP_INC(BOOST_CONTRACT_MAX_ARGS), \
| BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \
| (/* has_result = */ 0, O, VR, F, C, Args, v, r, f, obj, args) \
| ) \
| BOOST_PP_REPEAT_ ## z( \
| BOOST_PP_INC(BOOST_CONTRACT_MAX_ARGS), \
| BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \
| (/* has_result = */ 1, O, VR, F, C, Args, v, r, f, obj, args) \
| )
| #endif
|
| #define BOOST_CONTRACT_DETAIL_DECL_DETAIL_COND_SUBCONTRACTING_Z( \
| z, is_friend, O, VR, F, C, Args) \
| template< \
| class O, typename VR, typename F, class C \
| BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS) \
| BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(z, \
| BOOST_CONTRACT_MAX_ARGS, Args) \
| > \
| BOOST_PP_IIF(is_friend, \
| friend class boost::contract::detail:: \
| , \
| class \
| ) \
| cond_subcontracting
|
| /* CODE */
|
| namespace boost {
| namespace contract {
| class virtual_;
|
| template<typename VR = void>
| class specify_precondition_old_postcondition_except;
| }
| }
|
| #endif // #include guard
|
|