...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
boost::contract::call_if_statement<true, Then, void> — Template specialization to handle static predicates that are true
for then-branch functor template calls that return void.
// In header: <boost/contract/call_if.hpp> template<typename Then> struct call_if_statement<true, Then, void> { // construct/copy/destruct explicit call_if_statement(Then); // public member functions template<typename Else> void else_(Else const &) const; template<bool ElseIfPred, typename ElseIfThen> call_if_statement< true, Then, void > else_if_c(ElseIfThen const &) const; template<typename ElseIfPred, typename ElseIfThen> call_if_statement< true, Then, void > else_if(ElseIfThen const &) const; };
Usually this class template is instantiated only via the return value of boost::contract::call_if
and boost::contract::call_if_c
.
See Also:
typename Then
Type of functor template to call when the static predicate if true
(as it is for this template specialization).
call_if_statement
public
construct/copy/destructexplicit call_if_statement(Then f);Construct this object with the then-branch functor template.
Parameters: |
|
call_if_statement
public member functionstemplate<typename Else> void else_(Else const & f) const;Specify the else-branch functor template.
Parameters: |
|
template<bool ElseIfPred, typename ElseIfThen> call_if_statement< true, Then, void > else_if_c(ElseIfThen const & f) const;Specify an else-if-branch functor template (using a static boolean predicate).
Parameters: |
|
||
Template Parameters: |
|
||
Returns: |
A call-if statement so the else statement and additional else-if statements can be specified if needed. Eventually, it will return void for this template specialization (because the then-branch functor template calls return void). |
template<typename ElseIfPred, typename ElseIfThen> call_if_statement< true, Then, void > else_if(ElseIfThen const & f) const;Specify an else-if-branch functor template (using a nullary boolean meta-function).
Parameters: |
|
||
Template Parameters: |
|
||
Returns: |
A call-if statement so the else statement and additional else-if statements can be specified if needed. Eventually, it will return void for this template specialization (because the then-branch functor template calls return void). |