c42f / tinyformat

Minimal, type safe printf replacement library for C++
537 stars 75 forks source link

Alter repository title or decouple from standard streams #75

Closed eyalroz closed 3 years ago

eyalroz commented 4 years ago

The repository title is "A minimal type safe printf() replacement"... but it really isn't minimal if you pull in all of <iostream> ... you could have just wrapped printf (or even decoupled the underlying "real-output" function and make this wrapper more abstract). Right now the title is misleading, so I suggest it be rephrased.

Otherwise - nice little library... I was just hoping to be able to use it where the standard library streams are not available.

c42f commented 3 years ago

Sorry if the title misleads. However I think in this case, minimal is in the eye of the beholder. Some types of minimal I can think of include:

  1. Minimal build-time?
  2. Minimal lines of code?
  3. Minimal build configuration for user projects?
  4. Minimal new concepts for users? (eg, their existing types with operator<< defined will work without any extra effort)
  5. Minimal object size?
  6. Minimal binary dependencies (ie, no libstdc++) ?

I think this library does fairly well on 1-4. 5 could certainly be improved with separate compilation. 6 is not so good, as you point out.

But overall, the philosophy here is one of minimalism so I feel the summary is largely accurate.

c42f commented 3 years ago

or even decoupled the underlying "real-output" function and make this wrapper more abstract

Regardless of quibbles of terminology, this is a decent idea and could be worth pursuing. I don't have time to do it myself, however.