Boost logo

Boost Users :

Subject: Re: [Boost-users] mpl::c_str<mpl::string<>> compile error
From: Olaf Peter (ope-devel_at_[hidden])
Date: 2013-05-07 01:44:30


> Have you tried:
>
> typedef mpl::string<'hell','o wo','rld'>::type
> my_hello;
>
> ? BOOST_MPL_LIMIT_STRING_SIZE is a count of "characters" in the
> mpl::string, which is 4X the number of template parameters, since
> mpl::string uses multi-character literals to pack 4 characters into an int.

Thanks, Eric. This is from the examples and works. But there rises the
question how to use slightly longer mpl strings. Further more, using
this emits a compiler warning about multichar literal (or similar) on
gcc. Generally disabling this warning may prevent detection of issues on
other places.

A similar compile problem I have with

typedef mpl::char<'A'>::type my_A;

int main()
{
     std::cout << mpl::c_str<my_A>::value << '\n';
}

but I haven't a compiler at the hand here.

Thanks,
Olaf


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