c42f / tinyformat

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

Wrapping support for constructor initialization lists #6

Closed c42f closed 11 years ago

c42f commented 11 years ago

It would be handy to be able to wrap constructors, so in particular we can easily write a MyError which extends from std::runtime_error and supports something like:

if (bar > barMax)
    throw MyError("foo failed because bar=%d is greater than %d", bar, barMax);

Granted, this is already possible in a roundabout way if you're happy to extend std::exception instead.

c42f commented 11 years ago

Done in what will soon be version 1.3