mercredi 11 janvier 2023

What's the purpose of using pointer to std::shared_ptr in C++ library Gandiva

I'm learning Gandiva module in Apache Arrow. I found that many APIs requires parameters in form of std::shared_ptr *p. E.g., here is an typical API

static inline Status Make(SchemaPtr schema, ConditionPtr condition, std::shared_ptr<Filter> *filter)

I don't understand why need using pointer to shared_ptr instead of simple shared_ptr. To my understanding, raw pointer should be avoided in C++ as much as possible, and shared_ptr is designed to an alternative to raw pointers.

Aucun commentaire:

Enregistrer un commentaire