Hi. I am using boost::metaparse::string
for value-based metaprogramming.
For convenience, I created a macro for myself:
#ifdef BOOST_METAPARSE_MAKE_STRING
#error BOOST_METAPARSE_MAKE_STRING already defined
#endif
#define BOOST_METAPARSE_MAKE_STRING(S) (BOOST_METAPARSE_STRING(S){})
This macro allows me to write such statements succinctly and without unnecessary parentheses:
field<int, (name=BOOST_METAPARSE_MAKE_STRING("id"))> index;
field<std::string, (name=BOOST_METAPARSE_MAKE_STRING("user"))> username;
In modern C++(example above is C++17), the value-based metaprogramming approach is very often used. I believe that this macro will be useful not only for me. Why not add it to the library?