Boost logo

Boost Users :

Subject: Re: [Boost-users] compile-time string literal manipulation?
From: Cromwell Enage (sponage_at_[hidden])
Date: 2010-10-29 12:04:55


> Question. For the example given at the link above, it has
>
> typedef mpl::string<'hell','o wo','rld'> hello;

That's weird.

> Why would it not be
>
> typedef mpl::string<'h','e','l','l','o',
> ' ','w','o','r','l','d'> hello;
>

I would think this was correct, as well.

> OR if the example is correct, why could you not simply do
>
> typedef mpl::string<'hello world'> hello;

Non-type template arguments can only be constant integers or (maybe in this case) multi-byte characters. A four-byte character value might be the standard limit here. (To be honest, I haven't really worked with Unicode or anything else beyond one-byte characters. Someone else may have a better answer for you.)

Cromwell D. Enage

      


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