
Hi Roland, On 2015-06-07 11:07, Roland Bock wrote:
FWIW, sqlpp11 also uses char packs to represent and being able to compare strings at runtime. It is used like this (full example is attached, requires c++14, won't work with current MSVC-2015RC):
struct A { static constexpr const char _literal[] = "delta"; using name_t = sqlpp::make_char_sequence
; };
It looks like you managed to use a char array as a template argument. I don't know how sqlpp uses these strings, however, if the same could be achieved in Metaparse, I'd definitely try carrying the char array reference/pointer around and write "smart" getter functions (front, pop_front, equal_to etc) around it and check if it really makes things faster and lower the memory consumption - I'd expect it to do so.
Thus, while I assume that it is faster than what happens inside the MPLLIBS_STRING (haven't measured it), its use is more limited, too. The main limit here (from Metaparse's perspective) is that you need to define the string (separately) before you can use it.
Regards, Ábel