1616// Enable the contents of the header only when libc++ was built with experimental features enabled.
1717#if !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
1818
19- # include < __chrono/time_zone_types.h>
2019# include < __compare/strong_order.h>
2120# include < __config>
22- # include < string >
21+ # include < __memory/unique_ptr.h >
2322# include < string_view>
24- # include < vector>
2523
2624# if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
2725# pragma GCC system_header
2826# endif
2927
28+ _LIBCPP_PUSH_MACROS
29+ # include < __undef_macros>
30+
3031_LIBCPP_BEGIN_NAMESPACE_STD
3132
3233# if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_HAS_NO_TIME_ZONE_DATABASE) && !defined(_LIBCPP_HAS_NO_FILESYSTEM) && \
@@ -36,21 +37,17 @@ namespace chrono {
3637
3738class _LIBCPP_AVAILABILITY_TZDB time_zone {
3839public:
39- explicit _LIBCPP_HIDE_FROM_ABI time_zone (string&& __name) : __name_(std::move(__name)) {}
40+ class __impl ; // public so it can be used by make_unique.
41+ _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI explicit time_zone (unique_ptr<__impl>&& __p);
42+ _LIBCPP_EXPORTED_FROM_ABI ~time_zone ();
4043
41- _LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI string_view name () const noexcept { return __name_; }
44+ time_zone (time_zone&&) = default ;
45+ time_zone& operator =(time_zone&&) = default ;
4246
43- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI vector<__tz::__continuation>& __continuations () { return __continuations_; }
44- [[nodiscard]] _LIBCPP_HIDE_FROM_ABI const vector<__tz::__continuation>& __continuations () const {
45- return __continuations_;
46- }
47+ _LIBCPP_NODISCARD_EXT _LIBCPP_EXPORTED_FROM_ABI string_view name () const noexcept ;
4748
4849private:
49- string __name_;
50- // Note the first line has a name + __continuation, the other lines
51- // are just __continuations. So there is always at least one item in
52- // the vector.
53- vector<__tz::__continuation> __continuations_;
50+ unique_ptr<__impl> __impl_;
5451};
5552
5653_LIBCPP_NODISCARD_EXT _LIBCPP_AVAILABILITY_TZDB _LIBCPP_HIDE_FROM_ABI inline bool
@@ -70,6 +67,8 @@ operator<=>(const time_zone& __x, const time_zone& __y) noexcept {
7067
7168_LIBCPP_END_NAMESPACE_STD
7269
70+ _LIBCPP_POP_MACROS
71+
7372#endif // !defined(_LIBCPP_HAS_NO_INCOMPLETE_TZDB)
7473
7574#endif // _LIBCPP___CHRONO_TIME_ZONE_H
0 commit comments