This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] libstdc++/67078 change _N bad name in new container access functions


We can't use _N as an identifier, as per
https://gcc.gnu.org/onlinedocs/libstdc++/manual/source_code_style.html

Tested ppc64le-linux, committed to trunk.

commit ae65b96cfb69c64d636f86d9f9154da2364e0440
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Mon Aug 3 16:29:44 2015 +0100

    	PR libstdc++/67078
    	* include/bits/range_access.h (size, empty, data): Fix _N bad name.

diff --git a/libstdc++-v3/include/bits/range_access.h b/libstdc++-v3/include/bits/range_access.h
index 2a10598..586d162 100644
--- a/libstdc++-v3/include/bits/range_access.h
+++ b/libstdc++-v3/include/bits/range_access.h
@@ -237,10 +237,10 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @brief  Return the size of an array.
    *  @param  __array  Array.
    */
-  template <typename _Tp, size_t _N>
+  template <typename _Tp, size_t _Nm>
     constexpr size_t
-    size(const _Tp (&/*__array*/)[_N]) noexcept
-    { return _N; }
+    size(const _Tp (&/*__array*/)[_Nm]) noexcept
+    { return _Nm; }
 
   /**
    *  @brief  Return whether a container is empty.
@@ -255,9 +255,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @brief  Return whether an array is empty (always false).
    *  @param  __array  Container.
    */
-  template <typename _Tp, size_t _N>
+  template <typename _Tp, size_t _Nm>
     constexpr bool
-    empty(const _Tp (&/*__array*/)[_N]) noexcept
+    empty(const _Tp (&/*__array*/)[_Nm]) noexcept
     { return false; }
 
   /**
@@ -291,9 +291,9 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
    *  @brief  Return the data pointer of an array.
    *  @param  __array  Array.
    */
-  template <typename _Tp, size_t _N>
+  template <typename _Tp, size_t _Nm>
     constexpr _Tp*
-    data(_Tp (&__array)[_N]) noexcept
+    data(_Tp (&__array)[_Nm]) noexcept
     { return __array; }
 
   /**

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]