diff mbox

Make the string_view literal operators constexpr like the ctors they call.

Message ID 53D1D3F3.1050907@verizon.net
State New
Headers show

Commit Message

Ed Smith-Rowland July 25, 2014, 3:50 a.m. UTC
On 03/08/2014 01:33 PM, Jonathan Wakely wrote:
> On 8 March 2014 16:29, Ed Smith-Rowland wrote:
>> On 03/08/2014 11:27 AM, Ed Smith-Rowland wrote:
>>> The title says it all.  This was just an oversight in the original patch.
>>>
>>> This could wait until stage 1 obviously.  I just wanted to post it.
>>>
>>> There are a lot of post-Issaquah constexpr changes but these will have to
>>> wait for front-end support for C++14 constexpr.
>>>
>>> Builds and tests clean on x86_64-linux.
>>>
>>> OK?
> OK for stage 1, but not now.  (And please remember to CC gcc-patches)
>
I had completely forgotten about this until now.

Rebased, retested, committed.

Ed
2014-07-25  Ed Smith-Rowland  <3dw4rd@verizon.net>

	* include/experimental/string_view: Make the literal operators
	constexpr like the ctors they call.

Comments

Jonathan Wakely July 25, 2014, 8:54 a.m. UTC | #1
On 25 July 2014 04:50, Ed Smith-Rowland <3dw4rd@verizon.net> wrote:
> On 03/08/2014 01:33 PM, Jonathan Wakely wrote:
>>
>> On 8 March 2014 16:29, Ed Smith-Rowland wrote:
>>>
>>> On 03/08/2014 11:27 AM, Ed Smith-Rowland wrote:
>>>>
>>>> The title says it all.  This was just an oversight in the original
>>>> patch.
>>>>
>>>> This could wait until stage 1 obviously.  I just wanted to post it.
>>>>
>>>> There are a lot of post-Issaquah constexpr changes but these will have
>>>> to
>>>> wait for front-end support for C++14 constexpr.
>>>>
>>>> Builds and tests clean on x86_64-linux.
>>>>
>>>> OK?
>>
>> OK for stage 1, but not now.  (And please remember to CC gcc-patches)
>>
> I had completely forgotten about this until now.
>
> Rebased, retested, committed.


Nice, thanks.
diff mbox

Patch

Index: include/experimental/string_view
===================================================================
--- include/experimental/string_view	(revision 212967)
+++ include/experimental/string_view	(working copy)
@@ -664,22 +664,22 @@ 
   inline namespace string_view_literals
   {
 
-    inline basic_string_view<char>
+    inline constexpr basic_string_view<char>
     operator""sv(const char* __str, size_t __len)
     { return basic_string_view<char>{__str, __len}; }
 
 #ifdef _GLIBCXX_USE_WCHAR_T
-    inline basic_string_view<wchar_t>
+    inline constexpr basic_string_view<wchar_t>
     operator""sv(const wchar_t* __str, size_t __len)
     { return basic_string_view<wchar_t>{__str, __len}; }
 #endif
 
 #ifdef _GLIBCXX_USE_C99_STDINT_TR1
-    inline basic_string_view<char16_t>
+    inline constexpr basic_string_view<char16_t>
     operator""sv(const char16_t* __str, size_t __len)
     { return basic_string_view<char16_t>{__str, __len}; }
 
-    inline basic_string_view<char32_t>
+    inline constexpr basic_string_view<char32_t>
     operator""sv(const char32_t* __str, size_t __len)
     { return basic_string_view<char32_t>{__str, __len}; }
 #endif