Is it possible to annotate my smart pointer-returning function with SAL?
_Ret_maybenull_ std::shared_ptr<MyClass> getMyObject();
Gives me the warning
warning C6504: Invalid annotation: 'Null' property may only be used on values of pointer, pointer-to-member, array, or reference type: Function 'getMyObject' return. Actual type 'class std::shared_ptr'.
and not a single warning when writing this:
auto a = getMyObject();
a->foo();
Aucun commentaire:
Enregistrer un commentaire