66Defined in <boost /openmethod /policies /core.hpp >.
77
88`` `c++
9- namespace boost::openmethod::policies {
9+ namespace boost::openmethod {
10+
11+ namespace policies {
1012
1113template<class Policy, class... Facets >
1214struct basic_policy : virtual abstract_policy,
13- virtual basic_domain <Policy>,
15+ virtual domain <Policy>,
1416 virtual Facets... {
1517 template<class Facet >
1618 static constexpr bool has_facet = /*unspecified* /;
@@ -28,7 +30,19 @@ struct basic_policy : virtual abstract_policy,
2830 using remove = /*unspecified*/;
2931};
3032
31- }
33+ struct release : basic_policy<release, ...> {};
34+
35+ struct debug : release::add<...> {};
36+
37+ } // policies
38+
39+ #ifdef NDEBUG
40+ using default_policy = policies::release;
41+ #else
42+ using default_policy = policies::debug;
43+ #endif
44+
45+ } // boost::openmethod
3246```
3347
3448### Description
@@ -101,3 +115,30 @@ It is not an error if _policy_ does not contain such a facet; in that case, the
101115new policy contains the same facet as the original one.
102116
103117The original policy and the new one share static variables.
118+
119+ ### Non-members
120+
121+ #### release
122+
123+ ```c++
124+ struct release;
125+ ```
126+
127+ A policy that contains facet implementations `std_rtti`, `fast_perfect_hash`,
128+ `vptr_vector` and `vectored_error_handler`.
129+
130+ #### debug
131+
132+ ```c++
133+ struct debug;
134+ ```
135+
136+ The `release` policy with additional facet implementations `runtime_checks`,
137+ `basic_error_output` and basic_trace_output.
138+
139+ NOTE: `debug` extends `release` but it does not a fork it. Both policies use the
140+ same `domain`.
141+
142+ #### default_policy
143+
144+ An alias for `release` if `NDEBUG` is defined, and for `debug` otherwise.
0 commit comments