For some technical reasons I had to replicate the functionality of std::tuple in my library. (see here: https://github.com/correaa/boost-multi?tab=readme-ov-file#formatting-fmt-pretty-printing)
I would be nice that the features in fmt would work on any type that has std::get<N>, std::tuple_size, etc. in their interface.
That is, if a type is tuple like then it could be printed as a tuple.
(This will also work on any class for which structured binding is implemented).
int main() {
std::tuple<int, int> t1(1, 2);
fmt::print( "{}", fmt::join(t1, "x") ); // prints 1 x 2
my_tuple<int, int> t2(1, 2);
fmt::print( "{}", fmt::join(t2, "x") ); // doesn't work now
}
Here it is a godbolt example:
https://godbolt.org/z/Gof6f4oaE
For some technical reasons I had to replicate the functionality of std::tuple in my library. (see here: https://github.com/correaa/boost-multi?tab=readme-ov-file#formatting-fmt-pretty-printing)
I would be nice that the features in fmt would work on any type that has
std::get<N>,std::tuple_size, etc. in their interface.That is, if a type is tuple like then it could be printed as a tuple.
(This will also work on any class for which structured binding is implemented).
Here it is a godbolt example:
https://godbolt.org/z/Gof6f4oaE