Boost logo

Boost :

Subject: Re: [boost] Compile Time String in C++11/C++14
From: Adam Wulkiewicz (adam.wulkiewicz_at_[hidden])
Date: 2014-08-26 10:21:42


Adam Wulkiewicz wrote:
> Tongari J wrote:
>> 2014-08-26 19:43 GMT+08:00 Adam Wulkiewicz <adam.wulkiewicz_at_[hidden]>:
>>
>>> Tongari J wrote:
>>>
>>>> Hi Louis,
>>>>
>>>> 2014-08-26 0:01 GMT+08:00 Louis Dionne <ldionne.2_at_[hidden]>:
>>>>
>>>>> This is genius, thanks a lot for posting. I've been searching for a
>>>>> way to do this to implement compile-time strings in Boost.Hana[1].
>>>>>
>>>>> Glad to hear :)
>>>> Actually I've found an even simpler way:
>>>>
>>> Nice! And with some small tweaks it works in C++11, assuming you
>>> have some
>>> implementation of index_sequence:
>>>
>> I believe this still requires C++14 for returning the local struct in
>> lambda, which is not a one-liner.
>
> I'm not that well versed in the ways of the standard but I do know
> that it compiles in GCC 4.8.1, 4.8.3, 4.9.1 and clang 3.4 with
> -std=c++11 switch. So either those compilers are buggy or C++14 isn't
> really required.
> As said before MSVC2013 complains about something else.

Actually besides the complaining about static data member in local
struct (get() member function) MSVC2013 indeed complains about the
returning of local struct. AFAIU all of the presented implementations
should fail on this compiler.

Regards,
Adam


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk