(間違った C++ 用語を使用している場合は、この投稿を編集してください。私は完全な C++ 初心者です。)
Objective-Cのnull可能性は、Objective-C++クラスのC++オブジェクトでどのように機能しますか?
たとえば、次の型と関数があるとします。
typedef struct
{
const Foo* fooArray;
uint32_t fooArrayLength;
} FooList;
uint32_t GetFoo(const std::string& bar, std::shared_ptr<const FooList>& result);
このように再定義することは合法GetFoo
ですか?
uint32_t GetFoo(const std::string& _Nonnull bar, std::shared_ptr<const FooList _Nullable>& _Nonnull result);
このように呼び出した場合、clang または静的アナライザーから警告が表示されGetFoo
ますか?
GetFoo(nil, nil);