std::chrono::nonexistent_local_time
来自cppreference.com
                    
                                        
                    
                    
                                                            
                    |   定义于头文件  <chrono>
  | 
||
|   class nonexistent_local_time;  | 
(C++20 起) | |
定义要作为异常抛出的对象类型,以报告试图转换不存在的 std::chrono::local_time 为 std::chrono::sys_time 而不指定 std::chrono::choose (如 choose::earliest 或 choose::latest )。
std::chrono::time_zone::to_sys 和调用它的函数(例如接收 std::chrono::zoned_time 的 std::chrono::local_time 构造函数)抛出此异常。
继承图
成员函数
|    (构造函数)  | 
  构造异常对象  (公开成员函数)  | 
|    operator=  | 
   替换异常对象  (公开成员函数)  | 
|    what  | 
   返回解释字符串  (公开成员函数)  | 
std::chrono::nonexistent_local_time::nonexistent_local_time
|   template< class Duration > nonexistent_local_time( const std::chrono::local_time<Duration>& tp,  | 
(1) | (C++20 起) | 
|   nonexistent_local_time( const nonexistent_local_time& other ) noexcept;  | 
(2) | (C++20 起) | 
构造异常对象。
1) 
what() 所返回的解释字符串等价于下列代码后 os.str() 所产生者:std::ostringstream os; os << tp << " is in a gap between\n" << std::chrono::local_seconds(i.first.end.time_since_epoch()) + i.first.offset << ' ' << i.first.abbrev << " and\n" << std::chrono::local_seconds(i.second.begin.time_since_epoch()) + i.second.offset << ' ' << i.second.abbrev << " which are both equivalent to\n" << i.first.end << " UTC";
 若 i.result != std::chrono::local_info::nonexistent 则行为未定义。
2) 复制构造函数。若 
*this 与 other 均拥有动态类型 std::chrono::nonexistent_local_time 则 std::strcmp(what(), other.what()) == 0 。参数
| tp | - | 试图转换的时间点 | 
| i | - | 描述转换尝试的结果的 std::chrono::local_info | 
| other | - |   要复制的另一 nonexistent_local_time
 | 
异常
可能抛出 std::bad_alloc
注解
因为不容许复制派生自 std::exception 的标准库类抛出异常,此信息通常在内部存储为分离分配的引用计数字符串。
std::chrono::nonexistent_locale_time::operator=
|   nonexistent_locale_time& operator=( const nonexistent_locale_time& other ) noexcept;  | 
(C++20 起) | |
以 other 的内容赋值。若 *this 与 other 均拥有动态类型 std::chrono::nonexistent_locale_time 则赋值后 std::strcmp(what(), other.what()) == 0 。
参数
| other | - | 用以赋值的另一异常对象 | 
返回值
*this
std::chrono::nonexistent_locale_time::what
|   virtual const char* what() const noexcept;  | 
(C++20 起) | |
返回解释字符串。
参数
(无)
返回值
指向有解释信息的空终止字符串的指针。该字符串适合转换并显示为 std::wstring 。保证该指针至少到获得它来源的异常对象被销毁,或在该异常对象上调用非 const 成员函数(例如复制赋值运算符)为止合法。
注解
允许但不要求实现覆写 what() 。
继承自 std::exception
成员函数
|    [虚]  | 
  析构该异常对象  ( std::exception 的虚公开成员函数)  | 
|    [虚]  | 
   返回解释性字符串  ( std::exception 的虚公开成员函数)  |