pointer check in unit tests
Mike Kaganski
mikekaganski at hotmail.com
Wed Nov 4 10:35:02 UTC 2020
On 04.11.2020 12:51, Stephan Bergmann wrote:
> On 04/11/2020 08:26, Miklos Vajna wrote:
>> If a never-nullptr pointer is returned, it would be really useful to
>> somehow state that in the function's signature. Are you aware of any way
>> to do that? There is C's __attribute__((nonnull)), but it only works on
>> function parameters, I think.
>
> see "not_null" at
> <https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines>
The note in F.60 that reads:
> Note If you prefer the pointer notation (-> and/or * vs. .), not_null<T*> provides the same guarantee as T&.
looks to me as if T& still *does* mean "pointer, but not null, with a
special syntax".
--
Best regards,
Mike Kaganski
More information about the LibreOffice
mailing list