Patchwork [libstdc++-v3] Collapse redundant 'inline' from 'inline constexpr'.

login
register
mail settings
Submitter Ed Smith-Rowland
Date June 1, 2013, 9:26 p.m.
Message ID <51AA66FB.4010309@verizon.net>
Download mbox | patch
Permalink /patch/248089/
State New
Headers show

Comments

Ed Smith-Rowland - June 1, 2013, 9:26 p.m.
All,

Paolo Carlini pointed out that I introduced a number of 'inline 
constexpr' in my last std literals patch.
Section 7.1.5/2: "constexpr functions and constexpr constructors are 
implicitly inline (7.1.2).

I noticed that there are two other headers that have this.

Does anyone mind if i just clean this up?

Builds and tests clean on x86_64-linux.

Ed
2013-06-01  Ed Smith-Rowland  <3dw4rd@verizon.net>

	include/std/chrono: Collapse redundant 'inline' from 'inline constexpr'.
	include/std/tuple: Ditto.
	include/bits/move.h: Ditto.
Gabriel Dos Reis - June 1, 2013, 9:29 p.m.
please go ahead.

-- Gaby
Ed Smith-Rowland - June 1, 2013, 9:48 p.m.
On 06/01/2013 05:29 PM, Gabriel Dos Reis wrote:
> please go ahead.
>
> -- Gaby
>
Done.

Patch

Index: include/std/chrono
===================================================================
--- include/std/chrono	(revision 199584)
+++ include/std/chrono	(working copy)
@@ -819,12 +819,12 @@ 
 
   } // __detail
 
-  inline constexpr chrono::duration<long double, ratio<3600,1>>
+  constexpr chrono::duration<long double, ratio<3600,1>>
   operator"" h(long double __hours)
   { return chrono::duration<long double, ratio<3600,1>>{__hours}; }
 
   template <char... _Digits>
-    inline constexpr typename
+    constexpr typename
     __detail::_Select_type<__select_int::_Select_int<_Digits...>::value,
 			   chrono::hours>::type
     operator"" h()
@@ -834,12 +834,12 @@ 
 			chrono::hours>::value;
     }
 
-  inline constexpr chrono::duration<long double, ratio<60,1>>
+  constexpr chrono::duration<long double, ratio<60,1>>
   operator"" min(long double __mins)
   { return chrono::duration<long double, ratio<60,1>>{__mins}; }
 
   template <char... _Digits>
-    inline constexpr typename
+    constexpr typename
     __detail::_Select_type<__select_int::_Select_int<_Digits...>::value,
 			   chrono::minutes>::type
     operator"" min()
@@ -849,12 +849,12 @@ 
 			chrono::minutes>::value;
     }
 
-  inline constexpr chrono::duration<long double>
+  constexpr chrono::duration<long double>
   operator"" s(long double __secs)
   { return chrono::duration<long double>{__secs}; }
 
   template <char... _Digits>
-    inline constexpr typename
+    constexpr typename
     __detail::_Select_type<__select_int::_Select_int<_Digits...>::value,
 			   chrono::seconds>::type
     operator"" s()
@@ -864,12 +864,12 @@ 
 			chrono::seconds>::value;
     }
 
-  inline constexpr chrono::duration<long double, milli>
+  constexpr chrono::duration<long double, milli>
   operator"" ms(long double __msecs)
   { return chrono::duration<long double, milli>{__msecs}; }
 
   template <char... _Digits>
-    inline constexpr typename
+    constexpr typename
     __detail::_Select_type<__select_int::_Select_int<_Digits...>::value,
 			   chrono::milliseconds>::type
     operator"" ms()
@@ -879,12 +879,12 @@ 
 			chrono::milliseconds>::value;
     }
 
-  inline constexpr chrono::duration<long double, micro>
+  constexpr chrono::duration<long double, micro>
   operator"" us(long double __usecs)
   { return chrono::duration<long double, micro>{__usecs}; }
 
   template <char... _Digits>
-    inline constexpr typename
+    constexpr typename
     __detail::_Select_type<__select_int::_Select_int<_Digits...>::value,
 			   chrono::microseconds>::type
     operator"" us()
@@ -894,12 +894,12 @@ 
 			chrono::microseconds>::value;
     }
 
-  inline constexpr chrono::duration<long double, nano>
+  constexpr chrono::duration<long double, nano>
   operator"" ns(long double __nsecs)
   { return chrono::duration<long double, nano>{__nsecs}; }
 
   template <char... _Digits>
-    inline constexpr typename
+    constexpr typename
     __detail::_Select_type<__select_int::_Select_int<_Digits...>::value,
 			   chrono::nanoseconds>::type
     operator"" ns()
Index: include/std/tuple
===================================================================
--- include/std/tuple	(revision 199583)
+++ include/std/tuple	(working copy)
@@ -856,25 +856,25 @@ 
     }
 
   template<typename... _TElements, typename... _UElements>
-    inline constexpr bool
+    constexpr bool
     operator!=(const tuple<_TElements...>& __t,
 	       const tuple<_UElements...>& __u)
     { return !(__t == __u); }
 
   template<typename... _TElements, typename... _UElements>
-    inline constexpr bool
+    constexpr bool
     operator>(const tuple<_TElements...>& __t,
 	      const tuple<_UElements...>& __u)
     { return __u < __t; }
 
   template<typename... _TElements, typename... _UElements>
-    inline constexpr bool
+    constexpr bool
     operator<=(const tuple<_TElements...>& __t,
 	       const tuple<_UElements...>& __u)
     { return !(__u < __t); }
 
   template<typename... _TElements, typename... _UElements>
-    inline constexpr bool
+    constexpr bool
     operator>=(const tuple<_TElements...>& __t,
 	       const tuple<_UElements...>& __u)
     { return !(__t < __u); }
Index: include/bits/move.h
===================================================================
--- include/bits/move.h	(revision 199583)
+++ include/bits/move.h	(working copy)
@@ -116,7 +116,7 @@ 
    *  type is copyable, in which case an lvalue-reference is returned instead.
    */
   template<typename _Tp>
-    inline constexpr typename
+    constexpr typename
     conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
     move_if_noexcept(_Tp& __x) noexcept
     { return std::move(__x); }