Boost logo

Boost :

Subject: Re: [boost] compile time parser generator
From: Simonson, Lucanus J (lucanus.j.simonson_at_[hidden])
Date: 2012-01-08 23:30:36


From: Dave Abrahams
>> So the question is, is there any way to get from a literal string to
>> an MPL list of literal char for each character.
>Nope.
>constexpr is somewhat crippled: although a constexpr function executes
>at compile-time, it has to obey the same rules as any other function.
>For example, its return type can depend on the type, but never on the
>*value*, of its arguments, and once you're inside the function, the
>contents of the argument are not treated as compile-time constants.
>So, I think constexpr actually doesn't promise it.

Well, there goes all my excitement. How then would the original proposal by Martin to use constexpr to "parse strings in C++ at compile time" work? You and Eric seemed to know what Marin had in mind and agree that a constexper string-based regex library was feasible, though differed on whether it was worthwhile. What am I missing?

I was afraid of thatly yours,
Luke


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk