swestrup: (Default)
[personal profile] swestrup
Having been forcefully reminded how sucky C++'s output formatting operators are to use, I started planning to write something better.

My preliminary design had one able to write something like this:

Fmt hexb("%02X");
cout << hexb % 0x12 << endl;
That seemed logical enough. While I was looking into what I would need to do to write it, I discovered it already exists. Its the format boost library. They even use operator% in the same way. The only major differences are:
  1. Mine is in the design stage. Theirs exists.
  2. They have a whole lot more options than I had thought of.
  3. They called it format, while I called my Fmt.
Once again, I'm behind on the old innovation curve.

Date: 2007-03-15 07:08 am (UTC)
From: [identity profile] pphaneuf.livejournal.com
If you're about to do something clever in C++, it is usually wise to look around in Boost, chances are it's already there, peer-reviewed to hell and back, and well on it's way to becoming part of an upcoming C++ standard library.

January 2017

S M T W T F S
1234567
891011121314
15161718192021
22232425262728
293031    

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 25th, 2025 08:09 pm
Powered by Dreamwidth Studios