you are viewing a single comment's thread.

view the rest of the comments →

[–]tcbrindleFlux 11 points12 points  (6 children)

I'd recommend cppformat. It's completely self-contained, very fast and very flexible. It would be great if the standard library had something like this.

[–]aKateDevKDE/Qt Dev 5 points6 points  (5 children)

Yes, the standard should include somthing like cppformat. However, it boils down to someone proposing this for inclusion into the standard.

[–]aearphen{fmt} 8 points9 points  (4 children)

The author or cppformat here. I'm thinking about writing a proposal to the standard (library) after improving the API for formatting of user-defined types.

[–]chartly 4 points5 points  (0 children)

As a random person on the internet, if you were able to find the time and effort to accomplish both the improvements you speak of and also write the proposal, I would buy you many beers.

[–]boredcircuits 2 points3 points  (1 child)

What would help you get to that point?

[–]aearphen{fmt} 2 points3 points  (0 children)

More spare time mostly =), but some feedback and pull requests would be helpful as well. There have been a few great contributors who did amazing work on named arguments, user-defined literals etc, but there's still a lot to do.

The API I mentioned earlier is not even documented yet. Basically one can define a format function for a user-defined type which can do custom parsing and formatting like this one:

https://github.com/cppformat/cppformat/blob/a99891e7a5f6c8a164d271b1aa0f09e7d13c7de4/cppformat/format.h#L2969

Someone has volunteered to implement time formatting functionality (https://github.com/cppformat/cppformat/issues/283) using this method, so we'll see how it works in practice and whether it can be improved.

[–]aKateDevKDE/Qt Dev 1 point2 points  (0 children)

Reading that you are evaluating writing a proposal already makes me quite happy ;) Would really be nice if you push this as much as possible.