From 64f317710aca723bf5d8fc7f9f1a2eca31737b77 Mon Sep 17 00:00:00 2001 From: Alexis Placet Date: Wed, 18 Dec 2024 10:59:29 +0100 Subject: [PATCH] Address comments --- .../sparrow/layout/list_layout/list_array.hpp | 13 ------ include/sparrow/utils/format.hpp | 42 +++++++------------ 2 files changed, 14 insertions(+), 41 deletions(-) diff --git a/include/sparrow/layout/list_layout/list_array.hpp b/include/sparrow/layout/list_layout/list_array.hpp index 63885b913..d1fda9f97 100644 --- a/include/sparrow/layout/list_layout/list_array.hpp +++ b/include/sparrow/layout/list_layout/list_array.hpp @@ -735,16 +735,3 @@ namespace sparrow return arrow_proxy{std::move(arr), std::move(schema)}; } } - -// #if defined(__cpp_lib_format) - -// template -// struct std::formatter : std::formatter -// { -// auto format(const sparrow::list_array& arr, U& ctx) -> decltype(ctx.out()) -// { -// return std::formatter::format(arr, ctx); -// } -// }; - -// #endif diff --git a/include/sparrow/utils/format.hpp b/include/sparrow/utils/format.hpp index 51e52346b..2ef7af3bb 100644 --- a/include/sparrow/utils/format.hpp +++ b/include/sparrow/utils/format.hpp @@ -125,6 +125,14 @@ namespace sparrow std::format_to(out, "{}", std::string(count, separator[0])); } +#if defined(__clang__) +# pragma clang diagnostic push +# pragma clang diagnostic ignored "-Wsign-conversion" +#endif +#if defined(__GNUC__) +# pragma GCC diagnostic push +# pragma GCC diagnostic ignored "-Wsign-conversion" +#endif template requires(std::convertible_to, std::string>) constexpr void to_table_with_columns(OutputIt out, const Headers& headers, const Columns& columns) @@ -150,21 +158,7 @@ namespace sparrow // max with names for (size_t i = 0; i < std::ranges::size(headers); ++i) { -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wsign-conversion" -#endif -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wsign-conversion" -#endif widths[i] = std::max(widths[i], std::ranges::size(headers[i])); -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#endif -#if defined(__clang__) -# pragma clang diagnostic pop -#endif } to_row(out, widths, headers); std::format_to(out, "{}", '\n'); @@ -178,21 +172,7 @@ namespace sparrow columns, [i](const auto& column) { -#if defined(__clang__) -# pragma clang diagnostic push -# pragma clang diagnostic ignored "-Wsign-conversion" -#endif -#if defined(__GNUC__) -# pragma GCC diagnostic push -# pragma GCC diagnostic ignored "-Wsign-conversion" -#endif return column[i]; -#if defined(__GNUC__) -# pragma GCC diagnostic pop -#endif -#if defined(__clang__) -# pragma clang diagnostic pop -#endif } ); to_row(out, widths, row_range); @@ -201,4 +181,10 @@ namespace sparrow horizontal_separator(out, widths); } +#if defined(__GNUC__) +# pragma GCC diagnostic pop +#endif +#if defined(__clang__) +# pragma clang diagnostic pop +#endif }