Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ag] fmt::formatter-s factory #263

Open
GuillaumeDua opened this issue Oct 5, 2024 · 0 comments
Open

[ag] fmt::formatter-s factory #263

GuillaumeDua opened this issue Oct 5, 2024 · 0 comments
Assignees

Comments

@GuillaumeDua
Copy link
Owner

GuillaumeDua commented Oct 5, 2024

In a nutshell

  • transform
  • flatten/join
  • depth_enumerated

Motivation

Flatten tuple-like aggregates to ease implementation.

struct A{ int i = 42; char c = 'a'; };
struct B{ float f = .123f; A a; };
struct C{ bool b_ = true; B b; };

// flatten C: bool, float, int, char

Details

Add transformations such as typename ... modifier_ts projection-like.

auto join_view_v = join<indexed, typenamed>(C{});

using result_t = std::tuple<
   fmt::formatter<depth_enumerated_t<0, bool>>,
   fmt::formatter<depth_enumerated_t<1, float>>,
   fmt::formatter<depth_enumerated_t<2, int>>,
   fmt::formatter<depth_enumerated_t<2, char>>,
>;
// or
using result_t = std::tuple<
   fmt::formatter<depth_enumerated_t<0, C>>,
   fmt::formatter<depth_enumerated_t<1, bool>>,
   fmt::formatter<depth_enumerated_t<1, B>>,
   fmt::formatter<depth_enumerated_t<2, float>>,
   fmt::formatter<depth_enumerated_t<2, A>>,
   fmt::formatter<depth_enumerated_t<3, int>>,
   fmt::formatter<depth_enumerated_t<3, char>>,
>;

Design

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: To do
Development

No branches or pull requests

1 participant