Boost logo

Boost Users :

Subject: Re: [Boost-users] compile-time string literal manipulation?
From: TONGARI (tongari95_at_[hidden])
Date: 2010-10-28 10:50:29


2010/10/28, Stiles Watson <watson_at_[hidden]>:
> Question. For the example given at the link above, it has
>
> typedef mpl::string<'hell','o wo','rld'> hello;
>
> Why would it not be
>
> typedef mpl::string<'h','e','l','l','o',' ','w','o','r','l','d'> hello;
>
> OR if the example is correct, why could you not simply do
>
> typedef mpl::string<'hello world'> hello;

Note that they are multi-character character constants (in single
quote), not strings (in quotes), and multi-character character may
have at most the size of int, so you cannot have a single 'hello
world'.


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