martin-g commented on code in PR #3545:
URL: https://github.com/apache/avro/pull/3545#discussion_r2522606982


##########
lang/c++/include/avro/Specific.hh:
##########
@@ -165,6 +166,44 @@ struct codec_traits<double> {
     }
 };
 
+/**
+* codec_traits for Avro optional.
+*/
+template<typename T>
+struct codec_traits<std::optional<T>> {
+    /**
+       * Encodes a given value.
+       */
+    static void encode(Encoder &e, const std::optional<T> &b) {

Review Comment:
   > AVRO optional
   
   There is no such thing as `Avro optional`. The type is `Union`. It can have 
from 2 to N variants. 
   "null" is not a mandatory variant. It could be at any index in the variants, 
but usually it is the first one. Without a Schema it is a wild guess.



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