Re:Typo: A programming language that runs in Haskell's type ...
by swift on Wednesday August 07, 2013 @10:12PM
(#6176961)
Post-C++11 you can work with strings at compile-time using constexpr template functions. IIRC you need something along the lines of this:
> template <size_t N> constexpr foo(const char str[N]) { ... }
The fact that constexpr strings can't be template parameters boggles the mind.
It's a shame that C++ lacks proper support for compile-time strings, but it would be trivial to write a preprocessor turning a string into a list of char literals.