| 156 | */ |
| 157 | template <typename... Ts> |
| 158 | inline arm_compute::Status error_on_nullptr(const char *function, const char *file, const int line, Ts &&...pointers) |
| 159 | { |
| 160 | const std::array<const void *, sizeof...(Ts)> pointers_array{{std::forward<Ts>(pointers)...}}; |
| 161 | bool has_nullptr = |
| 162 | std::any_of(pointers_array.begin(), pointers_array.end(), [&](const void *ptr) { return (ptr == nullptr); }); |
| 163 | ARM_COMPUTE_RETURN_ERROR_ON_LOC_MSG(has_nullptr, function, file, line, "Nullptr object!"); |
| 164 | return arm_compute::Status{}; |
| 165 | } |
| 166 | #define ARM_COMPUTE_ERROR_ON_NULLPTR(...) \ |
| 167 | ARM_COMPUTE_ERROR_THROW_ON(::arm_compute::error_on_nullptr(__func__, __FILE__, __LINE__, __VA_ARGS__)) |
| 168 | #define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...) \ |
no test coverage detected