jgehrcke commented on code in PR #15049:
URL: https://github.com/apache/arrow/pull/15049#discussion_r1056225766


##########
cpp/src/arrow/dataset/file_base.h:
##########
@@ -200,6 +200,9 @@ class ARROW_DS_EXPORT FileFormat : public 
std::enable_shared_from_this<FileForma
       fs::FileLocator destination_locator) const = 0;
 
   /// \brief Get default write options for this format.
+  ///
+  /// May return nullptr if this file format does not yet support writing

Review Comment:
   Ha. OK. 
   
   I will revert the code change.
   
   About the comment, however: I am not convinced that "empty shared_ptr" is 
correct. "empty shared_ptr" means primarily that the pointer owns nothing. 
Whether or not this is a shared_ptr that points to nothing (i.e., whose get() 
== nullptr) is not defined by the word "empty".
   
   It's seemingly not as simple as "It seems that a std::shared_ptr that stores 
nullptr is called empty".
   
   This following paragraph makes it rather clear to me (emphasis mine):
   
   > A shared_ptr that does not own any pointer is called an empty shared_ptr. 
**A shared_ptr that points to no object is called a null shared_ptr** and shall 
not be [dereferenced](https://cplusplus.com/shared_ptr::operator*). Notice 
though that **an empty shared_ptr is not necessarily a null shared_ptr, and a 
null shared_ptr is not necessarily an empty shared_ptr**.
   
   (https://cplusplus.com/reference/memory/shared_ptr/)
   
   Given these statements the term "null shared_ptr" seems to be more 
appropriate than "empty shared_ptr".
   
   



-- 
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