This is an automated email from the ASF dual-hosted git repository.

martin-g pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/avro.git


The following commit(s) were added to refs/heads/main by this push:
     new 6444e8d5e8 MINOR: [C++] fix missing format_context when compiled with 
C++23 (#3815)
6444e8d5e8 is described below

commit 6444e8d5e86baa85ab5962a8bc275838e8c364b6
Author: Gang Wu <[email protected]>
AuthorDate: Wed Jun 10 16:02:22 2026 +0800

    MINOR: [C++] fix missing format_context when compiled with C++23 (#3815)
---
 lang/c++/include/avro/Node.hh  | 3 ++-
 lang/c++/include/avro/Types.hh | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lang/c++/include/avro/Node.hh b/lang/c++/include/avro/Node.hh
index 5f8dd2a443..26d8da6453 100644
--- a/lang/c++/include/avro/Node.hh
+++ b/lang/c++/include/avro/Node.hh
@@ -225,7 +225,8 @@ inline std::ostream &operator<<(std::ostream &os, const 
avro::Node &n) {
 
 template<>
 struct std::formatter<avro::Name, char> : std::formatter<std::string, char> {
-    auto format(const avro::Name &n, std::format_context &ctx) const {
+    template<typename FormatContext>
+    auto format(const avro::Name &n, FormatContext &ctx) const {
         return std::formatter<std::string, char>::format(n.fullname(), ctx);
     }
 };
diff --git a/lang/c++/include/avro/Types.hh b/lang/c++/include/avro/Types.hh
index fca3a4b86f..1453b27b76 100644
--- a/lang/c++/include/avro/Types.hh
+++ b/lang/c++/include/avro/Types.hh
@@ -112,7 +112,8 @@ std::ostream &operator<<(std::ostream &os, const Null 
&null);
 
 template<>
 struct std::formatter<avro::Type, char> : std::formatter<std::string, char> {
-    auto format(avro::Type t, std::format_context &ctx) const {
+    template<typename FormatContext>
+    auto format(avro::Type t, FormatContext &ctx) const {
         return std::formatter<std::string, char>::format(avro::toString(t), 
ctx);
     }
 };

Reply via email to