|
Boost : |
Subject: Re: [boost] [gsoc16] Can I quickly check if the below really is the best approach?
From: Nevin Liber (nevin_at_[hidden])
Date: 2016-01-13 13:56:54
On 13 January 2016 at 12:25, Lee Clagett <forum_at_[hidden]> wrote:
> The macro `STRING_VIEW` seems unnecessary because the `string_view`
> constructor taking a single NULL-terminated string is also
> `constexpr`.
>
While the templated constructor for basic_string_view is constexpr, this
constructor for string_view cannot be used in a constexpr context because
char_traits<char>::length isn't constexpr. :-( See LWG 2232
<http://cplusplus.github.io/LWG/lwg-active.html#2232>.
I've been told it works this way by design...
So yes, we do need the macro.
-- Nevin ":-)" Liber <mailto:nevin_at_[hidden] <nevin_at_[hidden]>> +1-847-691-1404
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk