Skip to main content

suspicious_condition Concept

Concept satisfied when a type is contextually convertible to bool, but is most likely not a condition. More...

Definition​

template <class T>
concept micro_os_plus::micro_test_plus::detail::suspicious_condition = std::is_array_v<T> or std::is_function_v<T>
          or std::is_member_pointer_v<T>
          or (std::is_pointer_v<T>
              and (std::is_function_v<std::remove_pointer_t<T>>
                   or std::is_same_v<
                       std::remove_cv_t<std::remove_pointer_t<T>>, char>
                   or std::is_same_v<
                       std::remove_cv_t<std::remove_pointer_t<T>>, wchar_t>
                   or std::is_same_v<
                       std::remove_cv_t<std::remove_pointer_t<T>>, char8_t>
                   or std::is_same_v<
                       std::remove_cv_t<std::remove_pointer_t<T>>, char16_t>
                   or std::is_same_v<
                       std::remove_cv_t<std::remove_pointer_t<T>>, char32_t>))

Description​

Concept satisfied when a type is contextually convertible to bool, but is most likely not a condition.

Template Parameters
T

The type to be checked.

The suspicious_condition concept is satisfied by the arrays (including the string literals), the functions, the pointers to functions and to members, and the pointers to the character types. All of them are contextually convertible to bool, so, when passed to expect() or require(), the check silently passes, usually because the description was written instead of the condition, or because a function name was written without the call. The pointers to other object types are not included, since checking a pointer for null is a legitimate use.

Definition at line 238 of file extension.h.

  template<class T>
  concept suspicious_condition = std::is_array_v<T> or std::is_function_v<T>
  or std::is_member_pointer_v<T>
  or (std::is_pointer_v<T>
  and (std::is_function_v<std::remove_pointer_t<T>>
  or std::is_same_v<
  std::remove_cv_t<std::remove_pointer_t<T>>, char>
  or std::is_same_v<
  std::remove_cv_t<std::remove_pointer_t<T>>, wchar_t>
  or std::is_same_v<
  std::remove_cv_t<std::remove_pointer_t<T>>, char8_t>
  or std::is_same_v<
  std::remove_cv_t<std::remove_pointer_t<T>>, char16_t>
  or std::is_same_v<
  std::remove_cv_t<std::remove_pointer_t<T>>, char32_t>))

Generated via doxygen2docusaurus 2.2.8 by Doxygen 1.18.0.