From 4ef96efa94f5a3982f2ade843ab1b74f9f758166 Mon Sep 17 00:00:00 2001
From: Howard Hinnant
-The
Effects: If this is the first access to the database, will
initialize the database. If this call initializes the database, the
-resulting database will be a
Returns: A reference to the database.
@@ -9211,6 +9228,77 @@ const time_zone* current_zone();
+Returns:
+Remarks: this operation is thread safe with respect to
+Requires: The iterator following
+Effects: Erases the
+Returns: An iterator pointing to the element following the one that was erased,
+or
+Remarks: No pointers, references or iterators are invalidated except those referring
+to the erased
+Note: It is not possible to erase the
Howard E. Hinnant
-2017-07-27
+2017-08-12
Extending
@@ -61,8 +61,8 @@ Document number: D0355R4<chrono>
to Calendars and Time Zones
weekday_indexed
a defaulted default constructor.from_stream
and to_stream
customization points.list<tzdb>
-instead of a single tzdb
.tzdb
with
+an atomic head pointer, instead of a single tzdb
.string_view
.list<tzdb>
database is a singleton. Access is
+The tzdb_list
database is a singleton. Access is
granted to it via the get_tzdb_list()
function which
returns a reference to it. However this access is only needed for
those applications which need to have long uptimes and have a need to
@@ -9121,9 +9138,9 @@ implicitly access the front()
of this list via the
read-only namespace scope functions get_tzdb()
,
locate_zone()
and current_zone()
. Each
vector
in tzdb
is sorted to enable fast
-lookup. You can iterate over and inspect this database. And even
-hold multiple versions of the database at once, via the
-list<tzdb>
.
+lookup. One can iterate over and inspect this database. And
+multiple versions of the database can be used at once, via the
+tzdb_list
.
@@ -9164,8 +9181,8 @@ list<tzdb>& get_tzdb_list();
list<tzdb>
with
-size() == 1
.
+resulting database will be a tzdb_list
which holds a
+single initialized tzdb
.
tzdb_list::const_iterator
is a non-mutating iterator which meets the
+forward iterator requirements.
+
+
+const tzdb& tzdb_list::front() const noexcept;
+
+
+
+
+*head_
.
+reload_tzdb()
.
+[Note: reload_tzdb()
pushes a new tzdb
onto the front
+of this container. — end note]
+
+tzdb::const_iterator tzdb::erase_after(const_iterator p) noexcept;
+
+
+
+
+p
is dereferenceable.
+tzdb
referred to by the iterator following
+p
.
+end()
if no such element exists.
+tzdb
.
+tzdb
referred to by
+begin()
.
+
+tzdb::const_iterator tzdb::begin() const noexcept;
+
+
+Returns: An iterator referring to the first
+
+tzdb
in the container.
+
+tzdb::const_iterator tzdb::end() const noexcept;
+
+
+Returns: An iterator referring to the position one past the
+last
+
+tzdb
in the container.
+
+tzdb::const_iterator tzdb::cbegin() const noexcept;
+
+
+Returns:
+
+begin()
.
+
+tzdb::const_iterator tzdb::cend() const noexcept;
+
+
+Returns:
+
@@ -9232,15 +9320,17 @@ const tzdb& reload_tzdb();
latest version is already installed, there are no effects. Otherwise, a new version
is available. It is downloaded and installed, and then the program initializes
a new end()
.
+tzdb
from the new disk files and pushes it to the front of
-the list<tzdb>&
accessed by get_tzdb_list()
.
+the tzdb_list
accessed by get_tzdb_list()
.
Returns: get_tzdb_list().front()
.
-Thread Safety: This function is not thread safe. You must -provide your own synchronization among threads accessing the time zone database -to safely use this function. +Remarks: No pointers, references or iterators are invalidated. +
+
+Thread Safety: This function is thread safe with respect to front()
+and erase_after()
.
Throws: runtime_error
if for any reason a reference can not