Template Function nix::valid::should

Function Documentation

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

creates condition throwing warning if check fails

Creates a condition check that produces a warning with the given message if the given function call’s return value does not pass the test. 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 call.

Parameters
  • parent – Parent object

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

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

  • msg – The message to produce if the test fails.

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

Returns

The created, callable condition of type condition