Boost
C++ Libraries
...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
This version of Boost is under active development. You are currently in the develop branch. The current version is 1.89.0.
boost::contract::condition_if — Select compilation and execution of a boolean functor template condition using a nullary boolean meta-function (not needed on C++17 compilers, use if constexpr instead).
// In header: <boost/contract/call_if.hpp> template<typename Pred, typename Then> bool condition_if(Then f, bool else_ = true);
This is equivalent to boost::contract::condition_if_c<Pred::value>(f, else_). Compile and execute the nullary boolean functor template call f() if and only if the specified nullary boolean meta-function Pred::value is true, otherwise trivially return else_ (true by default) at run-time.
See Also: Assertion Requirements
Parameters: |
|
||||
Template Parameters: |
|
||||
Returns: |
Boolean value returned by |