Template Function nix::valid::could

Function Documentation

template<typename TOBJ, typename TBASEOBJ, typename TRET, typename TCHECK>
condition nix::valid::could(const TOBJ &parent, TRET (TBASEOBJ::* get)(void) const, const TCHECK &check, const std::vector<condition> &subs = {})

creates condition not throwing any message even if check fails

Creates a condition check that produces no message even if the given function call’s return value does not pass the test. It is meant to be used to execute sub-conditions only if test passes without this condition causing errors/warnings if it fails. NOTE: the list of sub conditions is being executed in the given order if and only if this conditions’ check passes. The results are merged and returned together. Also catches any errors occuring on execution of the given function calls.

Parameters
  • parent – Parent object

  • get – Getter method in parent object (pointer-to-member)

  • check – The test itself (e.g. notFalse or notEmpty)

  • subs – Init list of sub conditions to be executed only if this check succeeds.

Returns

The created, callable condition of type condition