Re: pointer check in unit tests

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice



[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux