MCPcopy Create free account
hub / github.com/FastLED/FastLED / not_null

Function not_null

src/fl/stl/not_null.h:173–177  ·  view source on GitHub ↗

Primary constructor - accepts non-null pointer Asserts non-null in debug builds, undefined behavior if null in release Note: Not explicit to allow implicit conversion from T (matching GSL behavior) Note: Not constexpr in C++11 due to FL_NOT_NULL_ASSERT limitation

Source from the content-addressed store, hash-verified

171 // Note: Not explicit to allow implicit conversion from T (matching GSL behavior)
172 // Note: Not constexpr in C++11 due to FL_NOT_NULL_ASSERT limitation
173 not_null(T ptr) FL_NOEXCEPT : mPtr(ptr) {
174 if (mPtr == nullptr) {
175 detail::not_null_assert_failed("not_null constructed with nullptr");
176 }
177 }
178
179 // Copy constructor (defaulted)
180 constexpr not_null(const not_null& other) FL_NOEXCEPT = default;

Callers 1

not_null.hFile · 0.70

Calls 2

not_null_assert_failedFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected