2010/10/28 Ovanes Markarian <om_boost@keywallet.com>


On Thu, Oct 28, 2010 at 1:41 AM, Eric Niebler <eric@boostpro.com> wrote:

You might find the interface less than ideal. C++ doesn't allow strings
as template parameters.

--
Eric Niebler
BoostPro Computing
http://www.boostpro.com

Hi Eric,

just a question: It is possible to pass array objects with external linkage as template parameters, is there any way one can manipulate them at compile time? I am wondering, if one can pass begin and end iterator as template parameters and verify such a string. That might have real impact on compile time...

If I can use such a function:
tempalte<size_t N>
void array_len(char (&arr)[])
{}

I might be able to pass instantiated function template function to the template to calculate the string length and than I have begin and length of the string, and can apply recusion at compile time. What do you think about it?

You can access the pointer at compile time but not the characters. So you indeed can have 'begin' and 'length', but accessing the content at compile time is still impossible.

Roman Perepelitsa.