mirror of
https://github.com/boostorg/contract.git
synced 2026-02-27 04:52:22 +00:00
renamed aux to detail
This commit is contained in:
@@ -25,8 +25,6 @@
|
||||
|
||||
// TODO: Document that default generated functions (generated default constructors, copy constructors, copy operators, destructors, move constructors, move operators, etc.) will not check contracts. Programmer have to program them in order to check contracts.
|
||||
|
||||
// TODO: Replace "aux" with "detail" (and "ext" with "share").
|
||||
|
||||
// TODO: Add all copyright and licencing info (to all files, etc.).
|
||||
|
||||
// TODO: Should C++11 move preserve class invariants at exit and/or on throw? Maybe not because after move no other public member can be called (but dtor can... so dtor should not check inv at that time...). If so, users could use an internal moved_ data member to guard class invariant checking and set that after the move operation... How can I program C++11 move operations with this lib? Should I used boost::contract::function instead of public_function? (But probably not because that does not subcontract and does not check inv at entry...)
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
|
||||
@@ -1,185 +0,0 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_TVARIADIC_HPP_
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC 0
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC 1
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#include <tuple>
|
||||
|
||||
/* CODE */
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace tvariadic_ {
|
||||
template<int...> struct indexes {};
|
||||
|
||||
template<int N, int... I> struct indexes_of :
|
||||
indexes_of<N - 1, N - 1, I...> {};
|
||||
template<int... I> struct indexes_of<0, I...>
|
||||
{ typedef indexes<I...> type; };
|
||||
} } } } // namespace
|
||||
|
||||
#else
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_ELEM_(z, n, tuple) \
|
||||
BOOST_PP_CAT(tuple, n)
|
||||
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INIT_(z, n, tuplevar_values) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, tuplevar_values), n)( \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, tuplevar_values), n))
|
||||
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_(z, n, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, type_qualifier_name), n) \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 2, type_qualifier_name), n) \
|
||||
;
|
||||
|
||||
#define BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_(z, n, tokens) \
|
||||
tokens
|
||||
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_ARG_(z, n, name) \
|
||||
BOOST_PP_CAT(name, n)
|
||||
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_FPARAM_(z, n, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, type_qualifier_name), n) \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 2, type_qualifier_name), n)
|
||||
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TPARAM_(z, n, name) \
|
||||
typename BOOST_PP_CAT(name, n)
|
||||
#endif
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) ,
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) BOOST_PP_COMMA_IF(arity)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(arity) /* nothing */
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(arity) \
|
||||
BOOST_PP_COMMA_IF(arity)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_SIZEOF(arity, name) sizeof...(name)
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_SIZEOF(arity, name) arity
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TPARAMS_Z(z, arity, name) \
|
||||
typename... name
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TPARAMS_Z(z, arity, name) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_AUX_TVARIADIC_TPARAM_, name)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_FPARAMS_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
type qualifier ... name
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_FPARAMS_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_AUX_TVARIADIC_FPARAM_, \
|
||||
(type, qualifier, name))
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(z, arity, name) \
|
||||
name...
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(z, arity, name) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_AUX_TVARIADIC_ARG_, name)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(z, arity, tokens) \
|
||||
/* nothing */
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(z, arity, tokens) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_, \
|
||||
tokens)
|
||||
#endif
|
||||
|
||||
// Tuple.
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
std::tuple<type qualifier ...> name;
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
BOOST_PP_REPEAT_ ## z(arity, BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_, \
|
||||
(type, qualifier, name))
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INIT_Z(z, arity, tuple, values) \
|
||||
tuple(values...)
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INIT_Z(z, arity, tuple, values) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INIT_, \
|
||||
(tuple, values))
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_TPARAM(indexes) \
|
||||
int... indexes
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_TPARAM(indexes) \
|
||||
/* nothing */
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_FPARAM(_indexes) \
|
||||
boost::contract::aux::tvariadic_::indexes<_indexes...>
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_FPARAM(_indexes) \
|
||||
/* nothing */
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_OF(tuple_type) \
|
||||
typename boost::contract::aux::tvariadic_::indexes_of< \
|
||||
sizeof...(tuple_type)>::type()
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_OF(unused) \
|
||||
/* nothing */
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_ELEMS_Z( \
|
||||
z, arity, indexes, tuple) \
|
||||
std::get<indexes>(tuple)...
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_ELEMS_Z( \
|
||||
z, arity, indexes, tuple) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_ELEM_, \
|
||||
tuple)
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#include <boost/preprocessor/config/config.hpp>
|
||||
|
||||
#if !BOOST_PP_VARIADICS
|
||||
@@ -26,10 +26,10 @@ BOOST_CONTRACT_ERROR_macro_BASE_TYPES_requires_variadic_macros_otherwise_manuall
|
||||
#else // contracts on
|
||||
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#include <boost/contract/aux_/preprocessor/keyword/virtual.hpp>
|
||||
#include <boost/contract/aux_/preprocessor/keyword/public.hpp>
|
||||
#include <boost/contract/aux_/preprocessor/keyword/protected.hpp>
|
||||
#include <boost/contract/aux_/preprocessor/keyword/private.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/virtual.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/public.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/protected.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/private.hpp>
|
||||
#include <boost/preprocessor/variadic/to_seq.hpp>
|
||||
#include <boost/preprocessor/seq/fold_left.hpp>
|
||||
#include <boost/preprocessor/seq/enum.hpp>
|
||||
@@ -47,8 +47,8 @@ BOOST_CONTRACT_ERROR_macro_BASE_TYPES_requires_variadic_macros_otherwise_manuall
|
||||
|
||||
#define BOOST_CONTRACT_BASE_TYPES_REMOVE_VIRTUAL_(base) \
|
||||
BOOST_PP_EXPAND( \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_VIRTUAL(base), \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_REMOVE_VIRTUAL \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_VIRTUAL(base), \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_VIRTUAL \
|
||||
, \
|
||||
BOOST_PP_TUPLE_REM(1) \
|
||||
)(base) \
|
||||
@@ -75,16 +75,16 @@ BOOST_CONTRACT_ERROR_macro_BASE_TYPES_requires_variadic_macros_otherwise_manuall
|
||||
1, \
|
||||
BOOST_PP_SEQ_PUSH_BACK(types_nilseq, \
|
||||
BOOST_CONTRACT_BASE_TYPES_REMOVE_VIRTUAL_( \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_REMOVE_PUBLIC(base)) \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_PUBLIC(base)) \
|
||||
) \
|
||||
)
|
||||
|
||||
#define BOOST_CONTRACT_BASE_TYPES_ACCESS_(is_public, types_nilseq, base) \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PUBLIC(base), \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PUBLIC(base), \
|
||||
BOOST_CONTRACT_BASE_TYPES_PUSH_BACK_PUBLIC_ \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PROTECTED(base), \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PROTECTED(base), \
|
||||
BOOST_CONTRACT_BASE_TYPES_SKIP_NOT_PUBLIC_ \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PRIVATE(base), \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PRIVATE(base), \
|
||||
BOOST_CONTRACT_BASE_TYPES_SKIP_NOT_PUBLIC_ \
|
||||
, \
|
||||
BOOST_CONTRACT_BASE_TYPES_PUSH_BACK_IF_ \
|
||||
@@ -122,11 +122,11 @@ BOOST_CONTRACT_ERROR_macro_BASE_TYPES_requires_variadic_macros_otherwise_manuall
|
||||
BOOST_CONTRACT_ERROR_all_bases_must_explicitly_specify_public_protected_or_private base_tuple
|
||||
|
||||
#define BOOST_CONTRACT_BASE_TYPES_IS_ACCESS_(base) \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PUBLIC(base), \
|
||||
BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PUBLIC(base), \
|
||||
1 \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PROTECTED(base), \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PROTECTED(base), \
|
||||
1 \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PRIVATE(base), \
|
||||
, BOOST_PP_IIF(BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PRIVATE(base), \
|
||||
1 \
|
||||
, \
|
||||
0 \
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
||||
|
||||
// Do not include all_core_headers here (call_if is essentially standalone).
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/config.hpp>
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
namespace boost { namespace contract {
|
||||
|
||||
template<bool Cond, typename Then, typename R = boost::contract::aux::none>
|
||||
template<bool Cond, typename Then, typename R = boost::contract::detail::none>
|
||||
class call_if_statement {}; // Empty so cannot be used (but copyable).
|
||||
|
||||
// Dispatch true condition (then) between non-void and void calls.
|
||||
@@ -38,7 +38,7 @@ class call_if_statement {}; // Empty so cannot be used (but copyable).
|
||||
// checked to be true (as Then() is required to be valid only in that case) so
|
||||
// this extra level of dispatching is necessary to avoid compiler errors.
|
||||
template<typename Then>
|
||||
class call_if_statement<true, Then, boost::contract::aux::none> :
|
||||
class call_if_statement<true, Then, boost::contract::detail::none> :
|
||||
public call_if_statement<true, Then, // Copyable (as its base).
|
||||
BOOST_CONTRACT_CALL_IF_ENABLE_IF_UNARY_RESULT_OF_(Then)>
|
||||
{
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
// False condition (else) for both non-void and void calls.
|
||||
template<typename Then> // Copyable (no data).
|
||||
class call_if_statement<false, Then, boost::contract::aux::none> {
|
||||
class call_if_statement<false, Then, boost::contract::detail::none> {
|
||||
public:
|
||||
explicit call_if_statement(Then const&) {}
|
||||
|
||||
|
||||
@@ -9,13 +9,13 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_CONSTRUCTORS) || \
|
||||
!defined(BOOST_CONTRACT_NO_PRECONDITIONS)
|
||||
#include <boost/contract/aux_/operation/constructor.hpp>
|
||||
#include <boost/contract/detail/operation/constructor.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS)
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract {
|
||||
@@ -26,7 +26,7 @@ set_old_postcondition<> constructor(C* obj) {
|
||||
#if !defined(BOOST_CONTRACT_NO_CONSTRUCTORS) || \
|
||||
!defined(BOOST_CONTRACT_NO_PRECONDITIONS)
|
||||
return set_old_postcondition<>(
|
||||
new boost::contract::aux::constructor<C>(obj));
|
||||
new boost::contract::detail::constructor<C>(obj));
|
||||
#else
|
||||
return set_old_postcondition<>();
|
||||
#endif
|
||||
@@ -40,10 +40,10 @@ public:
|
||||
template<typename F>
|
||||
explicit constructor_precondition(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_PRECONDITIONS
|
||||
if(boost::contract::aux::check_guard::checking()) return;
|
||||
if(boost::contract::detail::check_guard::checking()) return;
|
||||
try {
|
||||
#ifndef BOOST_CONTRACT_PRECONDITIONS_DISABLE_NOTHING
|
||||
boost::contract::aux::check_guard checking;
|
||||
boost::contract::detail::check_guard checking;
|
||||
#endif
|
||||
f();
|
||||
} catch(...) { precondition_failure(from_constructor); }
|
||||
|
||||
@@ -8,28 +8,28 @@
|
||||
// See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
||||
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/decl.hpp>
|
||||
#include <boost/contract/detail/decl.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/type_traits/introspection.hpp>
|
||||
#include <boost/contract/detail/type_traits/introspection.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_CONTRACT_NO_INVARIANTS
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
#include <boost/mpl/vector.hpp>
|
||||
#endif
|
||||
|
||||
// TODO: Review all warnings for examples, tests, and also lib compilation...
|
||||
|
||||
// TODO: Document (in a rationale) that using friend to limit lib's public API does not increase compilation times at all. I compiled with friends. Then I removed all friends, made related APIs all public and the compilation times of all test/public_function/* where exactly the same for all compilers (msvc 37 min, gcc 70 min, clang 46 min). So there is not reason at all to not use friends (plus not using friend will complicate the internal APIs because contractor names cannot be wrapped using AUX_NAME so they will still be made private and accessed via some sort of static AUX_NAME(make) member function...).
|
||||
// TODO: Document (in a rationale) that using friend to limit lib's public API does not increase compilation times at all. I compiled with friends. Then I removed all friends, made related APIs all public and the compilation times of all test/public_function/* where exactly the same for all compilers (msvc 37 min, gcc 70 min, clang 46 min). So there is not reason at all to not use friends (plus not using friend will complicate the internal APIs because contractor names cannot be wrapped using DETAIL_NAME so they will still be made private and accessed via some sort of static DETAIL_NAME(make) member function...).
|
||||
|
||||
namespace boost {
|
||||
namespace contract {
|
||||
class virtual_;
|
||||
|
||||
namespace aux {
|
||||
BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
namespace detail {
|
||||
BOOST_CONTRACT_DETAIL_DECL_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
/* is_friend = */ 0, OO, RR, FF, CC, AArgs);
|
||||
|
||||
template<typename RR, class CC>
|
||||
@@ -53,7 +53,7 @@ class access { // Copyable (as shell with no data member).
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_TYPE(has_base_types,
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_TYPE(has_base_types,
|
||||
BOOST_CONTRACT_BASE_TYPEDEF)
|
||||
|
||||
template<class C>
|
||||
@@ -63,10 +63,10 @@ class access { // Copyable (as shell with no data member).
|
||||
#endif
|
||||
|
||||
#ifndef BOOST_CONTRACT_NO_INVARIANTS
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION(
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION(
|
||||
has_static_invariant_f, BOOST_CONTRACT_STATIC_INVARIANT)
|
||||
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_STATIC_MEMBER_FUNCTION(
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_STATIC_MEMBER_FUNCTION(
|
||||
has_static_invariant_s, BOOST_CONTRACT_STATIC_INVARIANT)
|
||||
|
||||
template<class C>
|
||||
@@ -87,10 +87,10 @@ class access { // Copyable (as shell with no data member).
|
||||
}
|
||||
};
|
||||
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION(
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION(
|
||||
has_invariant_f, BOOST_CONTRACT_INVARIANT)
|
||||
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_STATIC_MEMBER_FUNCTION(
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_STATIC_MEMBER_FUNCTION(
|
||||
has_invariant_s, BOOST_CONTRACT_INVARIANT)
|
||||
|
||||
template<class C>
|
||||
@@ -103,26 +103,26 @@ class access { // Copyable (as shell with no data member).
|
||||
|
||||
template<class C>
|
||||
static void cv_invariant(C const volatile* obj) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(obj);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(obj);
|
||||
obj->BOOST_CONTRACT_INVARIANT();
|
||||
}
|
||||
|
||||
template<class C>
|
||||
static void const_invariant(C const* obj) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(obj);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(obj);
|
||||
obj->BOOST_CONTRACT_INVARIANT();
|
||||
}
|
||||
#endif
|
||||
|
||||
// Friends (used to limit library's public API).
|
||||
|
||||
BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_DECL_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
/* is_friend = */ 1, OO, RR, FF, CC, AArgs);
|
||||
|
||||
template<typename RR, class CC>
|
||||
friend class boost::contract::aux::check_pre_post_inv;
|
||||
friend class boost::contract::detail::check_pre_post_inv;
|
||||
|
||||
BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(1,
|
||||
OO, RR, FF, CC, AArgs, vv, rr, ff, oobj, aargs)
|
||||
};
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/declspec.hpp>
|
||||
#include <boost/contract/detail/declspec.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <exception>
|
||||
@@ -25,14 +25,14 @@ namespace boost { namespace contract {
|
||||
|
||||
// Placeholder base class to group all this lib exceptions.
|
||||
// IMPORTANT: Must not inherit from std::exception as derived exceptions will.
|
||||
class BOOST_CONTRACT_AUX_DECLSPEC exception {
|
||||
class BOOST_CONTRACT_DETAIL_DECLSPEC exception {
|
||||
public:
|
||||
virtual ~exception();
|
||||
};
|
||||
|
||||
// Rationale: boost::bad_any_cast exception does not print from/to type names,
|
||||
// so throw custom exception.
|
||||
class BOOST_CONTRACT_AUX_DECLSPEC bad_virtual_result_cast : // Copy (as str).
|
||||
class BOOST_CONTRACT_DETAIL_DECLSPEC bad_virtual_result_cast : // Copy (as str).
|
||||
public std::bad_cast, public boost::contract::exception {
|
||||
public:
|
||||
explicit bad_virtual_result_cast(char const* from_type_name,
|
||||
@@ -45,7 +45,7 @@ private:
|
||||
std::string what_;
|
||||
};
|
||||
|
||||
class BOOST_CONTRACT_AUX_DECLSPEC assertion_failure : // Copy (as str, etc.).
|
||||
class BOOST_CONTRACT_DETAIL_DECLSPEC assertion_failure : // Copy (as str, etc.).
|
||||
public std::exception, public boost::contract::exception {
|
||||
public:
|
||||
explicit assertion_failure(char const* const file = "",
|
||||
@@ -74,56 +74,61 @@ enum from { from_constructor, from_destructor, from_function };
|
||||
// Use Boost.Function to handle also lambdas, binds, etc,
|
||||
typedef boost::function<void (from)> assertion_failure_handler;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC set_precondition_failure(
|
||||
assertion_failure_handler
|
||||
BOOST_CONTRACT_DETAIL_DECLSPEC set_precondition_failure(
|
||||
assertion_failure_handler const& f) BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC get_precondition_failure()
|
||||
assertion_failure_handler
|
||||
BOOST_CONTRACT_DETAIL_DECLSPEC get_precondition_failure()
|
||||
BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
void BOOST_CONTRACT_AUX_DECLSPEC precondition_failure(from where)
|
||||
void BOOST_CONTRACT_DETAIL_DECLSPEC precondition_failure(from where)
|
||||
/* can throw */;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC set_postcondition_failure(
|
||||
assertion_failure_handler
|
||||
BOOST_CONTRACT_DETAIL_DECLSPEC set_postcondition_failure(
|
||||
assertion_failure_handler const& f) BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC
|
||||
get_postcondition_failure() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
assertion_failure_handler
|
||||
BOOST_CONTRACT_DETAIL_DECLSPEC get_postcondition_failure()
|
||||
BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
void BOOST_CONTRACT_AUX_DECLSPEC postcondition_failure(from where)
|
||||
void BOOST_CONTRACT_DETAIL_DECLSPEC postcondition_failure(from where)
|
||||
/* can throw */;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC
|
||||
assertion_failure_handler BOOST_CONTRACT_DETAIL_DECLSPEC
|
||||
set_entry_invariant_failure(assertion_failure_handler const& f)
|
||||
BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC
|
||||
assertion_failure_handler BOOST_CONTRACT_DETAIL_DECLSPEC
|
||||
get_entry_invariant_failure() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
void BOOST_CONTRACT_AUX_DECLSPEC entry_invariant_failure(from where)
|
||||
void BOOST_CONTRACT_DETAIL_DECLSPEC entry_invariant_failure(from where)
|
||||
/* can throw */;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC
|
||||
assertion_failure_handler BOOST_CONTRACT_DETAIL_DECLSPEC
|
||||
set_exit_invariant_failure(assertion_failure_handler const& f)
|
||||
BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
assertion_failure_handler BOOST_CONTRACT_AUX_DECLSPEC
|
||||
get_exit_invariant_failure() BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
assertion_failure_handler
|
||||
BOOST_CONTRACT_DETAIL_DECLSPEC get_exit_invariant_failure()
|
||||
BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
void BOOST_CONTRACT_AUX_DECLSPEC exit_invariant_failure(from where)
|
||||
void BOOST_CONTRACT_DETAIL_DECLSPEC exit_invariant_failure(from where)
|
||||
/* can throw */;
|
||||
|
||||
// Set all inv failures (entry inv and exit inv) at once.
|
||||
void BOOST_CONTRACT_AUX_DECLSPEC set_invariant_failure(
|
||||
void BOOST_CONTRACT_DETAIL_DECLSPEC set_invariant_failure(
|
||||
assertion_failure_handler const& f) BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
// Set all failures (pre, post, entry inv, and exit int) at once.
|
||||
void BOOST_CONTRACT_AUX_DECLSPEC set_failure(assertion_failure_handler const& f)
|
||||
BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
void BOOST_CONTRACT_DETAIL_DECLSPEC set_failure(
|
||||
assertion_failure_handler const& f) BOOST_NOEXCEPT_OR_NOTHROW;
|
||||
|
||||
} } // namespace
|
||||
|
||||
#if BOOST_CONTRACT_HEADER_ONLY
|
||||
#include <boost/contract/aux_/inlined/core/exception.hpp>
|
||||
#include <boost/contract/detail/inlined/core/exception.hpp>
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/condition/check_base.hpp>
|
||||
#include <boost/contract/aux_/auto_ptr.hpp>
|
||||
#include <boost/contract/detail/condition/check_base.hpp>
|
||||
#include <boost/contract/detail/auto_ptr.hpp>
|
||||
#endif
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -43,11 +43,11 @@ private:
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
typedef boost::contract::aux::check_base check_type;
|
||||
typedef boost::contract::detail::check_base check_type;
|
||||
|
||||
explicit set_nothing(check_type* check) : check_(check) {}
|
||||
|
||||
boost::contract::aux::auto_ptr<check_type> check_;
|
||||
boost::contract::detail::auto_ptr<check_type> check_;
|
||||
#endif
|
||||
|
||||
// Friends (used to limit library's public API).
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/aux_/auto_ptr.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/detail/auto_ptr.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#endif
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
template<typename F>
|
||||
set_postcondition_only<R> old(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_);
|
||||
check_->set_old(f);
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
@@ -56,7 +56,7 @@ public:
|
||||
template<typename F>
|
||||
set_nothing postcondition(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_);
|
||||
check_->set_post(f);
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
@@ -72,12 +72,12 @@ private:
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
typedef boost::contract::aux::check_pre_post<typename
|
||||
boost::contract::aux::none_if_void<R>::type> check_type;
|
||||
typedef boost::contract::detail::check_pre_post<typename
|
||||
boost::contract::detail::none_if_void<R>::type> check_type;
|
||||
|
||||
explicit set_old_postcondition(check_type* check) : check_(check) {}
|
||||
|
||||
boost::contract::aux::auto_ptr<check_type> check_;
|
||||
boost::contract::detail::auto_ptr<check_type> check_;
|
||||
#endif
|
||||
|
||||
// Friends (used to limit library's public API).
|
||||
|
||||
@@ -14,12 +14,12 @@
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/aux_/auto_ptr.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/detail/auto_ptr.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#endif
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
template<typename F>
|
||||
set_nothing postcondition(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_);
|
||||
check_->set_post(f);
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
@@ -59,12 +59,12 @@ private:
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
typedef boost::contract::aux::check_pre_post<typename
|
||||
boost::contract::aux::none_if_void<R>::type> check_type;
|
||||
typedef boost::contract::detail::check_pre_post<typename
|
||||
boost::contract::detail::none_if_void<R>::type> check_type;
|
||||
|
||||
explicit set_postcondition_only(check_type* check) : check_(check) {}
|
||||
|
||||
boost::contract::aux::auto_ptr<check_type> check_;
|
||||
boost::contract::detail::auto_ptr<check_type> check_;
|
||||
#endif
|
||||
|
||||
// Friends (used to limit library's public API).
|
||||
|
||||
@@ -13,17 +13,17 @@
|
||||
#include <boost/contract/core/set_postcondition_only.hpp>
|
||||
#include <boost/contract/core/set_nothing.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/decl.hpp>
|
||||
#include <boost/contract/detail/decl.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/aux_/auto_ptr.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/detail/auto_ptr.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#endif
|
||||
#include <boost/config.hpp>
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
template<typename F>
|
||||
set_old_postcondition<R> precondition(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_PRECONDITIONS
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_);
|
||||
check_->set_pre(f);
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
template<typename F>
|
||||
set_postcondition_only<R> old(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_);
|
||||
check_->set_old(f);
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
@@ -73,7 +73,7 @@ public:
|
||||
template<typename F>
|
||||
set_nothing postcondition(F const& f) {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_);
|
||||
check_->set_post(f);
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
@@ -89,13 +89,13 @@ private:
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
typedef boost::contract::aux::check_pre_post<typename
|
||||
boost::contract::aux::none_if_void<R>::type> check_type;
|
||||
typedef boost::contract::detail::check_pre_post<typename
|
||||
boost::contract::detail::none_if_void<R>::type> check_type;
|
||||
|
||||
explicit set_precondition_old_postcondition(check_type* check) :
|
||||
check_(check) {}
|
||||
|
||||
boost::contract::aux::auto_ptr<check_type> check_;
|
||||
boost::contract::detail::auto_ptr<check_type> check_;
|
||||
#endif
|
||||
|
||||
// Friends (used to limit library's public API).
|
||||
@@ -118,7 +118,7 @@ private:
|
||||
friend set_precondition_old_postcondition<RR> public_function(
|
||||
virtual_* vv, RR& rr, CC* oobj);
|
||||
|
||||
BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(1,
|
||||
OO, RR, FF, CC, AArgs, vv, rr, ff, oobj, aargs)
|
||||
};
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
// See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
||||
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/decl.hpp>
|
||||
#include <boost/contract/detail/decl.hpp>
|
||||
#include <boost/noncopyable.hpp>
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
#include <boost/any.hpp>
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
namespace boost {
|
||||
namespace contract {
|
||||
namespace aux {
|
||||
BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
namespace detail {
|
||||
BOOST_CONTRACT_DETAIL_DECL_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
/* is_friend = */ 0, OO, RR, FF, CC, AArgs);
|
||||
}
|
||||
}
|
||||
@@ -95,7 +95,7 @@ class virtual_ : private boost::noncopyable { // Avoid copy queue, stack, etc.
|
||||
|
||||
friend class convertible_old;
|
||||
|
||||
BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_DECL_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
/* is_friend = */ 1, OO, RR, FF, CC, AArgs);
|
||||
};
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_DESTRUCTORS) || \
|
||||
!defined(BOOST_CONTRACT_NO_PRECONDITIONS)
|
||||
#include <boost/contract/aux_/operation/destructor.hpp>
|
||||
#include <boost/contract/detail/operation/destructor.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract {
|
||||
@@ -23,7 +23,7 @@ set_old_postcondition<> destructor(C* obj) {
|
||||
#if !defined(BOOST_CONTRACT_NO_DESTRUCTORS) || \
|
||||
!defined(BOOST_CONTRACT_NO_PRECONDITIONS)
|
||||
return set_old_postcondition<>(
|
||||
new boost::contract::aux::destructor<C>(obj));
|
||||
new boost::contract::detail::destructor<C>(obj));
|
||||
#else
|
||||
return set_old_postcondition<>();
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_ALL_CORE_HEADERS_HPP_
|
||||
#define BOOST_CONTRACT_AUX_ALL_CORE_HEADERS_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_ALL_CORE_HEADERS_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_ALL_CORE_HEADERS_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -12,7 +12,7 @@
|
||||
// will be confused not knowing if a core header has been included or not).
|
||||
|
||||
// IMPORTANT: In addition, <boost/contract/core/*.hpp> headers can be included
|
||||
// by any file (in aux_/*, etc.) while non-core public headers
|
||||
// by any file (in detail/*, etc.) while non-core public headers
|
||||
// <boost/contract/*.hpp> must not be included by any lib header file (because
|
||||
// non-core public headers should be fully independent from one another and
|
||||
// included only by user code). If a public header needs to be included by
|
||||
@@ -1,17 +1,17 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_AUTO_PTR_HPP_
|
||||
#define BOOST_CONTRACT_AUX_AUTO_PTR_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_AUTO_PTR_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_AUTO_PTR_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/operator_safe_bool.hpp>
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/operator_safe_bool.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
// Using this instead of std::auto_ptr because std::auto_ptr will be removed in
|
||||
// C++17 (this library always uses release() to avoid ownership issues).
|
||||
@@ -28,13 +28,20 @@ public:
|
||||
return ptr;
|
||||
}
|
||||
|
||||
T& operator*() { BOOST_CONTRACT_AUX_DEBUG(ptr_); return *ptr_; }
|
||||
T const& operator*() const { BOOST_CONTRACT_AUX_DEBUG(ptr_); return *ptr_; }
|
||||
T& operator*() {
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(ptr_);
|
||||
return *ptr_;
|
||||
}
|
||||
|
||||
T const& operator*() const {
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(ptr_);
|
||||
return *ptr_;
|
||||
}
|
||||
|
||||
T* operator->() { return ptr_; }
|
||||
T const* operator->() const { return ptr_; }
|
||||
|
||||
BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(auto_ptr<T>, !!ptr_)
|
||||
BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(auto_ptr<T>, !!ptr_)
|
||||
|
||||
private:
|
||||
T* ptr_;
|
||||
@@ -1,21 +1,21 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CHECK_GUARD_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CHECK_GUARD_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CHECK_GUARD_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CHECK_GUARD_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/declspec.hpp>
|
||||
#include <boost/contract/detail/declspec.hpp>
|
||||
#ifndef BOOST_CONTRACT_DISABLE_THREADS
|
||||
#include <boost/thread/mutex.hpp>
|
||||
#endif
|
||||
#include <boost/noncopyable.hpp>
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
class BOOST_CONTRACT_AUX_DECLSPEC check_guard :
|
||||
class BOOST_CONTRACT_DETAIL_DECLSPEC check_guard :
|
||||
private boost::noncopyable // Non-copyable resource (might use mutex, etc.).
|
||||
{
|
||||
public:
|
||||
@@ -35,7 +35,7 @@ private:
|
||||
} } } // namespace
|
||||
|
||||
#if BOOST_CONTRACT_HEADER_ONLY
|
||||
#include <boost/contract/aux_/inlined/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/inlined/detail/check_guard.hpp>
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CHECK_BASE_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CHECK_BASE_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CHECK_BASE_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CHECK_BASE_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -19,7 +19,7 @@
|
||||
#include <cassert>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
class check_base : // Base to hold all contract objects for RAII.
|
||||
private boost::noncopyable // Avoid copying possible user's ftor captures.
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CHECK_PRE_POST_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CHECK_PRE_POST_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_base.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_base.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
#include <boost/contract/aux_/type_traits/optional.hpp>
|
||||
#include <boost/contract/detail/type_traits/optional.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
#define BOOST_CONTRACT_AUX_CHECK_PRE_POST_DEF_( \
|
||||
#define BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_DEF_( \
|
||||
result_type, result_param, ftor_type, ftor_var, ftor_call) \
|
||||
public: \
|
||||
template<typename F> \
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
/* CODE */
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
template<typename R>
|
||||
class check_pre_post : public check_base { // Non-copyable base.
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
R const&
|
||||
>::type r_type;
|
||||
|
||||
BOOST_CONTRACT_AUX_CHECK_PRE_POST_DEF_(
|
||||
BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_DEF_(
|
||||
r_type,
|
||||
r,
|
||||
void (r_type),
|
||||
@@ -72,7 +72,7 @@ public:
|
||||
explicit check_pre_post(boost::contract::from from) : check_base(from) {}
|
||||
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
BOOST_CONTRACT_AUX_CHECK_PRE_POST_DEF_(
|
||||
BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_DEF_(
|
||||
none,
|
||||
unused,
|
||||
void (),
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CHECK_PRE_POST_INV_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CHECK_PRE_POST_INV_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_INV_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CHECK_PRE_POST_INV_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post.hpp>
|
||||
#ifndef BOOST_CONTRACT_NO_INVARIANTS
|
||||
#include <boost/contract/core/access.hpp>
|
||||
#include <boost/type_traits/add_pointer.hpp>
|
||||
@@ -29,7 +29,7 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
template<typename R, class C>
|
||||
class check_pre_post_inv : public check_pre_post<R> { // Non-copyable base.
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -12,19 +12,19 @@
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#endif
|
||||
#include <boost/contract/aux_/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/aux_/decl.hpp>
|
||||
#include <boost/contract/aux_/tvariadic.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/detail/decl.hpp>
|
||||
#include <boost/contract/detail/tvariadic.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/core/virtual.hpp>
|
||||
#include <boost/contract/core/access.hpp>
|
||||
#include <boost/contract/aux_/type_traits/optional.hpp>
|
||||
#include <boost/contract/aux_/type_traits/member_function_types.hpp>
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/aux_/name.hpp>
|
||||
#include <boost/contract/detail/type_traits/optional.hpp>
|
||||
#include <boost/contract/detail/type_traits/member_function_types.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#include <boost/contract/detail/name.hpp>
|
||||
#include <boost/type_traits/add_pointer.hpp>
|
||||
#include <boost/mpl/fold.hpp>
|
||||
#include <boost/mpl/contains.hpp>
|
||||
@@ -59,7 +59,7 @@
|
||||
#include <typeinfo>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
namespace check_subcontracted_pre_post_inv_ {
|
||||
// Exception signals (must not inherit).
|
||||
@@ -68,7 +68,7 @@ namespace check_subcontracted_pre_post_inv_ {
|
||||
}
|
||||
|
||||
// O, R, F, and Args-i can be none types (but C cannot).
|
||||
BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_DECL_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
/* is_friend = */ 0, O, R, F, C, Args) : // Non-copyable base.
|
||||
public check_pre_post_inv<R, C>
|
||||
{
|
||||
@@ -88,7 +88,7 @@ BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z(1,
|
||||
boost::mpl::_1 // Base in result, do not add it again.
|
||||
,
|
||||
boost::mpl::eval_if<
|
||||
typename O::template BOOST_CONTRACT_AUX_NAME1(
|
||||
typename O::template BOOST_CONTRACT_DETAIL_NAME1(
|
||||
has_member_function)<
|
||||
boost::mpl::_2,
|
||||
typename member_function_types<C, F>::
|
||||
@@ -146,8 +146,8 @@ public:
|
||||
boost::contract::virtual_* v,
|
||||
C* obj,
|
||||
R& r
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_FPARAMS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, Args, &, args)
|
||||
) :
|
||||
check_pre_post_inv<R, C>(from, obj)
|
||||
@@ -157,8 +157,8 @@ public:
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INIT_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INIT_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, args_, args)
|
||||
#endif
|
||||
{
|
||||
@@ -168,7 +168,7 @@ public:
|
||||
if(v) {
|
||||
base_call_ = true;
|
||||
v_ = v; // Invariant: v_ never null if base_call_.
|
||||
BOOST_CONTRACT_AUX_DEBUG(v_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(v_);
|
||||
} else {
|
||||
base_call_ = false;
|
||||
if(!boost::mpl::empty<overridden_bases>::value) {
|
||||
@@ -317,7 +317,7 @@ private:
|
||||
template<typename R_, typename Result>
|
||||
typename boost::disable_if<is_optional<R_> >::type
|
||||
check_post_r(Result const& r) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(r);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(r);
|
||||
this->check_post(*r);
|
||||
}
|
||||
#endif
|
||||
@@ -413,12 +413,12 @@ private:
|
||||
|
||||
template<class B>
|
||||
void operator()(B*) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(me_.object());
|
||||
BOOST_CONTRACT_AUX_DEBUG(me_.v_);
|
||||
BOOST_CONTRACT_AUX_DEBUG(me_.v_->action_ !=
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(me_.object());
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(me_.v_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(me_.v_->action_ !=
|
||||
boost::contract::virtual_::no_action);
|
||||
try {
|
||||
call<B>(BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_OF(
|
||||
call<B>(BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_OF(
|
||||
Args));
|
||||
} catch(check_subcontracted_pre_post_inv_::
|
||||
signal_no_error const&) {
|
||||
@@ -430,16 +430,17 @@ private:
|
||||
template<
|
||||
class B
|
||||
// Can't use TVARIADIC_COMMA here.
|
||||
BOOST_PP_COMMA_IF(BOOST_CONTRACT_AUX_TVARIADIC)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_TPARAM(I)
|
||||
BOOST_PP_COMMA_IF(BOOST_CONTRACT_DETAIL_TVARIADIC)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_TPARAM(I)
|
||||
>
|
||||
void call(
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_INDEXES_FPARAM(I)) {
|
||||
O::template BOOST_CONTRACT_AUX_NAME1(call_base)<B>(
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_FPARAM(I)) {
|
||||
O::template BOOST_CONTRACT_DETAIL_NAME1(call_base)<B>(
|
||||
me_.v_,
|
||||
me_.object()
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_ELEMS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(
|
||||
BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_ELEMS_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, I, me_.args_)
|
||||
);
|
||||
}
|
||||
@@ -456,7 +457,7 @@ private:
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
boost::contract::virtual_* v_;
|
||||
bool base_call_;
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TUPLE_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, Args, &, args_)
|
||||
#endif
|
||||
};
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CONFIG_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CONFIG_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CONFIG_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CONFIG_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -8,13 +8,13 @@
|
||||
// See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
||||
|
||||
// Export symbols when compiling as shared lib (for internal use only).
|
||||
// BOOST_CONTRACT_AUX_SOURCE
|
||||
// BOOST_CONTRACT_DETAIL_SOURCE
|
||||
|
||||
// Turn off assert(...) in lib's implementation.
|
||||
// BOOST_CONTRACT_AUX_NDEBUG
|
||||
// BOOST_CONTRACT_DETAIL_NDEBUG
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_NAME_PREFIX
|
||||
#define BOOST_CONTRACT_AUX_NAME_PREFIX boost_contract_auxX
|
||||
#ifndef BOOST_CONTRACT_DETAIL_NAME_PREFIX
|
||||
#define BOOST_CONTRACT_DETAIL_NAME_PREFIX boost_contract_detailX
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_DEBUG_HPP_
|
||||
#define BOOST_CONTRACT_AUX_DEBUG_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_DEBUG_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_DEBUG_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -8,12 +8,12 @@
|
||||
// See: http://www.boost.org/doc/libs/release/libs/contract/doc/html/index.html
|
||||
|
||||
// Usually, never #defined (so "debug" assertions always in code).
|
||||
#ifdef BOOST_CONTRACT_AUX_NDEBUG
|
||||
#define BOOST_CONTRACT_AUX_DEBUG(cond) /* nothing */
|
||||
#ifdef BOOST_CONTRACT_DETAIL_NDEBUG
|
||||
#define BOOST_CONTRACT_DETAIL_DEBUG(cond) /* nothing */
|
||||
#else
|
||||
#include <cassert>
|
||||
// Extra parenthesis around assert because that is also a macro.
|
||||
#define BOOST_CONTRACT_AUX_DEBUG(cond) (assert(cond))
|
||||
#define BOOST_CONTRACT_DETAIL_DEBUG(cond) (assert(cond))
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_DECL_HPP_
|
||||
#define BOOST_CONTRACT_AUX_DECL_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_DECL_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_DECL_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -8,8 +8,8 @@
|
||||
// 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/aux_/tvariadic.hpp>
|
||||
#if !BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#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>
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
#define BOOST_CONTRACT_AUX_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
#define BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
arity, is_friend, has_result, \
|
||||
O, R, F, C, Args, \
|
||||
v, r, f, obj, args \
|
||||
@@ -32,8 +32,8 @@
|
||||
BOOST_PP_EXPR_IIF(has_result, typename R) \
|
||||
, typename F \
|
||||
, class C \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TPARAMS_Z(z, arity, Args) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(z, arity, Args) \
|
||||
> \
|
||||
BOOST_PP_EXPR_IIF(is_friend, friend) \
|
||||
boost::contract::set_precondition_old_postcondition< \
|
||||
@@ -45,28 +45,28 @@
|
||||
BOOST_PP_EXPR_IIF(has_result, R& r) \
|
||||
, F f \
|
||||
, C* obj \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_FPARAMS_Z(z, arity, Args, &, args) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z(z, arity, Args, &, args) \
|
||||
)
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#define BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(z, \
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(z, \
|
||||
O, R, F, C, Args, \
|
||||
v, r, f, obj, args \
|
||||
) \
|
||||
BOOST_CONTRACT_AUX_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
~, /* is_friend = */ 1, /* has_result = */ 0, \
|
||||
O, R, F, C, Args, v, r, f, obj, args \
|
||||
); \
|
||||
BOOST_CONTRACT_AUX_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
~, /* is_friend = */ 1, /* has_result = */ 1, \
|
||||
O, R, F, C, Args, v, r, f, obj, args \
|
||||
);
|
||||
#else
|
||||
/* PRIVATE */
|
||||
#define BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_( \
|
||||
#define BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_( \
|
||||
z, n, result_O_R_F_C_Args_v_r_f_obj_args) \
|
||||
BOOST_CONTRACT_AUX_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
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), \
|
||||
@@ -83,32 +83,32 @@
|
||||
);
|
||||
|
||||
/* PUBLIC */
|
||||
#define BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(z, \
|
||||
#define BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTIONS_Z(z, \
|
||||
O, R, F, C, Args, \
|
||||
v, r, f, obj, args \
|
||||
) \
|
||||
BOOST_PP_REPEAT_ ## z( \
|
||||
BOOST_PP_INC(BOOST_CONTRACT_MAX_ARGS), \
|
||||
BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \
|
||||
BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \
|
||||
(/* has_result = */ 0, O, R, F, C, Args, v, r, f, obj, args) \
|
||||
) \
|
||||
BOOST_PP_REPEAT_ ## z( \
|
||||
BOOST_PP_INC(BOOST_CONTRACT_MAX_ARGS), \
|
||||
BOOST_CONTRACT_AUX_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \
|
||||
BOOST_CONTRACT_DETAIL_DECL_FRIEND_OVERRIDING_PUBLIC_FUNCTION_, \
|
||||
(/* has_result = */ 1, O, R, F, C, Args, v, r, f, obj, args) \
|
||||
)
|
||||
#endif
|
||||
|
||||
#define BOOST_CONTRACT_AUX_DECL_AUX_CHECK_SUBCONTRACTED_PRE_POST_INV_Z( \
|
||||
#define BOOST_CONTRACT_DETAIL_DECL_DETAIL_CHECK_SUBCONTRACTED_PRE_POST_INV_Z( \
|
||||
z, is_friend, O, R, F, C, Args) \
|
||||
template< \
|
||||
class O, typename R, typename F, class C \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TPARAMS_Z(z, \
|
||||
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::aux:: \
|
||||
friend class boost::contract::detail:: \
|
||||
, \
|
||||
class \
|
||||
) \
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_DECLSPEC_HPP_
|
||||
#define BOOST_CONTRACT_AUX_DECLSPEC_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_DECLSPEC_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_DECLSPEC_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -15,13 +15,13 @@
|
||||
// used as a shared library. Otherwise, lib's state won't be shared among
|
||||
// different user programs and user libraries.
|
||||
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_CONTRACT_DYN_LINK)
|
||||
#ifdef BOOST_CONTRACT_AUX_SOURCE
|
||||
#define BOOST_CONTRACT_AUX_DECLSPEC BOOST_SYMBOL_EXPORT
|
||||
#ifdef BOOST_CONTRACT_DETAIL_SOURCE
|
||||
#define BOOST_CONTRACT_DETAIL_DECLSPEC BOOST_SYMBOL_EXPORT
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_DECLSPEC BOOST_SYMBOL_IMPORT
|
||||
#define BOOST_CONTRACT_DETAIL_DECLSPEC BOOST_SYMBOL_IMPORT
|
||||
#endif
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_DECLSPEC /* nothing */
|
||||
#define BOOST_CONTRACT_DETAIL_DECLSPEC /* nothing */
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_INLINED_EXCEPTION_HPP_
|
||||
#define BOOST_CONTRACT_AUX_INLINED_EXCEPTION_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_INLINED_EXCEPTION_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_INLINED_EXCEPTION_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -1,18 +1,18 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_INLINED_AUX_CHECK_GUARD_HPP_
|
||||
#define BOOST_CONTRACT_AUX_INLINED_AUX_CHECK_GUARD_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_INLINED_DETAIL_CHECK_GUARD_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_INLINED_DETAIL_CHECK_GUARD_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#ifndef BOOST_CONTRACT_DISABLE_THREADS
|
||||
#include <boost/thread/lock_guard.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
check_guard::check_guard() {
|
||||
#ifndef BOOST_CONTRACT_DISABLE_THREADS
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_NAME_HPP_
|
||||
#define BOOST_CONTRACT_AUX_NAME_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_NAME_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_NAME_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/config.hpp>
|
||||
#include <boost/contract/detail/config.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PUBLIC */
|
||||
@@ -15,8 +15,8 @@
|
||||
// NOTE: Explicitly list number of names to concatenate using ..._NAME-n
|
||||
// (instead of using ..._SEQ_CAT or similar) for optimal speed and reentrancy.
|
||||
|
||||
#define BOOST_CONTRACT_AUX_NAME1(name1) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_AUX_NAME_PREFIX, name1)
|
||||
#define BOOST_CONTRACT_DETAIL_NAME1(name1) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_NAME_PREFIX, name1)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_NONE_HPP_
|
||||
#define BOOST_CONTRACT_AUX_NONE_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_NONE_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_NONE_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
// Tag for "no type".
|
||||
class none {
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_CONSTRUCTOR_HPP_
|
||||
#define BOOST_CONTRACT_AUX_CONSTRUCTOR_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_CONSTRUCTOR_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_CONSTRUCTOR_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_INVARIANTS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_EXIT_INVARIANTS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
// Ctor subcontracting impl via C++ obj construction mechanism.
|
||||
template<class C>
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_DESTRUCTOR_HPP_
|
||||
#define BOOST_CONTRACT_AUX_DESTRUCTOR_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_DESTRUCTOR_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_DESTRUCTOR_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -9,11 +9,11 @@
|
||||
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_INVARIANTS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_EXIT_INVARIANTS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
// Dtor subcontracting impl via C++ obj destruction mechanism.
|
||||
template<class C>
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_FUNCTION_HPP_
|
||||
#define BOOST_CONTRACT_AUX_FUNCTION_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_FUNCTION_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_FUNCTION_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -9,17 +9,17 @@
|
||||
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_pre_post.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#endif
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
#include <boost/config.hpp>
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
// Used for free function, private and protected member functions.
|
||||
class function :
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_PUBLIC_FUNCTION_HPP_
|
||||
#define BOOST_CONTRACT_AUX_PUBLIC_FUNCTION_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PUBLIC_FUNCTION_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PUBLIC_FUNCTION_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -10,13 +10,13 @@
|
||||
#include <boost/contract/core/virtual.hpp>
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_subcontracted_pre_post_inv.hpp>
|
||||
#include <boost/contract/aux_/tvariadic.hpp>
|
||||
#include <boost/contract/detail/condition/check_subcontracted_pre_post_inv.hpp>
|
||||
#include <boost/contract/detail/tvariadic.hpp>
|
||||
#include <boost/contract/core/virtual.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_EXIT_INVARIANTS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
@@ -26,36 +26,36 @@
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
template<
|
||||
class O, typename R, typename F, class C
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TPARAMS_Z(1, BOOST_CONTRACT_MAX_ARGS, Args)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(1, BOOST_CONTRACT_MAX_ARGS, Args)
|
||||
>
|
||||
class public_function : // Non-copyable base.
|
||||
public check_subcontracted_pre_post_inv<
|
||||
O, R, F, C
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(1, BOOST_CONTRACT_MAX_ARGS, Args)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(1, BOOST_CONTRACT_MAX_ARGS, Args)
|
||||
>
|
||||
{
|
||||
public:
|
||||
explicit public_function(
|
||||
boost::contract::virtual_* v, C* obj, R& r
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_FPARAMS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, Args, &, args)
|
||||
) :
|
||||
check_subcontracted_pre_post_inv<
|
||||
O, R, F, C
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, Args)
|
||||
>(
|
||||
boost::contract::from_function, v, obj, r
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS, args)
|
||||
)
|
||||
{}
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_PUBLIC_STATIC_FUNCTION_HPP_
|
||||
#define BOOST_CONTRACT_AUX_PUBLIC_STATIC_FUNCTION_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PUBLIC_STATIC_FUNCTION_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PUBLIC_STATIC_FUNCTION_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -9,12 +9,12 @@
|
||||
|
||||
#include <boost/contract/core/exception.hpp>
|
||||
#include <boost/contract/core/config.hpp>
|
||||
#include <boost/contract/aux_/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/condition/check_pre_post_inv.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(OOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#endif
|
||||
#if !defined(BOOST_CONTRACT_NO_EXIT_INVARIANTS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS)
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <exception>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
// No subcontracting because static so no obj and no substitution principle.
|
||||
template<class C>
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL_HPP_
|
||||
#define BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/name.hpp>
|
||||
#include <boost/contract/detail/name.hpp>
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
@@ -23,48 +23,48 @@
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_EXPLICIT_CONVERSION_OPERATORS) && \
|
||||
!defined(BOOST_NO_CXX11_NULLPTR)
|
||||
#define BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
#define BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
explicit operator bool() const BOOST_NOEXCEPT { return (bool_expr); } \
|
||||
BOOST_CONTRACT_OPERATOR_SAFE_BOOL_NOT_(bool_expr)
|
||||
#elif (defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, < 0x570) ) || \
|
||||
defined(__CINT__)
|
||||
#define BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
#define BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
operator bool() const BOOST_NOEXCEPT { return (bool_expr); } \
|
||||
BOOST_CONTRACT_OPERATOR_SAFE_BOOL_NOT_(bool_expr)
|
||||
#elif defined(_MANAGED)
|
||||
#define BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
static void BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_func)( \
|
||||
#define BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
static void BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_func)( \
|
||||
this_type***) {} \
|
||||
typedef void (*BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_type))( \
|
||||
typedef void (*BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_type))( \
|
||||
this_type***); \
|
||||
operator BOOST_CONTRACT_AUX_NANE(operator_safe_bool_type)() \
|
||||
operator BOOST_CONTRACT_DETAIL_NANE(operator_safe_bool_type)() \
|
||||
const BOOST_NOEXCEPT { \
|
||||
return (bool_expr) ? \
|
||||
&BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_func) : 0; \
|
||||
&BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_func) : 0; \
|
||||
} \
|
||||
BOOST_CONTRACT_OPERATOR_SAFE_BOOL_NOT_(bool_expr)
|
||||
#elif (defined(__MWERKS__) && BOOST_WORKAROUND(__MWERKS__, < 0x3200)) || \
|
||||
(defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 304)) || \
|
||||
(defined(__SUNPRO_CC) && BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590))
|
||||
#define BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
void BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_func)() const {} \
|
||||
typedef void (this_type:: \
|
||||
*BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_type))() const; \
|
||||
operator BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_type)() \
|
||||
#define BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
void BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_func)() const {} \
|
||||
typedef void (this_type::*BOOST_CONTRACT_DETAIL_NAME1( \
|
||||
operator_safe_bool_type))() const; \
|
||||
operator BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_type)() \
|
||||
const BOOST_NOEXCEPT { \
|
||||
return (bool_expr) ? &this_type:: \
|
||||
BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_func) : 0; \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_func) : 0; \
|
||||
} \
|
||||
BOOST_CONTRACT_OPERATOR_SAFE_BOOL_NOT_(bool_expr)
|
||||
#else
|
||||
#define BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
void* BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_data); \
|
||||
typedef void* this_type::*BOOST_CONTRACT_AUX_NAME1( \
|
||||
#define BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(this_type, bool_expr) \
|
||||
void* BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_data); \
|
||||
typedef void* this_type::*BOOST_CONTRACT_DETAIL_NAME1( \
|
||||
operator_safe_bool_type);\
|
||||
operator BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_type)() \
|
||||
operator BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_type)() \
|
||||
const BOOST_NOEXCEPT { \
|
||||
return (bool_expr) ? &this_type:: \
|
||||
BOOST_CONTRACT_AUX_NAME1(operator_safe_bool_data) : 0; \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(operator_safe_bool_data) : 0; \
|
||||
} \
|
||||
BOOST_CONTRACT_OPERATOR_SAFE_BOOL_NOT_(bool_expr)
|
||||
#endif
|
||||
@@ -1,35 +1,35 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_PP_KEYWORD_PRIVATE_HPP_
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PRIVATE_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_PRIVATE_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PRIVATE_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
// Must expand to a single comma `,` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PRIVATE_CAT_TO_COMMAprivate ,
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PRIVATE_CAT_TO_COMMAprivate ,
|
||||
|
||||
// Must expand to empty `` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PRIVATE_CAT_TO_EMPTYprivate
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PRIVATE_CAT_TO_EMPTYprivate
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
// Precondition: tokens must start with a token concatenable to a macro name
|
||||
// (e.g., a literal or integral token).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PRIVATE(tokens) \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_PRIVATE_CAT_TO_COMMA, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PRIVATE(tokens) \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_PRIVATE_CAT_TO_COMMA, tokens)
|
||||
|
||||
// Precondition: tokens must start with `private` (this can be
|
||||
// checked with `..._IS_PRIVATE` macro above).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_REMOVE_PRIVATE(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_AUX_PP_KEYWORD_PRIVATE_CAT_TO_EMPTY, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_PRIVATE(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_PRIVATE_CAT_TO_EMPTY, tokens)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -1,35 +1,36 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_PP_KEYWORD_PROTECTED_HPP_
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PROTECTED_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
// Must expand to a single comma `,` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PROTECTED_CAT_TO_COMMAprotected ,
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_COMMAprotected ,
|
||||
|
||||
// Must expand to empty `` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PROTECTED_CAT_TO_EMPTYprotected
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_EMPTYprotected
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
// Precondition: tokens must start with a token concatenable to a macro name
|
||||
// (e.g., a literal or integral token).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PROTECTED(tokens) \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_PROTECTED_CAT_TO_COMMA, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PROTECTED(tokens) \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_COMMA, tokens)
|
||||
|
||||
// Precondition: tokens must start with `protected` (this can be
|
||||
// checked with `..._IS_PROTECTED` macro above).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_REMOVE_PROTECTED(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_AUX_PP_KEYWORD_PROTECTED_CAT_TO_EMPTY, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_PROTECTED(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_PROTECTED_CAT_TO_EMPTY, \
|
||||
tokens)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -1,35 +1,35 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_PP_KEYWORD_PUBLIC_HPP_
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PUBLIC_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_PUBLIC_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PUBLIC_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
// Must expand to a single comma `,` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PUBLIC_CAT_TO_COMMApublic ,
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PUBLIC_CAT_TO_COMMApublic ,
|
||||
|
||||
// Must expand to empty `` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_PUBLIC_CAT_TO_EMPTYpublic
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_PUBLIC_CAT_TO_EMPTYpublic
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
// Precondition: tokens must start with a token concatenable to a macro name
|
||||
// (e.g., a literal or integral token).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_IS_PUBLIC(tokens) \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_PUBLIC_CAT_TO_COMMA, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_PUBLIC(tokens) \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_PUBLIC_CAT_TO_COMMA, tokens)
|
||||
|
||||
// Precondition: tokens must start with `public` (this can be
|
||||
// checked with `..._IS_PUBLIC` macro above).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_REMOVE_PUBLIC(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_AUX_PP_KEYWORD_PUBLIC_CAT_TO_EMPTY, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_PUBLIC(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_PUBLIC_CAT_TO_EMPTY, tokens)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_HPP_
|
||||
#define BOOST_CONTRACT_EXT_PP_KEYWORD_UTILITY_IS_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -12,8 +12,8 @@
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS_1 0
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS_2 1
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_1 0
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_2 1
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
@@ -21,8 +21,9 @@
|
||||
// #defined to expand to `,`.
|
||||
// Precondition: tokens must start with a token concatenable to a macro name
|
||||
// (e.g., a literal or integral token).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS(cat_to_comma_prefix, tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS_, \
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
|
||||
cat_to_comma_prefix, tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS_, \
|
||||
BOOST_PP_VARIADIC_SIZE(BOOST_PP_CAT(cat_to_comma_prefix, tokens)))
|
||||
|
||||
#endif // #include guard
|
||||
@@ -1,35 +1,35 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_PP_KEYWORD_VIRTUAL_HPP_
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_VIRTUAL_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/contract/detail/preprocessor/keyword/utility/is.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
// Must expand to a single comma `,` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_VIRTUAL_CAT_TO_COMMAvirtual ,
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_COMMAvirtual ,
|
||||
|
||||
// Must expand to empty `` (not local macros, do not #undefine).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTYvirtual
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTYvirtual
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
// Precondition: tokens must start with a token concatenable to a macro name
|
||||
// (e.g., a literal or integral token).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_IS_VIRTUAL(tokens) \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_AUX_PP_KEYWORD_VIRTUAL_CAT_TO_COMMA, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_IS_VIRTUAL(tokens) \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_UTILITY_IS( \
|
||||
BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_COMMA, tokens)
|
||||
|
||||
// Precondition: tokens must start with `virtual` (this can be
|
||||
// checked with `..._IS_VIRTUAL` macro above).
|
||||
#define BOOST_CONTRACT_AUX_PP_KEYWORD_REMOVE_VIRTUAL(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_AUX_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTY, tokens)
|
||||
#define BOOST_CONTRACT_DETAIL_PP_KEYWORD_REMOVE_VIRTUAL(tokens) \
|
||||
BOOST_PP_CAT(BOOST_CONTRACT_DETAIL_PP_KEYWORD_VIRTUAL_CAT_TO_EMPTY, tokens)
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
190
include/boost/contract/detail/tvariadic.hpp
Normal file
190
include/boost/contract/detail/tvariadic.hpp
Normal file
@@ -0,0 +1,190 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_DETAIL_TVARIADIC_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_NO_CXX11_VARIADIC_TEMPLATES
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC 0
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC 1
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#include <tuple>
|
||||
|
||||
/* CODE */
|
||||
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
namespace tvariadic_ {
|
||||
template<int...> struct indexes {};
|
||||
|
||||
template<int N, int... I> struct indexes_of :
|
||||
indexes_of<N - 1, N - 1, I...> {};
|
||||
template<int... I> struct indexes_of<0, I...>
|
||||
{ typedef indexes<I...> type; };
|
||||
} } } } // namespace
|
||||
|
||||
#else
|
||||
#include <boost/preprocessor/repetition/enum.hpp>
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/tuple/elem.hpp>
|
||||
#include <boost/preprocessor/punctuation/comma_if.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_ELEM_(z, n, tuple) \
|
||||
BOOST_PP_CAT(tuple, n)
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INIT_(z, n, tuplevar_values) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 0, tuplevar_values), n)( \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(2, 1, tuplevar_values), n))
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_(z, n, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, type_qualifier_name), n) \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 2, type_qualifier_name), n) \
|
||||
;
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_(z, n, tokens) \
|
||||
tokens
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_ARG_(z, n, name) \
|
||||
BOOST_PP_CAT(name, n)
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAM_(z, n, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 0, type_qualifier_name), n) \
|
||||
BOOST_PP_TUPLE_ELEM(3, 1, type_qualifier_name) \
|
||||
BOOST_PP_CAT(BOOST_PP_TUPLE_ELEM(3, 2, type_qualifier_name), n)
|
||||
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAM_(z, n, name) \
|
||||
typename BOOST_PP_CAT(name, n)
|
||||
#endif
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
,
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_PP_COMMA_IF(arity)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(arity) /* nothing */
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(arity) \
|
||||
BOOST_PP_COMMA_IF(arity)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_SIZEOF(arity, name) sizeof...(name)
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_SIZEOF(arity, name) arity
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(z, arity, name) \
|
||||
typename... name
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(z, arity, name) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAM_, \
|
||||
name)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
type qualifier ... name
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAM_, \
|
||||
(type, qualifier, name))
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(z, arity, name) \
|
||||
name...
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(z, arity, name) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_DETAIL_TVARIADIC_ARG_, name)
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(z, arity, tokens) \
|
||||
/* nothing */
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(z, arity, tokens) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_, \
|
||||
tokens)
|
||||
#endif
|
||||
|
||||
// Tuple.
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
std::tuple<type qualifier ...> name;
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_Z( \
|
||||
z, arity, type, qualifier, name) \
|
||||
BOOST_PP_REPEAT_ ## z(arity, BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_, \
|
||||
(type, qualifier, name))
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INIT_Z(z, \
|
||||
arity, tuple, values) \
|
||||
tuple(values...)
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INIT_Z(z, \
|
||||
arity, tuple, values) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INIT_,\
|
||||
(tuple, values))
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_TPARAM(indexes) \
|
||||
int... indexes
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_TPARAM(indexes) \
|
||||
/* nothing */
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_FPARAM(_indexes) \
|
||||
boost::contract::detail::tvariadic_::indexes<_indexes...>
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_FPARAM(_indexes) \
|
||||
/* nothing */
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_OF(tuple_type) \
|
||||
typename boost::contract::detail::tvariadic_::indexes_of< \
|
||||
sizeof...(tuple_type)>::type()
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_INDEXES_OF(unused) \
|
||||
/* nothing */
|
||||
#endif
|
||||
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_ELEMS_Z( \
|
||||
z, arity, indexes, tuple) \
|
||||
std::get<indexes>(tuple)...
|
||||
#else
|
||||
#define BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_ELEMS_Z( \
|
||||
z, arity, indexes, tuple) \
|
||||
BOOST_PP_ENUM_ ## z(arity, BOOST_CONTRACT_DETAIL_TVARIADIC_TUPLE_ELEM_,\
|
||||
tuple)
|
||||
#endif
|
||||
|
||||
#endif // #include guard
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_INTROSPECTION_HPP_
|
||||
#define BOOST_CONTRACT_AUX_INTROSPECTION_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_INTROSPECTION_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_INTROSPECTION_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/name.hpp>
|
||||
#include <boost/contract/detail/name.hpp>
|
||||
#include <boost/function_types/member_function_pointer.hpp>
|
||||
#include <boost/function_types/function_pointer.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
@@ -24,26 +24,26 @@
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
#define BOOST_CONTRACT_AUX_INTROSPECTION_END_(tparam) \
|
||||
#define BOOST_CONTRACT_DETAIL_INTROSPECTION_END_(tparam) \
|
||||
template<typename> \
|
||||
static boost::contract::aux::introspection::no& check(...); \
|
||||
static boost::contract::detail::introspection::no& check(...); \
|
||||
public: \
|
||||
static bool const value = sizeof(check<tparam>(0)) == \
|
||||
sizeof(boost::contract::aux::introspection::yes); \
|
||||
sizeof(boost::contract::detail::introspection::yes); \
|
||||
typedef boost::mpl::bool_<value> type;
|
||||
|
||||
#define BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION_(is_static, \
|
||||
#define BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION_(is_static, \
|
||||
trait, func_name) \
|
||||
template< \
|
||||
typename BOOST_CONTRACT_AUX_NAME1(T), \
|
||||
typename BOOST_CONTRACT_AUX_NAME1(R), \
|
||||
class BOOST_CONTRACT_AUX_NAME1(P), \
|
||||
class BOOST_CONTRACT_AUX_NAME1(G) = boost::function_types::null_tag \
|
||||
typename BOOST_CONTRACT_DETAIL_NAME1(T), \
|
||||
typename BOOST_CONTRACT_DETAIL_NAME1(R), \
|
||||
class BOOST_CONTRACT_DETAIL_NAME1(P), \
|
||||
class BOOST_CONTRACT_DETAIL_NAME1(G) = boost::function_types::null_tag \
|
||||
> \
|
||||
class trait { \
|
||||
template<class BOOST_CONTRACT_AUX_NAME1(C)> \
|
||||
static boost::contract::aux::introspection::yes& check( \
|
||||
boost::contract::aux::introspection::check_function< \
|
||||
template<class BOOST_CONTRACT_DETAIL_NAME1(C)> \
|
||||
static boost::contract::detail::introspection::yes& check( \
|
||||
boost::contract::detail::introspection::check_function< \
|
||||
typename \
|
||||
BOOST_PP_IIF(is_static, \
|
||||
boost::function_types::function_pointer \
|
||||
@@ -53,50 +53,53 @@
|
||||
< \
|
||||
typename boost::mpl::push_front< \
|
||||
BOOST_PP_IIF(is_static, \
|
||||
BOOST_CONTRACT_AUX_NAME1(P) \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(P) \
|
||||
BOOST_PP_TUPLE_EAT(2) \
|
||||
, \
|
||||
BOOST_PP_TUPLE_REM(2) \
|
||||
)( \
|
||||
typename boost::mpl::push_front< \
|
||||
BOOST_CONTRACT_AUX_NAME1(P), \
|
||||
BOOST_CONTRACT_AUX_NAME1(C) \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(P), \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(C) \
|
||||
>::type \
|
||||
) \
|
||||
, BOOST_CONTRACT_AUX_NAME1(R) \
|
||||
, BOOST_CONTRACT_DETAIL_NAME1(R) \
|
||||
>::type, \
|
||||
BOOST_CONTRACT_AUX_NAME1(G) \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(G) \
|
||||
>::type, \
|
||||
&BOOST_CONTRACT_AUX_NAME1(C)::func_name \
|
||||
&BOOST_CONTRACT_DETAIL_NAME1(C)::func_name \
|
||||
>* \
|
||||
); \
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_END_(BOOST_CONTRACT_AUX_NAME1(T)) \
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_END_( \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(T)) \
|
||||
};
|
||||
|
||||
/* PUBLIC */
|
||||
|
||||
#define BOOST_CONTRACT_AUX_INTROSPECTION_HAS_TYPE(trait, type_name)\
|
||||
template<typename BOOST_CONTRACT_AUX_NAME1(T)> \
|
||||
#define BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_TYPE(trait, type_name)\
|
||||
template<typename BOOST_CONTRACT_DETAIL_NAME1(T)> \
|
||||
class trait { \
|
||||
template<class BOOST_CONTRACT_AUX_NAME1(C)> \
|
||||
static boost::contract::aux::introspection::yes& check( \
|
||||
typename BOOST_CONTRACT_AUX_NAME1(C)::type_name*); \
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_END_(BOOST_CONTRACT_AUX_NAME1(T)) \
|
||||
template<class BOOST_CONTRACT_DETAIL_NAME1(C)> \
|
||||
static boost::contract::detail::introspection::yes& check( \
|
||||
typename BOOST_CONTRACT_DETAIL_NAME1(C)::type_name*); \
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_END_( \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(T)) \
|
||||
};
|
||||
|
||||
#define BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION( \
|
||||
#define BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION( \
|
||||
trait, func_name) \
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION_(/* is_static = */ 0, \
|
||||
trait, func_name)
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION_( \
|
||||
/* is_static = */ 0, trait, func_name)
|
||||
|
||||
#define BOOST_CONTRACT_AUX_INTROSPECTION_HAS_STATIC_MEMBER_FUNCTION(trait, \
|
||||
#define BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_STATIC_MEMBER_FUNCTION(trait, \
|
||||
func_name) \
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION_(/* is_static = */ 1, \
|
||||
trait, func_name)
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION_( \
|
||||
/* is_static = */ 1, trait, func_name)
|
||||
|
||||
/* CODE */
|
||||
|
||||
namespace boost { namespace contract { namespace aux { namespace introspection {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
namespace introspection {
|
||||
|
||||
typedef class {} yes;
|
||||
typedef yes no[2];
|
||||
@@ -1,13 +1,13 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_MEMBER_FUNCTION_TYPES_HPP_
|
||||
#define BOOST_CONTRACT_AUX_MEMBER_FUNCTION_TYPES_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_MEMBER_FUNCTION_TYPES_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_MEMBER_FUNCTION_TYPES_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 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
|
||||
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#include <boost/function_types/parameter_types.hpp>
|
||||
#include <boost/function_types/result_type.hpp>
|
||||
#include <boost/function_types/property_tags.hpp>
|
||||
@@ -27,7 +27,7 @@ namespace boost {
|
||||
}
|
||||
}
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
template<class C, typename F>
|
||||
struct member_function_types {
|
||||
@@ -1,6 +1,6 @@
|
||||
|
||||
#ifndef BOOST_CONTRACT_AUX_OPTIONAL_HPP_
|
||||
#define BOOST_CONTRACT_AUX_OPTIONAL_HPP_
|
||||
#ifndef BOOST_CONTRACT_DETAIL_OPTIONAL_HPP_
|
||||
#define BOOST_CONTRACT_DETAIL_OPTIONAL_HPP_
|
||||
|
||||
// Copyright (C) 2008-2016 Lorenzo Caminiti
|
||||
// Distributed under the Boost Software License, Version 1.0 (see accompanying
|
||||
@@ -11,7 +11,7 @@
|
||||
#include <boost/type_traits/remove_reference.hpp>
|
||||
#include <boost/type_traits/integral_constant.hpp>
|
||||
|
||||
namespace boost { namespace contract { namespace aux {
|
||||
namespace boost { namespace contract { namespace detail {
|
||||
|
||||
template<typename T>
|
||||
struct is_optional : boost::false_type {};
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#if !defined(BOOST_CONTRACT_NO_FUNCTIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
#include <boost/contract/aux_/operation/function.hpp>
|
||||
#include <boost/contract/detail/operation/function.hpp>
|
||||
#endif
|
||||
|
||||
namespace boost { namespace contract {
|
||||
@@ -22,7 +22,7 @@ set_precondition_old_postcondition<> function() {
|
||||
#if !defined(BOOST_CONTRACT_NO_FUNCTIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
return set_precondition_old_postcondition<>(
|
||||
new boost::contract::aux::function());
|
||||
new boost::contract::detail::function());
|
||||
#else
|
||||
return set_precondition_old_postcondition<>();
|
||||
#endif
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/aux_/condition/check_base.hpp>
|
||||
#include <boost/contract/aux_/auto_ptr.hpp>
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/condition/check_base.hpp>
|
||||
#include <boost/contract/detail/auto_ptr.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#include <boost/config.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
@@ -23,7 +23,7 @@
|
||||
#define BOOST_CONTRACT_GUARD_CTOR_DEF_(contract_type) \
|
||||
: check_(const_cast<contract_type&>(contract).check_.release()) \
|
||||
{ \
|
||||
BOOST_CONTRACT_AUX_DEBUG(check_); \
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(check_); \
|
||||
check_->guard(); \
|
||||
}
|
||||
#else
|
||||
@@ -70,7 +70,8 @@ private:
|
||||
#if !defined(BOOST_CONTRACT_NO_PRECONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_POSTCONDITIONS) || \
|
||||
!defined(BOOST_CONTRACT_NO_INVARIANTS)
|
||||
boost::contract::aux::auto_ptr<boost::contract::aux::check_base> check_;
|
||||
boost::contract::detail::auto_ptr<boost::contract::detail::check_base>
|
||||
check_;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
||||
@@ -9,10 +9,10 @@
|
||||
|
||||
/** @file */
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/aux_/check_guard.hpp>
|
||||
#include <boost/contract/aux_/operator_safe_bool.hpp>
|
||||
#include <boost/contract/aux_/debug.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/check_guard.hpp>
|
||||
#include <boost/contract/detail/operator_safe_bool.hpp>
|
||||
#include <boost/contract/detail/debug.hpp>
|
||||
#include <boost/make_shared.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/type_traits/is_copy_constructible.hpp>
|
||||
@@ -91,11 +91,14 @@ public:
|
||||
|
||||
// Only const access (because contracts should not change program state).
|
||||
|
||||
T const& operator*() const { BOOST_CONTRACT_AUX_DEBUG(ptr_); return *ptr_; }
|
||||
T const& operator*() const {
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(ptr_);
|
||||
return *ptr_;
|
||||
}
|
||||
|
||||
T const* operator->() const { return ptr_.operator->(); }
|
||||
|
||||
BOOST_CONTRACT_AUX_OPERATOR_SAFE_BOOL(old_ptr<T>, !!ptr_)
|
||||
BOOST_CONTRACT_DETAIL_OPERATOR_SAFE_BOOL(old_ptr<T>, !!ptr_)
|
||||
|
||||
private:
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
@@ -146,19 +149,19 @@ public:
|
||||
/* implicit */ operator old_ptr<T>() {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
if(!boost::is_copy_constructible<T>::value) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(!ptr_); // Non-copyable so no old...
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(!ptr_); // Non-copyable so no old...
|
||||
return old_ptr<T>(); // ...and return null.
|
||||
} else if(!v_ && boost::contract::aux::check_guard::checking()) {
|
||||
} else if(!v_ && boost::contract::detail::check_guard::checking()) {
|
||||
// Return null shared ptr (see after if statement).
|
||||
} else if(!v_) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(ptr_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(ptr_);
|
||||
boost::shared_ptr<T const> old =
|
||||
boost::static_pointer_cast<T const>(ptr_);
|
||||
BOOST_CONTRACT_AUX_DEBUG(old);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(old);
|
||||
return old_ptr<T>(old);
|
||||
} else if(v_->action_ == boost::contract::virtual_::push_old_init ||
|
||||
v_->action_ == boost::contract::virtual_::push_old_copy) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(ptr_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(ptr_);
|
||||
if(v_->action_ == boost::contract::virtual_::push_old_init) {
|
||||
v_->old_inits_.push(ptr_);
|
||||
} else {
|
||||
@@ -167,14 +170,14 @@ public:
|
||||
return old_ptr<T>();
|
||||
} else if(v_->action_ == boost::contract::virtual_::pop_old_init ||
|
||||
v_->action_ == boost::contract::virtual_::pop_old_copy) {
|
||||
BOOST_CONTRACT_AUX_DEBUG(!ptr_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(!ptr_);
|
||||
boost::shared_ptr<void> ptr;
|
||||
if(v_->action_ == boost::contract::virtual_::pop_old_init) {
|
||||
ptr = v_->old_inits_.front();
|
||||
} else {
|
||||
ptr = v_->old_copies_.top();
|
||||
}
|
||||
BOOST_CONTRACT_AUX_DEBUG(ptr);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(ptr);
|
||||
if(v_->action_ == boost::contract::virtual_::pop_old_init) {
|
||||
v_->old_inits_.pop();
|
||||
} else {
|
||||
@@ -182,10 +185,10 @@ public:
|
||||
}
|
||||
boost::shared_ptr<T const> old =
|
||||
boost::static_pointer_cast<T const>(ptr);
|
||||
BOOST_CONTRACT_AUX_DEBUG(old);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(old);
|
||||
return old_ptr<T>(old);
|
||||
}
|
||||
BOOST_CONTRACT_AUX_DEBUG(!ptr_);
|
||||
BOOST_CONTRACT_DETAIL_DEBUG(!ptr_);
|
||||
#endif
|
||||
return old_ptr<T>();
|
||||
}
|
||||
@@ -219,7 +222,7 @@ convertible_old make_old(virtual_* v, unconvertible_old const& old) {
|
||||
|
||||
bool copy_old() {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
return !boost::contract::aux::check_guard::checking();
|
||||
return !boost::contract::detail::check_guard::checking();
|
||||
#else
|
||||
return false; // Post checking disabled, so never copy old values.
|
||||
#endif
|
||||
@@ -227,7 +230,7 @@ bool copy_old() {
|
||||
|
||||
bool copy_old(virtual_* v) {
|
||||
#ifndef BOOST_CONTRACT_NO_POSTCONDITIONS
|
||||
if(!v) return !boost::contract::aux::check_guard::checking();
|
||||
if(!v) return !boost::contract::detail::check_guard::checking();
|
||||
return v->action_ == boost::contract::virtual_::push_old_init ||
|
||||
v->action_ == boost::contract::virtual_::push_old_copy;
|
||||
#else
|
||||
|
||||
@@ -7,47 +7,48 @@
|
||||
// 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
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#include <boost/preprocessor/cat.hpp>
|
||||
|
||||
/* PRIVATE */
|
||||
|
||||
#ifndef BOOST_CONTRACT_NO_PUBLIC_FUNCTIONS
|
||||
#include <boost/contract/aux_/type_traits/introspection.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/aux_/tvariadic.hpp>
|
||||
#include <boost/contract/aux_/name.hpp>
|
||||
#include <boost/contract/detail/type_traits/introspection.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#include <boost/contract/detail/tvariadic.hpp>
|
||||
#include <boost/contract/detail/name.hpp>
|
||||
|
||||
#define BOOST_CONTRACT_OVERRIDE_CALL_BASE_(z, arity, arity_compl, f) \
|
||||
template< \
|
||||
class BOOST_CONTRACT_AUX_NAME1(B), \
|
||||
class BOOST_CONTRACT_AUX_NAME1(C) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_TPARAMS_Z(z, arity, \
|
||||
BOOST_CONTRACT_AUX_NAME1(Args)) \
|
||||
class BOOST_CONTRACT_DETAIL_NAME1(B), \
|
||||
class BOOST_CONTRACT_DETAIL_NAME1(C) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_TPARAMS_Z(z, arity, \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(Args)) \
|
||||
> \
|
||||
static void BOOST_CONTRACT_AUX_NAME1(call_base)( \
|
||||
boost::contract::virtual_* BOOST_CONTRACT_AUX_NAME1(v), \
|
||||
BOOST_CONTRACT_AUX_NAME1(C)* BOOST_CONTRACT_AUX_NAME1(obj) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_FPARAMS_Z(z, arity, \
|
||||
BOOST_CONTRACT_AUX_NAME1(Args), \
|
||||
static void BOOST_CONTRACT_DETAIL_NAME1(call_base)( \
|
||||
boost::contract::virtual_* BOOST_CONTRACT_DETAIL_NAME1(v), \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(C)* BOOST_CONTRACT_DETAIL_NAME1(obj) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_FPARAMS_Z(z, arity, \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(Args), \
|
||||
&, \
|
||||
BOOST_CONTRACT_AUX_NAME1(args) \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(args) \
|
||||
) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(arity_compl) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(z, arity_compl, \
|
||||
boost::contract::aux::none&) \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(arity_compl) \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(z, arity_compl, \
|
||||
boost::contract::detail::none&) \
|
||||
) { \
|
||||
BOOST_CONTRACT_AUX_NAME1(obj)->BOOST_CONTRACT_AUX_NAME1(B)::f( \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(z, arity, \
|
||||
BOOST_CONTRACT_AUX_NAME1(args)) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_NAME1(v) \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(obj)-> \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(B)::f( \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(z, arity, \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(args)) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(v) \
|
||||
); \
|
||||
}
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#define BOOST_CONTRACT_OVERRIDE_CALL_BASE_DECL_(f) \
|
||||
BOOST_CONTRACT_OVERRIDE_CALL_BASE_(1, ~, ~, f)
|
||||
#else
|
||||
@@ -68,8 +69,8 @@
|
||||
|
||||
#define BOOST_CONTRACT_OVERRIDE_TRAIT(trait, f) \
|
||||
struct trait { \
|
||||
BOOST_CONTRACT_AUX_INTROSPECTION_HAS_MEMBER_FUNCTION( \
|
||||
BOOST_CONTRACT_AUX_NAME1(has_member_function), f) \
|
||||
BOOST_CONTRACT_DETAIL_INTROSPECTION_HAS_MEMBER_FUNCTION( \
|
||||
BOOST_CONTRACT_DETAIL_NAME1(has_member_function), f) \
|
||||
\
|
||||
BOOST_CONTRACT_OVERRIDE_CALL_BASE_DECL_(f) \
|
||||
};
|
||||
|
||||
@@ -11,14 +11,14 @@
|
||||
|
||||
// TODO: Document that not using variadic templates (i.e., using pp meta-programming impl instead) does not increase compilation times (I measured this with the max_arg test program).
|
||||
|
||||
#include <boost/contract/aux_/all_core_headers.hpp>
|
||||
#include <boost/contract/aux_/decl.hpp>
|
||||
#include <boost/contract/aux_/tvariadic.hpp>
|
||||
#include <boost/contract/detail/all_core_headers.hpp>
|
||||
#include <boost/contract/detail/decl.hpp>
|
||||
#include <boost/contract/detail/tvariadic.hpp>
|
||||
#ifndef BOOST_CONTRACT_NO_PUBLIC_FUNCTIONS
|
||||
#include <boost/contract/aux_/operation/public_static_function.hpp>
|
||||
#include <boost/contract/aux_/operation/public_function.hpp>
|
||||
#include <boost/contract/aux_/type_traits/optional.hpp>
|
||||
#include <boost/contract/aux_/none.hpp>
|
||||
#include <boost/contract/detail/operation/public_static_function.hpp>
|
||||
#include <boost/contract/detail/operation/public_function.hpp>
|
||||
#include <boost/contract/detail/type_traits/optional.hpp>
|
||||
#include <boost/contract/detail/none.hpp>
|
||||
#include <boost/function_types/result_type.hpp>
|
||||
#include <boost/function_types/function_arity.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <boost/static_assert.hpp>
|
||||
#include <boost/preprocessor/tuple/eat.hpp>
|
||||
#endif
|
||||
#if !BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#if !BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
#include <boost/preprocessor/repetition/repeat.hpp>
|
||||
#include <boost/preprocessor/arithmetic/sub.hpp>
|
||||
#include <boost/preprocessor/arithmetic/inc.hpp>
|
||||
@@ -56,7 +56,7 @@ template<class C>
|
||||
set_precondition_old_postcondition<> public_function() {
|
||||
#ifndef BOOST_CONTRACT_NO_PUBLIC_FUNCTIONS
|
||||
return set_precondition_old_postcondition<>(
|
||||
new boost::contract::aux::public_static_function<C>());
|
||||
new boost::contract::detail::public_static_function<C>());
|
||||
#else
|
||||
return set_precondition_old_postcondition<>();
|
||||
#endif
|
||||
@@ -67,24 +67,26 @@ template<class C>
|
||||
set_precondition_old_postcondition<> public_function(C* obj) {
|
||||
#ifndef BOOST_CONTRACT_NO_PUBLIC_FUNCTIONS
|
||||
return set_precondition_old_postcondition<>(
|
||||
new boost::contract::aux::public_function<
|
||||
boost::contract::aux::none,
|
||||
boost::contract::aux::none,
|
||||
boost::contract::aux::none,
|
||||
new boost::contract::detail::public_function<
|
||||
boost::contract::detail::none,
|
||||
boost::contract::detail::none,
|
||||
boost::contract::detail::none,
|
||||
C
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(1,
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(
|
||||
BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS,
|
||||
boost::contract::aux::none
|
||||
boost::contract::detail::none
|
||||
)
|
||||
>(
|
||||
static_cast<boost::contract::virtual_*>(0),
|
||||
obj,
|
||||
boost::contract::aux::none::value()
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(1,
|
||||
boost::contract::detail::none::value()
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(
|
||||
BOOST_CONTRACT_MAX_ARGS)
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(1,
|
||||
BOOST_CONTRACT_MAX_ARGS,
|
||||
boost::contract::aux::none::value()
|
||||
boost::contract::detail::none::value()
|
||||
)
|
||||
)
|
||||
);
|
||||
@@ -119,16 +121,20 @@ set_precondition_old_postcondition<> public_function(C* obj) {
|
||||
/* no F... so cannot enforce contracted F ret R (up to user) */ \
|
||||
return (set_precondition_old_postcondition< \
|
||||
BOOST_PP_EXPR_IIF(has_result, R)>( \
|
||||
new boost::contract::aux::public_function< \
|
||||
boost::contract::aux::none, \
|
||||
BOOST_PP_IIF(has_result, R, boost::contract::aux::none), \
|
||||
boost::contract::aux::none, \
|
||||
new boost::contract::detail::public_function< \
|
||||
boost::contract::detail::none, \
|
||||
BOOST_PP_IIF(has_result, \
|
||||
R \
|
||||
, \
|
||||
boost::contract::detail::none \
|
||||
), \
|
||||
boost::contract::detail::none, \
|
||||
C \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA( \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA( \
|
||||
BOOST_CONTRACT_MAX_ARGS) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(1, \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(1, \
|
||||
BOOST_CONTRACT_MAX_ARGS, \
|
||||
boost::contract::aux::none \
|
||||
boost::contract::detail::none \
|
||||
) \
|
||||
>( \
|
||||
v, \
|
||||
@@ -136,13 +142,13 @@ set_precondition_old_postcondition<> public_function(C* obj) {
|
||||
BOOST_PP_IIF(has_result, \
|
||||
r \
|
||||
, \
|
||||
boost::contract::aux::none::value() \
|
||||
boost::contract::detail::none::value() \
|
||||
) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA( \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA( \
|
||||
BOOST_CONTRACT_MAX_ARGS) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(1, \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(1, \
|
||||
BOOST_CONTRACT_MAX_ARGS, \
|
||||
boost::contract::aux::none::value() \
|
||||
boost::contract::detail::none::value() \
|
||||
) \
|
||||
) \
|
||||
)); \
|
||||
@@ -158,7 +164,7 @@ BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_NO_OVERRIDE_(/* has_result = */ 1)
|
||||
// For non-static, virtual, and overriding public functions (PRIVATE macro).
|
||||
#define BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_OVERRIDE_Z_( \
|
||||
z, arity, arity_compl, has_result) \
|
||||
BOOST_CONTRACT_AUX_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
BOOST_CONTRACT_DETAIL_DECL_OVERRIDING_PUBLIC_FUNCTION_Z(z, \
|
||||
arity, /* is_friend = */ 0, has_result, \
|
||||
O, R, F, C, Args, \
|
||||
v, r, f, obj, args \
|
||||
@@ -169,7 +175,7 @@ BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_NO_OVERRIDE_(/* has_result = */ 1)
|
||||
BOOST_STATIC_ASSERT_MSG( \
|
||||
/* -2 for both `this` and `virtual_*` extra parameters */ \
|
||||
boost::function_types::function_arity<F>::value - 2 == \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_SIZEOF(arity, Args), \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_SIZEOF(arity, Args), \
|
||||
"missing one or more arguments for specified function" \
|
||||
); \
|
||||
/* assert consistency of F's result type and R (if has_result) */ \
|
||||
@@ -181,7 +187,7 @@ BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_NO_OVERRIDE_(/* has_result = */ 1)
|
||||
(boost::is_same< \
|
||||
typename boost::remove_reference<typename boost:: \
|
||||
function_types::result_type<F>::type>::type, \
|
||||
typename boost::contract::aux:: \
|
||||
typename boost::contract::detail:: \
|
||||
remove_value_reference_if_optional<R>::type \
|
||||
>::value), \
|
||||
"mismatching result type for specified function" \
|
||||
@@ -193,29 +199,33 @@ BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_NO_OVERRIDE_(/* has_result = */ 1)
|
||||
); \
|
||||
return (set_precondition_old_postcondition< \
|
||||
BOOST_PP_EXPR_IIF(has_result, R)>( \
|
||||
new boost::contract::aux::public_function< \
|
||||
new boost::contract::detail::public_function< \
|
||||
O, \
|
||||
BOOST_PP_IIF(has_result, R, boost::contract::aux::none), \
|
||||
BOOST_PP_IIF(has_result, \
|
||||
R \
|
||||
, \
|
||||
boost::contract::detail::none \
|
||||
), \
|
||||
F, \
|
||||
C \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(z, arity, Args) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(arity_compl) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(z, arity_compl, \
|
||||
boost::contract::aux::none) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(z, arity, Args) \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(arity_compl) \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(z, arity_compl, \
|
||||
boost::contract::detail::none) \
|
||||
>( \
|
||||
v, \
|
||||
obj, \
|
||||
BOOST_PP_IIF(has_result, \
|
||||
r \
|
||||
, \
|
||||
boost::contract::aux::none::value() \
|
||||
boost::contract::detail::none::value() \
|
||||
) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_AUX_TVARIADIC_ARGS_Z(z, arity, args) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_COMMA(arity_compl) \
|
||||
BOOST_CONTRACT_AUX_NO_TVARIADIC_ENUM_Z(z, arity_compl, \
|
||||
boost::contract::aux::none::value()) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_COMMA(arity) \
|
||||
BOOST_CONTRACT_DETAIL_TVARIADIC_ARGS_Z(z, arity, args) \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_COMMA(arity_compl) \
|
||||
BOOST_CONTRACT_DETAIL_NO_TVARIADIC_ENUM_Z(z, arity_compl, \
|
||||
boost::contract::detail::none::value()) \
|
||||
) \
|
||||
)); \
|
||||
, \
|
||||
@@ -224,7 +234,7 @@ BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_NO_OVERRIDE_(/* has_result = */ 1)
|
||||
) \
|
||||
}
|
||||
|
||||
#if BOOST_CONTRACT_AUX_TVARIADIC
|
||||
#if BOOST_CONTRACT_DETAIL_TVARIADIC
|
||||
BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_OVERRIDE_Z_(1,
|
||||
/* arity = */ ~, /* arity_compl = */ ~, /* has_result = */ 0)
|
||||
BOOST_CONTRACT_PUBLIC_FUNCTION_VIRTUAL_OVERRIDE_Z_(1,
|
||||
|
||||
Reference in New Issue
Block a user