[libcxx-commits] [libcxx] 0a5ebc6 - [libc++] Remove a stray `const` on ranges::data and ranges::ssize. NFCI.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 7 11:00:39 PDT 2021


Author: Arthur O'Dwyer
Date: 2021-09-07T13:59:21-04:00
New Revision: 0a5ebc692b93f43c3b61e7571254f8c5e234597a

URL: https://github.com/llvm/llvm-project/commit/0a5ebc692b93f43c3b61e7571254f8c5e234597a
DIFF: https://github.com/llvm/llvm-project/commit/0a5ebc692b93f43c3b61e7571254f8c5e234597a.diff

LOG: [libc++] Remove a stray `const` on ranges::data and ranges::ssize. NFCI.

These are specced as `inline constexpr auto`; the extra `const`
isn't doing anything except being inconsistent with the other CPOs.
Now all the implemented CPOs can be detected by
    git grep 'inline constexpr auto.*fn' ../libcxx/include/
and I think that's beautiful.

Added: 
    

Modified: 
    libcxx/include/__ranges/data.h
    libcxx/include/__ranges/size.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__ranges/data.h b/libcxx/include/__ranges/data.h
index d850b69114bd2..8060dd558a948 100644
--- a/libcxx/include/__ranges/data.h
+++ b/libcxx/include/__ranges/data.h
@@ -68,7 +68,7 @@ namespace __data {
 } // end namespace __data
 
 inline namespace __cpo {
-  inline constexpr const auto data = __data::__fn{};
+  inline constexpr auto data = __data::__fn{};
 } // namespace __cpo
 } // namespace ranges
 

diff  --git a/libcxx/include/__ranges/size.h b/libcxx/include/__ranges/size.h
index c764a3dd7ce56..af0a8479f2eca 100644
--- a/libcxx/include/__ranges/size.h
+++ b/libcxx/include/__ranges/size.h
@@ -114,7 +114,7 @@ namespace __ssize {
 }
 
 inline namespace __cpo {
-  inline constexpr const auto ssize = __ssize::__fn{};
+  inline constexpr auto ssize = __ssize::__fn{};
 } // namespace __cpo
 } // namespace ranges
 


        


More information about the libcxx-commits mailing list