Bewerken

Delen via


tzdb_list class

A list of time zone databases.

Syntax

class tzdb_list; // C++20

Remarks

You can't construct a tzdb_list. To get one, call get_tzdb_list().

You can't use copy assignment with a tzdb_list as operator= is deleted.

tzdb_list is a singleton.

Member functions

Function Description
begin, cbegin Get an iterator to the start of the list of tzdb objects.
end, cend Get an iterator past the end of the list of tzdb objects.
erase_after Erase the tzdb that immediately follows the element pointed to by the passed in iterator.
front Get the first element in the list of tzdb objects.

Member types

Member type Description
class const_iterator A constant iterator of type tzdb.

begin, cbegin

Gets an iterator that points to the start of the list.

const_iterator begin() const noexcept; // C++20
const_iterator cbegin() const noexcept; // C++20

Return value

An iterator pointing to the first tzdb in the list.

end, cend

Get an iterator past the end of the list.

const_iterator end() const noexcept; // C++20
const_iterator cend() const noexcept; // C++20)

Return value

An iterator pointing past the end of the last tzdb in the list.

Remarks

Because the returned iterator points past the end of the list, it shouldn't be dereferenced. Instead, use it to compare when you've reached the end of the list.

front

Gets the first tzdb in the list.

const tzdb& front() const noexcept; // C++20

Return value

The first time zone database in the list.

Remarks

You can simultaneously call this function and reload_tzdb without risk of a race condition.

erase_after

Erase the tzdb that follows the element pointed to by the passed-in iterator.

const_iterator erase_after(const_iterator p);

Parameters

p
An iterator that points to the element before the one to erase.

Return value

An iterator following the erased tzdb. If there isn't an element following the erased tzdb, then end()

Remarks

It isn't possible to erase the first element in the list.

Requirements

Header: <chrono>

Namespace: std::chrono

Compiler Option: /std:c++latest

See also

<chrono>
tzdb struct
Header Files Reference