christophe.j.henry@gmail.com wrote:
I feel I have to slightly steer the review in the right (IMO) direction, which means in the direction where the review is based on the quality of the library and documentation, not on pure formalities.
I agree with your steering direction. So let me ask a question: how useful is this library in practice, beyond "toy examples"? Was this library developed with a real application, i.e. use in a product, as its motivation, or was it written to test the limits of what is possible using metaprogramming? My first reaction to the library was "cool!". My second reaction was "it's a toy to demonstrate metaprogramming". Then I saw the printf() example and my third (and for now final!) though is that, yes, this could be useful. In another thread, Peter Dimov asked about getting char packs from string literals. It seems to me that if we had that then we could implement printf() without needing a "parser library" at all: template <char c1, char... c> class formatter { public: template <typename... ARGS> void operator()(ARGS... args...) { std::cout << c1; formatter<c...>()(args...); } }; template <char... c> class formatter<'%','d',c...> { public: template <typename... ARGS> void operator()(int i, ARGS... args...) { std::cout << i; formatter<c...>()(args...); } }; template <char c1> class formatter<c1> { public: void operator()() { std::cout << c1; } }; int main() { formatter<'h','e','l','l','o','%','d','!'>()(42); } So maybe all that I really want is the preprocessor magic to turn string literals into something that's more useful at compile time. Or a language feature to do that. Or maybe somehow constexpr can do it all for me. Anyone have a constexpr implementation of printf()? Hmm. Cheers, Phil.