[libcxx-commits] [PATCH] D112072: [libc++] Make __weekday_from_days private in weekday

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 19 06:48:39 PDT 2021


jloser created this revision.
jloser added reviewers: ldionne, Quuxplusone, Mordante.
jloser requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

`weekday` has a static member function `__weekday_from_days` which is
not part of the mandated public interface of `weeekday` according to the
standard. Since it is only used internally in the constructors of
`weekday`, let's make it private.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D112072

Files:
  libcxx/include/chrono


Index: libcxx/include/chrono
===================================================================
--- libcxx/include/chrono
+++ libcxx/include/chrono
@@ -1839,6 +1839,7 @@
 class weekday {
 private:
     unsigned char __wd;
+    static constexpr unsigned char __weekday_from_days(int __days) noexcept;
 public:
   weekday() = default;
   inline explicit constexpr weekday(unsigned __val) noexcept : __wd(static_cast<unsigned char>(__val == 7 ? 0 : __val)) {}
@@ -1858,9 +1859,6 @@
   inline constexpr bool ok() const noexcept { return __wd <= 6; }
          constexpr weekday_indexed operator[](unsigned __index) const noexcept;
          constexpr weekday_last    operator[](last_spec) const noexcept;
-
-  // TODO: Make private?
-  static constexpr unsigned char __weekday_from_days(int __days) noexcept;
 };
 
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D112072.380678.patch
Type: text/x-patch
Size: 814 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211019/48550b39/attachment-0001.bin>


More information about the libcxx-commits mailing list