bkietz commented on code in PR #38252:
URL: https://github.com/apache/arrow/pull/38252#discussion_r1360841575


##########
cpp/src/arrow/extension_type.h:
##########
@@ -45,6 +45,9 @@ class ARROW_EXPORT ExtensionType : public DataType {
   /// \brief The type of array used to represent this extension type's data
   const std::shared_ptr<DataType>& storage_type() const { return 
storage_type_; }
 
+  /// \brief Return a reference to the storage type
+  const DataType& storage_type_ref() const override { return *storage_type_; }

Review Comment:
   Alternatively, I could change the return type and make `storage_type()` 
virtual:
   
   ```suggestion
     std::shared_ptr<DataType> storage_type() const override { return 
storage_type_; }
   ```
   
   Then `DataType::storage_type()` can just call `shared_from_this()`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to