Boost logo

Boost Users :

Subject: Re: [Boost-users] compile-time string literal manipulation?
From: Ovanes Markarian (om_boost_at_[hidden])
Date: 2010-10-28 03:51:37


On Thu, Oct 28, 2010 at 1:41 AM, Eric Niebler <eric_at_[hidden]> 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?

With Kind Regards,
Ovanes



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net