From f860e231f5823dd69afd67a02b4904e5e1eca9d6 Mon Sep 17 00:00:00 2001 From: Roland Conybeare Date: Sat, 27 Apr 2024 11:52:29 -0400 Subject: [PATCH] xo-ratio: deal: clang requires public structural-type members --- include/xo/ratio/ratio.hpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/include/xo/ratio/ratio.hpp b/include/xo/ratio/ratio.hpp index 2c4b0c53..36087e7e 100644 --- a/include/xo/ratio/ratio.hpp +++ b/include/xo/ratio/ratio.hpp @@ -326,7 +326,17 @@ namespace xo { return lhs <=> rhs; } + /* we want ratio to be a structural type, + * so that we can use an instance as a non-type template parameter. + * + * with private members, clang 18 (we believe incorrectly) complains that ratio is not structural. + */ +#ifdef __clang__ + public: +#else private: +#endif + /** @defgroup ratio-instance-variables **/ ///@{ /** @brief numerator **/