cpp/chrono/ambiguous local time

Defines a type of object to be thrown as exception to report that an attempt was made to convert an ambiguous std to a std without specifying a std (such as or ).

This exception is thrown by std and functions that call it (such as the constructors of std that take a std).

Member functions
{{member | {{small|std::chrono::ambiguous_local_time::}}ambiguous_local_time | 2= {{dcl begin}} {{dcl|num=1|since=c++20| template< class Duration > ambiguous_local_time( const std::chrono::local_time& tp,                     const std::chrono::local_info& i ); }} {{dcl|num=2|since=c++20| ambiguous_local_time( const ambiguous_local_time& other ) noexcept; }} {{dcl end}} Constructs the exception object.

@1@ The explanatory string returned by {{c|what}} is equivalent to that produced by {{c|os.str}} after the following code:

{{source|1= std::ostringstream os; os << tp << " is ambiguous. It could be\n" << tp << ' ' << i.first.abbrev << " == " << tp - i.first.offset << " UTC or\n" << tp << ' ' << i.second.abbrev << " == " << tp - i.second.offset << " UTC"; }}

@@ The behavior is undefined if {{c|1=i.result != std::chrono::local_info::ambiguous}}.

@2@ Copy constructor. If {{c|*this}} and {{tt|other}} both have dynamic type {{tt|std::chrono::ambiguous_local_time}} then {{c|1=std::strcmp(what, other.what) == 0}}.

Exceptions
May throw std