KalleOlaviNiemitalo commented on code in PR #3056:
URL: https://github.com/apache/avro/pull/3056#discussion_r1701594614
##########
lang/c++/impl/DataFile.cc:
##########
@@ -63,35 +64,34 @@ boost::iostreams::zlib_params get_zlib_params() {
}
} // namespace
-DataFileWriterBase::DataFileWriterBase(const char *filename, const ValidSchema
&schema, size_t syncInterval,
- Codec codec) : filename_(filename),
- schema_(schema),
+DataFileWriterBase::DataFileWriterBase(const char *filename,
+ const ValidSchema &schema,
+ size_t syncInterval,
+ Codec codec) :
DataFileWriterBase(fileOutputStream(filename), schema, syncInterval, codec) {
+}
+
+DataFileWriterBase::DataFileWriterBase(OutputStream &outputStream,
Review Comment:
That seems possible, if the DataFileWriterBase is heap-allocated. But
[std::back_insert_iterator](https://en.cppreference.com/w/cpp/iterator/back_insert_iterator/back_insert_iterator)
likewise takes and saves a reference so programmers should know about this
kind of risk.
--
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]