forked from OSchip/llvm-project
[libc++] Make the naming of private member variables consistent and enforce it through readability-identifier-naming
Reviewed By: ldionne, #libc Spies: aheejin, sstefan1, libcxx-commits Differential Revision: https://reviews.llvm.org/D129386
This commit is contained in:
parent
3c355e2881
commit
84fc2c3cd6
|
@ -39,6 +39,12 @@ CheckOptions:
|
|||
value: lower_case
|
||||
- key: readability-identifier-naming.ParameterPrefix
|
||||
value: __
|
||||
- key: readability-identifier-naming.PrivateMemberCase
|
||||
value: lower_case
|
||||
- key: readability-identifier-naming.PrivateMemberPrefix
|
||||
value: __
|
||||
- key: readability-identifier-naming.PrivateMemberSuffix
|
||||
value: _
|
||||
|
||||
# TODO: investigate these checks
|
||||
# bugprone-branch-clone,
|
||||
|
|
|
@ -31,9 +31,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
class _LIBCPP_TYPE_VIS __libcpp_debug_randomizer {
|
||||
public:
|
||||
__libcpp_debug_randomizer() {
|
||||
__state = __seed();
|
||||
__inc = __state + 0xda3e39cb94b95bdbULL;
|
||||
__inc = (__inc << 1) | 1;
|
||||
__state_ = __seed();
|
||||
__inc_ = __state_ + 0xda3e39cb94b95bdbULL;
|
||||
__inc_ = (__inc_ << 1) | 1;
|
||||
}
|
||||
typedef uint_fast32_t result_type;
|
||||
|
||||
|
@ -41,8 +41,8 @@ public:
|
|||
static const result_type _Max = 0xFFFFFFFF;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI result_type operator()() {
|
||||
uint_fast64_t __oldstate = __state;
|
||||
__state = __oldstate * 6364136223846793005ULL + __inc;
|
||||
uint_fast64_t __oldstate = __state_;
|
||||
__state_ = __oldstate * 6364136223846793005ULL + __inc_;
|
||||
return __oldstate >> 32;
|
||||
}
|
||||
|
||||
|
@ -50,8 +50,8 @@ public:
|
|||
static _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR result_type max() { return _Max; }
|
||||
|
||||
private:
|
||||
uint_fast64_t __state;
|
||||
uint_fast64_t __inc;
|
||||
uint_fast64_t __state_;
|
||||
uint_fast64_t __inc_;
|
||||
_LIBCPP_HIDE_FROM_ABI static uint_fast64_t __seed() {
|
||||
#ifdef _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED
|
||||
return _LIBCPP_DEBUG_RANDOMIZE_UNSPECIFIED_STABILITY_SEED;
|
||||
|
|
|
@ -36,7 +36,7 @@ template <class _Gen>
|
|||
class _ClassicGenAdaptor {
|
||||
private:
|
||||
// The generator is not required to be copyable or movable, so it has to be stored as a reference.
|
||||
_Gen& __gen;
|
||||
_Gen& __gen_;
|
||||
|
||||
public:
|
||||
using result_type = invoke_result_t<_Gen&>;
|
||||
|
@ -47,10 +47,10 @@ public:
|
|||
static constexpr auto max() { return __uncvref_t<_Gen>::max(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen(__g) {}
|
||||
constexpr explicit _ClassicGenAdaptor(_Gen& __g) : __gen_(__g) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr auto operator()() const { return __gen(); }
|
||||
constexpr auto operator()() const { return __gen_(); }
|
||||
};
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
|
|
@ -27,18 +27,18 @@ namespace chrono
|
|||
|
||||
class day {
|
||||
private:
|
||||
unsigned char __d;
|
||||
unsigned char __d_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI day() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d(static_cast<unsigned char>(__val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++() noexcept { ++__d; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr day(unsigned __val) noexcept : __d_(static_cast<unsigned char>(__val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr day& operator++() noexcept { ++__d_; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr day operator++(int) noexcept { day __tmp = *this; ++(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr day& operator--() noexcept { --__d; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr day& operator--() noexcept { --__d_; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr day operator--(int) noexcept { day __tmp = *this; --(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr day& operator+=(const days& __dd) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr day& operator-=(const days& __dd) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d >= 1 && __d <= 31; }
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __d_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __d_ >= 1 && __d_ <= 31; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -57,33 +57,33 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI constexpr hh_mm_ss() noexcept : hh_mm_ss{_Duration::zero()} {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr explicit hh_mm_ss(_Duration __d) noexcept :
|
||||
__is_neg(__d < _Duration(0)),
|
||||
__h(duration_cast<chrono::hours> (abs(__d))),
|
||||
__m(duration_cast<chrono::minutes>(abs(__d) - hours())),
|
||||
__s(duration_cast<chrono::seconds>(abs(__d) - hours() - minutes())),
|
||||
__f(duration_cast<precision> (abs(__d) - hours() - minutes() - seconds()))
|
||||
__is_neg_(__d < _Duration(0)),
|
||||
__h_(duration_cast<chrono::hours> (abs(__d))),
|
||||
__m_(duration_cast<chrono::minutes>(abs(__d) - hours())),
|
||||
__s_(duration_cast<chrono::seconds>(abs(__d) - hours() - minutes())),
|
||||
__f_(duration_cast<precision> (abs(__d) - hours() - minutes() - seconds()))
|
||||
{}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool is_negative() const noexcept { return __is_neg; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours() const noexcept { return __h; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr precision subseconds() const noexcept { return __f; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool is_negative() const noexcept { return __is_neg_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::hours hours() const noexcept { return __h_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes minutes() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds seconds() const noexcept { return __s_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr precision subseconds() const noexcept { return __f_; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr precision to_duration() const noexcept
|
||||
{
|
||||
auto __dur = __h + __m + __s + __f;
|
||||
return __is_neg ? -__dur : __dur;
|
||||
auto __dur = __h_ + __m_ + __s_ + __f_;
|
||||
return __is_neg_ ? -__dur : __dur;
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr explicit operator precision() const noexcept { return to_duration(); }
|
||||
|
||||
private:
|
||||
bool __is_neg;
|
||||
chrono::hours __h;
|
||||
chrono::minutes __m;
|
||||
chrono::seconds __s;
|
||||
precision __f;
|
||||
bool __is_neg_;
|
||||
chrono::hours __h_;
|
||||
chrono::minutes __m_;
|
||||
chrono::seconds __s_;
|
||||
precision __f_;
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool is_am(const hours& __h) noexcept { return __h >= hours( 0) && __h < hours(12); }
|
||||
|
|
|
@ -27,18 +27,18 @@ namespace chrono
|
|||
|
||||
class month {
|
||||
private:
|
||||
unsigned char __m;
|
||||
unsigned char __m_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI month() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m(static_cast<unsigned char>(__val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { ++__m; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr month(unsigned __val) noexcept : __m_(static_cast<unsigned char>(__val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr month& operator++() noexcept { ++__m_; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr month operator++(int) noexcept { month __tmp = *this; ++(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--() noexcept { --__m; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr month& operator--() noexcept { --__m_; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr month operator--(int) noexcept { month __tmp = *this; --(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr month& operator+=(const months& __m1) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr month& operator-=(const months& __m1) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m >= 1 && __m <= 12; }
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator unsigned() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_ >= 1 && __m_ <= 12; }
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -27,14 +27,14 @@ namespace chrono
|
|||
|
||||
class month_weekday {
|
||||
private:
|
||||
chrono::month __m;
|
||||
chrono::weekday_indexed __wdi;
|
||||
chrono::month __m_;
|
||||
chrono::weekday_indexed __wdi_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr month_weekday(const chrono::month& __mval, const chrono::weekday_indexed& __wdival) noexcept
|
||||
: __m{__mval}, __wdi{__wdival} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok() && __wdi.ok(); }
|
||||
: __m_{__mval}, __wdi_{__wdival} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdi_.ok(); }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
@ -63,14 +63,14 @@ month_weekday operator/(const weekday_indexed& __lhs, int __rhs) noexcept
|
|||
|
||||
|
||||
class month_weekday_last {
|
||||
chrono::month __m;
|
||||
chrono::weekday_last __wdl;
|
||||
chrono::month __m_;
|
||||
chrono::weekday_last __wdl_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr month_weekday_last(const chrono::month& __mval, const chrono::weekday_last& __wdlval) noexcept
|
||||
: __m{__mval}, __wdl{__wdlval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok() && __wdl.ok(); }
|
||||
: __m_{__mval}, __wdl_{__wdlval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok() && __wdl_.ok(); }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
|
|
@ -29,26 +29,26 @@ namespace chrono
|
|||
|
||||
class month_day {
|
||||
private:
|
||||
chrono::month __m;
|
||||
chrono::day __d;
|
||||
chrono::month __m_;
|
||||
chrono::day __d_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI month_day() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr month_day(const chrono::month& __mval, const chrono::day& __dval) noexcept
|
||||
: __m{__mval}, __d{__dval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d; }
|
||||
: __m_{__mval}, __d_{__dval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
bool month_day::ok() const noexcept
|
||||
{
|
||||
if (!__m.ok()) return false;
|
||||
const unsigned __dval = static_cast<unsigned>(__d);
|
||||
if (!__m_.ok()) return false;
|
||||
const unsigned __dval = static_cast<unsigned>(__d_);
|
||||
if (__dval < 1 || __dval > 31) return false;
|
||||
if (__dval <= 29) return true;
|
||||
// Now we've got either 30 or 31
|
||||
const unsigned __mval = static_cast<unsigned>(__m);
|
||||
const unsigned __mval = static_cast<unsigned>(__m_);
|
||||
if (__mval == 2) return false;
|
||||
if (__mval == 4 || __mval == 6 || __mval == 9 || __mval == 11)
|
||||
return __dval == 30;
|
||||
|
@ -87,12 +87,12 @@ month_day operator/(const day& __lhs, int __rhs) noexcept
|
|||
|
||||
class month_day_last {
|
||||
private:
|
||||
chrono::month __m;
|
||||
chrono::month __m_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI explicit constexpr month_day_last(const chrono::month& __val) noexcept
|
||||
: __m{__val} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m.ok(); }
|
||||
: __m_{__val} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __m_.ok(); }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
|
|
@ -32,25 +32,25 @@ class weekday_last;
|
|||
|
||||
class weekday {
|
||||
private:
|
||||
unsigned char __wd;
|
||||
unsigned char __wd_;
|
||||
_LIBCPP_HIDE_FROM_ABI static constexpr unsigned char __weekday_from_days(int __days) noexcept;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI weekday() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd(static_cast<unsigned char>(__val == 7 ? 0 : __val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(unsigned __val) noexcept : __wd_(static_cast<unsigned char>(__val == 7 ? 0 : __val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday(const sys_days& __sysd) noexcept
|
||||
: __wd(__weekday_from_days(__sysd.time_since_epoch().count())) {}
|
||||
: __wd_(__weekday_from_days(__sysd.time_since_epoch().count())) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr weekday(const local_days& __locd) noexcept
|
||||
: __wd(__weekday_from_days(__locd.time_since_epoch().count())) {}
|
||||
: __wd_(__weekday_from_days(__locd.time_since_epoch().count())) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator++() noexcept { __wd = (__wd == 6 ? 0 : __wd + 1); return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator++() noexcept { __wd_ = (__wd_ == 6 ? 0 : __wd_ + 1); return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator++(int) noexcept { weekday __tmp = *this; ++(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator--() noexcept { __wd = (__wd == 0 ? 6 : __wd - 1); return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday& operator--() noexcept { __wd_ = (__wd_ == 0 ? 6 : __wd_ - 1); return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday operator--(int) noexcept { weekday __tmp = *this; --(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr weekday& operator+=(const days& __dd) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr weekday& operator-=(const days& __dd) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding() const noexcept { return __wd; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd == 0u ? 7 : __wd; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd <= 6; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned c_encoding() const noexcept { return __wd_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned iso_encoding() const noexcept { return __wd_ == 0u ? 7 : __wd_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_ <= 6; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr weekday_indexed operator[](unsigned __index) const noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr weekday_last operator[](last_spec) const noexcept;
|
||||
};
|
||||
|
@ -123,15 +123,15 @@ weekday& weekday::operator-=(const days& __dd) noexcept
|
|||
|
||||
class weekday_indexed {
|
||||
private:
|
||||
chrono::weekday __wd;
|
||||
unsigned char __idx;
|
||||
chrono::weekday __wd_;
|
||||
unsigned char __idx_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI weekday_indexed() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr weekday_indexed(const chrono::weekday& __wdval, unsigned __idxval) noexcept
|
||||
: __wd{__wdval}, __idx(__idxval) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __idx; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd.ok() && __idx >= 1 && __idx <= 5; }
|
||||
: __wd_{__wdval}, __idx_(__idxval) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wd_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __idx_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __wd_.ok() && __idx_ >= 1 && __idx_ <= 5; }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
@ -145,12 +145,12 @@ bool operator!=(const weekday_indexed& __lhs, const weekday_indexed& __rhs) noex
|
|||
|
||||
class weekday_last {
|
||||
private:
|
||||
chrono::weekday __wd;
|
||||
chrono::weekday __wd_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI explicit constexpr weekday_last(const chrono::weekday& __val) noexcept
|
||||
: __wd{__val} {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd.ok(); }
|
||||
: __wd_{__val} {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::weekday weekday() const noexcept { return __wd_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept { return __wd_.ok(); }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
|
|
@ -31,22 +31,22 @@ namespace chrono
|
|||
|
||||
class year {
|
||||
private:
|
||||
short __y;
|
||||
short __y_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI year() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y(static_cast<short>(__val)) {}
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr year(int __val) noexcept : __y_(static_cast<short>(__val)) {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++() noexcept { ++__y; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year& operator++() noexcept { ++__y_; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year operator++(int) noexcept { year __tmp = *this; ++(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year& operator--() noexcept { --__y; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year& operator--() noexcept { --__y_; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year operator--(int) noexcept { year __tmp = *this; --(*this); return __tmp; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year& operator+=(const years& __dy) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year& operator-=(const years& __dy) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year operator+() const noexcept { return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year operator-() const noexcept { return year{-__y_}; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept { return __y % 4 == 0 && (__y % 100 != 0 || __y % 400 == 0); }
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool is_leap() const noexcept { return __y_ % 4 == 0 && (__y_ % 100 != 0 || __y_ % 400 == 0); }
|
||||
_LIBCPP_HIDE_FROM_ABI explicit inline constexpr operator int() const noexcept { return __y_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool ok() const noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI static inline constexpr year min() noexcept { return year{-32767}; }
|
||||
_LIBCPP_HIDE_FROM_ABI static inline constexpr year max() noexcept { return year{ 32767}; }
|
||||
|
@ -87,8 +87,8 @@ year& year::operator-=(const years& __dy) noexcept
|
|||
{ *this = *this - __dy; return *this; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr bool year::ok() const noexcept {
|
||||
static_assert(static_cast<int>(std::numeric_limits<decltype(__y)>::max()) == static_cast<int>(max()));
|
||||
return static_cast<int>(min()) <= __y;
|
||||
static_assert(static_cast<int>(std::numeric_limits<decltype(__y_)>::max()) == static_cast<int>(max()));
|
||||
return static_cast<int>(min()) <= __y_;
|
||||
}
|
||||
|
||||
} // namespace chrono
|
||||
|
|
|
@ -28,19 +28,19 @@ namespace chrono
|
|||
{
|
||||
|
||||
class year_month {
|
||||
chrono::year __y;
|
||||
chrono::month __m;
|
||||
chrono::year __y_;
|
||||
chrono::month __m_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI year_month() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month(const chrono::year& __yval, const chrono::month& __mval) noexcept
|
||||
: __y{__yval}, __m{__mval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept { this->__m += __dm; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept { this->__m -= __dm; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy) noexcept { this->__y += __dy; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy) noexcept { this->__y -= __dy; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok(); }
|
||||
: __y_{__yval}, __m_{__mval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const months& __dm) noexcept { this->__m_ += __dm; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const months& __dm) noexcept { this->__m_ -= __dm; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator+=(const years& __dy) noexcept { this->__y_ += __dy; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month& operator-=(const years& __dy) noexcept { this->__y_ -= __dy; return *this; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok(); }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
|
|
@ -38,14 +38,14 @@ class year_month_day_last;
|
|||
|
||||
class year_month_day {
|
||||
private:
|
||||
chrono::year __y;
|
||||
chrono::month __m;
|
||||
chrono::day __d;
|
||||
chrono::year __y_;
|
||||
chrono::month __m_;
|
||||
chrono::day __d_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI year_month_day() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day(
|
||||
const chrono::year& __yval, const chrono::month& __mval, const chrono::day& __dval) noexcept
|
||||
: __y{__yval}, __m{__mval}, __d{__dval} {}
|
||||
: __y_{__yval}, __m_{__mval}, __d_{__dval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day(const year_month_day_last& __ymdl) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day(const sys_days& __sysd) noexcept
|
||||
: year_month_day(__from_days(__sysd.time_since_epoch())) {}
|
||||
|
@ -57,9 +57,9 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator+=(const years& __dy) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day& operator-=(const years& __dy) noexcept;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::day day() const noexcept { return __d_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; }
|
||||
|
||||
|
@ -95,9 +95,9 @@ days year_month_day::__to_days() const noexcept
|
|||
static_assert(numeric_limits<unsigned>::digits >= 18, "");
|
||||
static_assert(numeric_limits<int>::digits >= 20 , "");
|
||||
|
||||
const int __yr = static_cast<int>(__y) - (__m <= February);
|
||||
const unsigned __mth = static_cast<unsigned>(__m);
|
||||
const unsigned __dy = static_cast<unsigned>(__d);
|
||||
const int __yr = static_cast<int>(__y_) - (__m_ <= February);
|
||||
const unsigned __mth = static_cast<unsigned>(__m_);
|
||||
const unsigned __dy = static_cast<unsigned>(__d_);
|
||||
|
||||
const int __era = (__yr >= 0 ? __yr : __yr - 399) / 400;
|
||||
const unsigned __yoe = static_cast<unsigned>(__yr - __era * 400); // [0, 399]
|
||||
|
@ -175,24 +175,24 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day& year_month_day::operator-
|
|||
|
||||
class year_month_day_last {
|
||||
private:
|
||||
chrono::year __y;
|
||||
chrono::month_day_last __mdl;
|
||||
chrono::year __y_;
|
||||
chrono::month_day_last __mdl_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last(const year& __yval, const month_day_last& __mdlval) noexcept
|
||||
: __y{__yval}, __mdl{__mdlval} {}
|
||||
: __y_{__yval}, __mdl_{__mdlval} {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const months& __m) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const months& __m) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator+=(const years& __y) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_day_last& operator-=(const years& __y) noexcept;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __mdl.month(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __mdl_.month(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month_day_last month_day_last() const noexcept { return __mdl_; }
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr chrono::day day() const noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{year()/month()/day()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{year()/month()/day()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __mdl.ok(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __mdl_.ok(); }
|
||||
};
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
|
@ -205,7 +205,7 @@ chrono::day year_month_day_last::day() const noexcept
|
|||
chrono::day(31), chrono::day(31), chrono::day(30),
|
||||
chrono::day(31), chrono::day(30), chrono::day(31)
|
||||
};
|
||||
return (month() != February || !__y.is_leap()) && month().ok() ?
|
||||
return (month() != February || !__y_.is_leap()) && month().ok() ?
|
||||
__d[static_cast<unsigned>(month()) - 1] : chrono::day{29};
|
||||
}
|
||||
|
||||
|
@ -289,13 +289,13 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_day_last& year_month_day_last:
|
|||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
year_month_day::year_month_day(const year_month_day_last& __ymdl) noexcept
|
||||
: __y{__ymdl.year()}, __m{__ymdl.month()}, __d{__ymdl.day()} {}
|
||||
: __y_{__ymdl.year()}, __m_{__ymdl.month()}, __d_{__ymdl.day()} {}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
bool year_month_day::ok() const noexcept
|
||||
{
|
||||
if (!__y.ok() || !__m.ok()) return false;
|
||||
return chrono::day{1} <= __d && __d <= (__y / __m / last).day();
|
||||
if (!__y_.ok() || !__m_.ok()) return false;
|
||||
return chrono::day{1} <= __d_ && __d_ <= (__y_ / __m_ / last).day();
|
||||
}
|
||||
|
||||
} // namespace chrono
|
||||
|
|
|
@ -35,14 +35,14 @@ namespace chrono
|
|||
{
|
||||
|
||||
class year_month_weekday {
|
||||
chrono::year __y;
|
||||
chrono::month __m;
|
||||
chrono::weekday_indexed __wdi;
|
||||
chrono::year __y_;
|
||||
chrono::month __m_;
|
||||
chrono::weekday_indexed __wdi_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI year_month_weekday() = default;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const chrono::year& __yval, const chrono::month& __mval,
|
||||
const chrono::weekday_indexed& __wdival) noexcept
|
||||
: __y{__yval}, __m{__mval}, __wdi{__wdival} {}
|
||||
: __y_{__yval}, __m_{__mval}, __wdi_{__wdival} {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday(const sys_days& __sysd) noexcept
|
||||
: year_month_weekday(__from_days(__sysd.time_since_epoch())) {}
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr year_month_weekday(const local_days& __locd) noexcept
|
||||
|
@ -52,24 +52,24 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator+=(const years&) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday& operator-=(const years&) noexcept;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdi.weekday(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __wdi.index(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdi_.weekday(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr unsigned index() const noexcept { return __wdi_.index(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_indexed weekday_indexed() const noexcept { return __wdi_; }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept
|
||||
{
|
||||
if (!__y.ok() || !__m.ok() || !__wdi.ok()) return false;
|
||||
if (__wdi.index() <= 4) return true;
|
||||
if (!__y_.ok() || !__m_.ok() || !__wdi_.ok()) return false;
|
||||
if (__wdi_.index() <= 4) return true;
|
||||
auto __nth_weekday_day =
|
||||
__wdi.weekday() -
|
||||
chrono::weekday{static_cast<sys_days>(__y / __m / 1)} +
|
||||
days{(__wdi.index() - 1) * 7 + 1};
|
||||
__wdi_.weekday() -
|
||||
chrono::weekday{static_cast<sys_days>(__y_ / __m_ / 1)} +
|
||||
days{(__wdi_.index() - 1) * 7 + 1};
|
||||
return static_cast<unsigned>(__nth_weekday_day.count()) <=
|
||||
static_cast<unsigned>((__y / __m / last).day());
|
||||
static_cast<unsigned>((__y_ / __m_ / last).day());
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI static constexpr year_month_weekday __from_days(days __d) noexcept;
|
||||
|
@ -89,8 +89,8 @@ year_month_weekday year_month_weekday::__from_days(days __d) noexcept
|
|||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
days year_month_weekday::__to_days() const noexcept
|
||||
{
|
||||
const sys_days __sysd = sys_days(__y/__m/1);
|
||||
return (__sysd + (__wdi.weekday() - chrono::weekday(__sysd) + days{(__wdi.index()-1)*7}))
|
||||
const sys_days __sysd = sys_days(__y_/__m_/1);
|
||||
return (__sysd + (__wdi_.weekday() - chrono::weekday(__sysd) + days{(__wdi_.index()-1)*7}))
|
||||
.time_since_epoch();
|
||||
}
|
||||
|
||||
|
@ -155,25 +155,25 @@ _LIBCPP_HIDE_FROM_ABI inline constexpr year_month_weekday& year_month_weekday::o
|
|||
|
||||
class year_month_weekday_last {
|
||||
private:
|
||||
chrono::year __y;
|
||||
chrono::month __m;
|
||||
chrono::weekday_last __wdl;
|
||||
chrono::year __y_;
|
||||
chrono::month __m_;
|
||||
chrono::weekday_last __wdl_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last(const chrono::year& __yval, const chrono::month& __mval,
|
||||
const chrono::weekday_last& __wdlval) noexcept
|
||||
: __y{__yval}, __m{__mval}, __wdl{__wdlval} {}
|
||||
: __y_{__yval}, __m_{__mval}, __wdl_{__wdlval} {}
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const months& __dm) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const months& __dm) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator+=(const years& __dy) noexcept;
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr year_month_weekday_last& operator-=(const years& __dy) noexcept;
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdl.weekday(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::year year() const noexcept { return __y_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::month month() const noexcept { return __m_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday weekday() const noexcept { return __wdl_.weekday(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr chrono::weekday_last weekday_last() const noexcept { return __wdl_; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr operator sys_days() const noexcept { return sys_days{__to_days()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline explicit constexpr operator local_days() const noexcept { return local_days{__to_days()}; }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y.ok() && __m.ok() && __wdl.ok(); }
|
||||
_LIBCPP_HIDE_FROM_ABI inline constexpr bool ok() const noexcept { return __y_.ok() && __m_.ok() && __wdl_.ok(); }
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr days __to_days() const noexcept;
|
||||
|
||||
|
@ -182,8 +182,8 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI inline constexpr
|
||||
days year_month_weekday_last::__to_days() const noexcept
|
||||
{
|
||||
const sys_days __last = sys_days{__y/__m/last};
|
||||
return (__last - (chrono::weekday{__last} - __wdl.weekday())).time_since_epoch();
|
||||
const sys_days __last = sys_days{__y_/__m_/last};
|
||||
return (__last - (chrono::weekday{__last} - __wdl_.weekday())).time_since_epoch();
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class _LIBCPP_TEMPLATE_VIS reverse_iterator
|
|||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
private:
|
||||
#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
|
||||
_Iter __t; // no longer used as of LWG #2360, not removed due to ABI break
|
||||
_Iter __t_; // no longer used as of LWG #2360, not removed due to ABI break
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
|
@ -82,17 +82,17 @@ public:
|
|||
|
||||
#ifndef _LIBCPP_ABI_NO_ITERATOR_BASES
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
reverse_iterator() : __t(), current() {}
|
||||
reverse_iterator() : __t_(), current() {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
explicit reverse_iterator(_Iter __x) : __t(__x), current(__x) {}
|
||||
explicit reverse_iterator(_Iter __x) : __t_(__x), current(__x) {}
|
||||
|
||||
template <class _Up, class = __enable_if_t<
|
||||
!is_same<_Up, _Iter>::value && is_convertible<_Up const&, _Iter>::value
|
||||
> >
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
reverse_iterator(const reverse_iterator<_Up>& __u)
|
||||
: __t(__u.base()), current(__u.base())
|
||||
: __t_(__u.base()), current(__u.base())
|
||||
{ }
|
||||
|
||||
template <class _Up, class = __enable_if_t<
|
||||
|
@ -102,7 +102,7 @@ public:
|
|||
> >
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX17
|
||||
reverse_iterator& operator=(const reverse_iterator<_Up>& __u) {
|
||||
__t = current = __u.base();
|
||||
__t_ = current = __u.base();
|
||||
return *this;
|
||||
}
|
||||
#else
|
||||
|
|
|
@ -38,17 +38,17 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
iterator_type __i;
|
||||
iterator_type __i_;
|
||||
public:
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter() _NOEXCEPT
|
||||
: __i()
|
||||
: __i_()
|
||||
{
|
||||
_VSTD::__debug_db_insert_i(this);
|
||||
}
|
||||
template <class _Up> _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
__wrap_iter(const __wrap_iter<_Up>& __u,
|
||||
typename enable_if<is_convertible<_Up, iterator_type>::value>::type* = nullptr) _NOEXCEPT
|
||||
: __i(__u.base())
|
||||
: __i_(__u.base())
|
||||
{
|
||||
#ifdef _LIBCPP_ENABLE_DEBUG_MODE
|
||||
if (!__libcpp_is_constant_evaluated())
|
||||
|
@ -58,7 +58,7 @@ public:
|
|||
#ifdef _LIBCPP_ENABLE_DEBUG_MODE
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
__wrap_iter(const __wrap_iter& __x)
|
||||
: __i(__x.base())
|
||||
: __i_(__x.base())
|
||||
{
|
||||
if (!__libcpp_is_constant_evaluated())
|
||||
__get_db()->__iterator_copy(this, _VSTD::addressof(__x));
|
||||
|
@ -70,7 +70,7 @@ public:
|
|||
{
|
||||
if (!__libcpp_is_constant_evaluated())
|
||||
__get_db()->__iterator_copy(this, _VSTD::addressof(__x));
|
||||
__i = __x.__i;
|
||||
__i_ = __x.__i_;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
@ -85,19 +85,19 @@ public:
|
|||
{
|
||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to dereference a non-dereferenceable iterator");
|
||||
return *__i;
|
||||
return *__i_;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pointer operator->() const _NOEXCEPT
|
||||
{
|
||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to dereference a non-dereferenceable iterator");
|
||||
return _VSTD::__to_address(__i);
|
||||
return _VSTD::__to_address(__i_);
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter& operator++() _NOEXCEPT
|
||||
{
|
||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__dereferenceable(this),
|
||||
"Attempted to increment a non-incrementable iterator");
|
||||
++__i;
|
||||
++__i_;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter operator++(int) _NOEXCEPT
|
||||
|
@ -107,7 +107,7 @@ public:
|
|||
{
|
||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__decrementable(this),
|
||||
"Attempted to decrement a non-decrementable iterator");
|
||||
--__i;
|
||||
--__i_;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter operator--(int) _NOEXCEPT
|
||||
|
@ -118,7 +118,7 @@ public:
|
|||
{
|
||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__addable(this, __n),
|
||||
"Attempted to add/subtract an iterator outside its valid range");
|
||||
__i += __n;
|
||||
__i_ += __n;
|
||||
return *this;
|
||||
}
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 __wrap_iter operator- (difference_type __n) const _NOEXCEPT
|
||||
|
@ -129,14 +129,14 @@ public:
|
|||
{
|
||||
_LIBCPP_DEBUG_ASSERT(__get_const_db()->__subscriptable(this, __n),
|
||||
"Attempted to subscript an iterator outside its valid range");
|
||||
return __i[__n];
|
||||
return __i_[__n];
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 iterator_type base() const _NOEXCEPT {return __i;}
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 iterator_type base() const _NOEXCEPT {return __i_;}
|
||||
|
||||
private:
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
|
||||
explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i(__x)
|
||||
explicit __wrap_iter(const void* __p, iterator_type __x) _NOEXCEPT : __i_(__x)
|
||||
{
|
||||
(void)__p;
|
||||
#ifdef _LIBCPP_ENABLE_DEBUG_MODE
|
||||
|
|
|
@ -350,7 +350,7 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS collate_byname<char>
|
||||
: public collate<char>
|
||||
{
|
||||
locale_t __l;
|
||||
locale_t __l_;
|
||||
public:
|
||||
typedef char char_type;
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
@ -370,7 +370,7 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS collate_byname<wchar_t>
|
||||
: public collate<wchar_t>
|
||||
{
|
||||
locale_t __l;
|
||||
locale_t __l_;
|
||||
public:
|
||||
typedef wchar_t char_type;
|
||||
typedef basic_string<char_type> string_type;
|
||||
|
@ -792,7 +792,7 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS ctype_byname<char>
|
||||
: public ctype<char>
|
||||
{
|
||||
locale_t __l;
|
||||
locale_t __l_;
|
||||
|
||||
public:
|
||||
explicit ctype_byname(const char*, size_t = 0);
|
||||
|
@ -811,7 +811,7 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS ctype_byname<wchar_t>
|
||||
: public ctype<wchar_t>
|
||||
{
|
||||
locale_t __l;
|
||||
locale_t __l_;
|
||||
|
||||
public:
|
||||
explicit ctype_byname(const char*, size_t = 0);
|
||||
|
@ -1045,7 +1045,7 @@ class _LIBCPP_TYPE_VIS codecvt<wchar_t, char, mbstate_t>
|
|||
: public locale::facet,
|
||||
public codecvt_base
|
||||
{
|
||||
locale_t __l;
|
||||
locale_t __l_;
|
||||
public:
|
||||
typedef wchar_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
|
|
@ -1799,7 +1799,7 @@ operator<<(basic_ostream<_CharT, _Traits>& __os, shared_ptr<_Yp> const& __p);
|
|||
|
||||
class _LIBCPP_TYPE_VIS __sp_mut
|
||||
{
|
||||
void* __lx;
|
||||
void* __lx_;
|
||||
public:
|
||||
void lock() _NOEXCEPT;
|
||||
void unlock() _NOEXCEPT;
|
||||
|
|
|
@ -58,8 +58,8 @@ public:
|
|||
|
||||
private:
|
||||
param_type __p_;
|
||||
result_type _V_;
|
||||
bool _V_hot_;
|
||||
result_type __v_;
|
||||
bool __v_hot_;
|
||||
|
||||
public:
|
||||
// constructors and reset functions
|
||||
|
@ -68,18 +68,18 @@ public:
|
|||
normal_distribution() : normal_distribution(0) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit normal_distribution(result_type __mean, result_type __stddev = 1)
|
||||
: __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
|
||||
: __p_(param_type(__mean, __stddev)), __v_hot_(false) {}
|
||||
#else
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit normal_distribution(result_type __mean = 0,
|
||||
result_type __stddev = 1)
|
||||
: __p_(param_type(__mean, __stddev)), _V_hot_(false) {}
|
||||
: __p_(param_type(__mean, __stddev)), __v_hot_(false) {}
|
||||
#endif
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit normal_distribution(const param_type& __p)
|
||||
: __p_(__p), _V_hot_(false) {}
|
||||
: __p_(__p), __v_hot_(false) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void reset() {_V_hot_ = false;}
|
||||
void reset() {__v_hot_ = false;}
|
||||
|
||||
// generating functions
|
||||
template<class _URNG>
|
||||
|
@ -107,8 +107,8 @@ public:
|
|||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator==(const normal_distribution& __x,
|
||||
const normal_distribution& __y)
|
||||
{return __x.__p_ == __y.__p_ && __x._V_hot_ == __y._V_hot_ &&
|
||||
(!__x._V_hot_ || __x._V_ == __y._V_);}
|
||||
{return __x.__p_ == __y.__p_ && __x.__v_hot_ == __y.__v_hot_ &&
|
||||
(!__x.__v_hot_ || __x.__v_ == __y.__v_);}
|
||||
friend _LIBCPP_INLINE_VISIBILITY
|
||||
bool operator!=(const normal_distribution& __x,
|
||||
const normal_distribution& __y)
|
||||
|
@ -134,10 +134,10 @@ normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
|||
{
|
||||
static_assert(__libcpp_random_is_valid_urng<_URNG>::value, "");
|
||||
result_type _Up;
|
||||
if (_V_hot_)
|
||||
if (__v_hot_)
|
||||
{
|
||||
_V_hot_ = false;
|
||||
_Up = _V_;
|
||||
__v_hot_ = false;
|
||||
_Up = __v_;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -152,8 +152,8 @@ normal_distribution<_RealType>::operator()(_URNG& __g, const param_type& __p)
|
|||
__s = __u * __u + __v * __v;
|
||||
} while (__s > 1 || __s == 0);
|
||||
result_type _Fp = _VSTD::sqrt(-2 * _VSTD::log(__s) / __s);
|
||||
_V_ = __v * _Fp;
|
||||
_V_hot_ = true;
|
||||
__v_ = __v * _Fp;
|
||||
__v_hot_ = true;
|
||||
_Up = __u * _Fp;
|
||||
}
|
||||
return _Up * __p.stddev() + __p.mean();
|
||||
|
@ -170,9 +170,9 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
|
|||
_OStream::scientific);
|
||||
_CharT __sp = __os.widen(' ');
|
||||
__os.fill(__sp);
|
||||
__os << __x.mean() << __sp << __x.stddev() << __sp << __x._V_hot_;
|
||||
if (__x._V_hot_)
|
||||
__os << __sp << __x._V_;
|
||||
__os << __x.mean() << __sp << __x.stddev() << __sp << __x.__v_hot_;
|
||||
if (__x.__v_hot_)
|
||||
__os << __sp << __x.__v_;
|
||||
return __os;
|
||||
}
|
||||
|
||||
|
@ -197,8 +197,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||
if (!__is.fail())
|
||||
{
|
||||
__x.param(param_type(__mean, __stddev));
|
||||
__x._V_hot_ = _V_hot;
|
||||
__x._V_ = _Vp;
|
||||
__x.__v_hot_ = _V_hot;
|
||||
__x.__v_ = _Vp;
|
||||
}
|
||||
return __is;
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@ public:
|
|||
|
||||
private:
|
||||
_Engine __e_;
|
||||
result_type _V_[__k];
|
||||
result_type _Y_;
|
||||
result_type __v_[__k];
|
||||
result_type __y_;
|
||||
|
||||
public:
|
||||
// engine characteristics
|
||||
|
@ -157,8 +157,8 @@ private:
|
|||
void __init()
|
||||
{
|
||||
for (size_t __i = 0; __i < __k; ++__i)
|
||||
_V_[__i] = __e_();
|
||||
_Y_ = __e_();
|
||||
__v_[__i] = __e_();
|
||||
__y_ = __e_();
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -190,11 +190,11 @@ private:
|
|||
>::type
|
||||
__eval(__uratio<_Np, _Dp>)
|
||||
{
|
||||
const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (_Y_ - _Min)
|
||||
const size_t __j = static_cast<size_t>(__uratio<_Np, _Dp>::num * (__y_ - _Min)
|
||||
/ __uratio<_Np, _Dp>::den);
|
||||
_Y_ = _V_[__j];
|
||||
_V_[__j] = __e_();
|
||||
return _Y_;
|
||||
__y_ = __v_[__j];
|
||||
__v_[__j] = __e_();
|
||||
return __y_;
|
||||
}
|
||||
|
||||
template <uint64_t __n, uint64_t __d>
|
||||
|
@ -204,10 +204,10 @@ private:
|
|||
const double _Fp = __d == 0 ?
|
||||
__n / (2. * 0x8000000000000000ull) :
|
||||
__n / (double)__d;
|
||||
const size_t __j = static_cast<size_t>(_Fp * (_Y_ - _Min));
|
||||
_Y_ = _V_[__j];
|
||||
_V_[__j] = __e_();
|
||||
return _Y_;
|
||||
const size_t __j = static_cast<size_t>(_Fp * (__y_ - _Min));
|
||||
__y_ = __v_[__j];
|
||||
__v_[__j] = __e_();
|
||||
return __y_;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -220,7 +220,7 @@ operator==(
|
|||
const shuffle_order_engine<_Eng, _Kp>& __x,
|
||||
const shuffle_order_engine<_Eng, _Kp>& __y)
|
||||
{
|
||||
return __x._Y_ == __y._Y_ && _VSTD::equal(__x._V_, __x._V_ + _Kp, __y._V_) &&
|
||||
return __x.__y_ == __y.__y_ && _VSTD::equal(__x.__v_, __x.__v_ + _Kp, __y.__v_) &&
|
||||
__x.__e_ == __y.__e_;
|
||||
}
|
||||
|
||||
|
@ -245,10 +245,10 @@ operator<<(basic_ostream<_CharT, _Traits>& __os,
|
|||
__os.flags(_Ostream::dec | _Ostream::left);
|
||||
_CharT __sp = __os.widen(' ');
|
||||
__os.fill(__sp);
|
||||
__os << __x.__e_ << __sp << __x._V_[0];
|
||||
__os << __x.__e_ << __sp << __x.__v_[0];
|
||||
for (size_t __i = 1; __i < _Kp; ++__i)
|
||||
__os << __sp << __x._V_[__i];
|
||||
return __os << __sp << __x._Y_;
|
||||
__os << __sp << __x.__v_[__i];
|
||||
return __os << __sp << __x.__y_;
|
||||
}
|
||||
|
||||
template <class _CharT, class _Traits,
|
||||
|
@ -270,8 +270,8 @@ operator>>(basic_istream<_CharT, _Traits>& __is,
|
|||
{
|
||||
__x.__e_ = __e;
|
||||
for (size_t __i = 0; __i < _Kp; ++__i)
|
||||
__x._V_[__i] = _Vp[__i];
|
||||
__x._Y_ = _Vp[_Kp];
|
||||
__x.__v_[__i] = _Vp[__i];
|
||||
__x.__y_ = _Vp[_Kp];
|
||||
}
|
||||
return __is;
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
#include <cstddef>
|
||||
#include <locale.h> // _locale_t
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
#define _X_ALL LC_ALL
|
||||
#define _X_COLLATE LC_COLLATE
|
||||
|
@ -50,92 +51,92 @@
|
|||
class __lconv_storage {
|
||||
public:
|
||||
__lconv_storage(const lconv *__lc_input) {
|
||||
__lc = *__lc_input;
|
||||
__lc_ = *__lc_input;
|
||||
|
||||
__decimal_point = __lc_input->decimal_point;
|
||||
__thousands_sep = __lc_input->thousands_sep;
|
||||
__grouping = __lc_input->grouping;
|
||||
__int_curr_symbol = __lc_input->int_curr_symbol;
|
||||
__currency_symbol = __lc_input->currency_symbol;
|
||||
__mon_decimal_point = __lc_input->mon_decimal_point;
|
||||
__mon_thousands_sep = __lc_input->mon_thousands_sep;
|
||||
__mon_grouping = __lc_input->mon_grouping;
|
||||
__positive_sign = __lc_input->positive_sign;
|
||||
__negative_sign = __lc_input->negative_sign;
|
||||
__decimal_point_ = __lc_input->decimal_point;
|
||||
__thousands_sep_ = __lc_input->thousands_sep;
|
||||
__grouping_ = __lc_input->grouping;
|
||||
__int_curr_symbol_ = __lc_input->int_curr_symbol;
|
||||
__currency_symbol_ = __lc_input->currency_symbol;
|
||||
__mon_decimal_point_ = __lc_input->mon_decimal_point;
|
||||
__mon_thousands_sep_ = __lc_input->mon_thousands_sep;
|
||||
__mon_grouping_ = __lc_input->mon_grouping;
|
||||
__positive_sign_ = __lc_input->positive_sign;
|
||||
__negative_sign_ = __lc_input->negative_sign;
|
||||
|
||||
__lc.decimal_point = const_cast<char *>(__decimal_point.c_str());
|
||||
__lc.thousands_sep = const_cast<char *>(__thousands_sep.c_str());
|
||||
__lc.grouping = const_cast<char *>(__grouping.c_str());
|
||||
__lc.int_curr_symbol = const_cast<char *>(__int_curr_symbol.c_str());
|
||||
__lc.currency_symbol = const_cast<char *>(__currency_symbol.c_str());
|
||||
__lc.mon_decimal_point = const_cast<char *>(__mon_decimal_point.c_str());
|
||||
__lc.mon_thousands_sep = const_cast<char *>(__mon_thousands_sep.c_str());
|
||||
__lc.mon_grouping = const_cast<char *>(__mon_grouping.c_str());
|
||||
__lc.positive_sign = const_cast<char *>(__positive_sign.c_str());
|
||||
__lc.negative_sign = const_cast<char *>(__negative_sign.c_str());
|
||||
__lc_.decimal_point = const_cast<char *>(__decimal_point_.c_str());
|
||||
__lc_.thousands_sep = const_cast<char *>(__thousands_sep_.c_str());
|
||||
__lc_.grouping = const_cast<char *>(__grouping_.c_str());
|
||||
__lc_.int_curr_symbol = const_cast<char *>(__int_curr_symbol_.c_str());
|
||||
__lc_.currency_symbol = const_cast<char *>(__currency_symbol_.c_str());
|
||||
__lc_.mon_decimal_point = const_cast<char *>(__mon_decimal_point_.c_str());
|
||||
__lc_.mon_thousands_sep = const_cast<char *>(__mon_thousands_sep_.c_str());
|
||||
__lc_.mon_grouping = const_cast<char *>(__mon_grouping_.c_str());
|
||||
__lc_.positive_sign = const_cast<char *>(__positive_sign_.c_str());
|
||||
__lc_.negative_sign = const_cast<char *>(__negative_sign_.c_str());
|
||||
}
|
||||
|
||||
lconv *__get() {
|
||||
return &__lc;
|
||||
return &__lc_;
|
||||
}
|
||||
private:
|
||||
lconv __lc;
|
||||
std::string __decimal_point;
|
||||
std::string __thousands_sep;
|
||||
std::string __grouping;
|
||||
std::string __int_curr_symbol;
|
||||
std::string __currency_symbol;
|
||||
std::string __mon_decimal_point;
|
||||
std::string __mon_thousands_sep;
|
||||
std::string __mon_grouping;
|
||||
std::string __positive_sign;
|
||||
std::string __negative_sign;
|
||||
lconv __lc_;
|
||||
std::string __decimal_point_;
|
||||
std::string __thousands_sep_;
|
||||
std::string __grouping_;
|
||||
std::string __int_curr_symbol_;
|
||||
std::string __currency_symbol_;
|
||||
std::string __mon_decimal_point_;
|
||||
std::string __mon_thousands_sep_;
|
||||
std::string __mon_grouping_;
|
||||
std::string __positive_sign_;
|
||||
std::string __negative_sign_;
|
||||
};
|
||||
|
||||
class locale_t {
|
||||
public:
|
||||
locale_t()
|
||||
: __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
|
||||
: __locale_(nullptr), __locale_str_(nullptr), __lc_(nullptr) {}
|
||||
locale_t(std::nullptr_t)
|
||||
: __locale(nullptr), __locale_str(nullptr), __lc(nullptr) {}
|
||||
: __locale_(nullptr), __locale_str_(nullptr), __lc_(nullptr) {}
|
||||
locale_t(_locale_t __xlocale, const char* __xlocale_str)
|
||||
: __locale(__xlocale), __locale_str(__xlocale_str), __lc(nullptr) {}
|
||||
: __locale_(__xlocale), __locale_str_(__xlocale_str), __lc_(nullptr) {}
|
||||
locale_t(const locale_t &__l)
|
||||
: __locale(__l.__locale), __locale_str(__l.__locale_str), __lc(nullptr) {}
|
||||
: __locale_(__l.__locale_), __locale_str_(__l.__locale_str_), __lc_(nullptr) {}
|
||||
|
||||
~locale_t() {
|
||||
delete __lc;
|
||||
delete __lc_;
|
||||
}
|
||||
|
||||
locale_t &operator =(const locale_t &__l) {
|
||||
__locale = __l.__locale;
|
||||
__locale_str = __l.__locale_str;
|
||||
// __lc not copied
|
||||
__locale_ = __l.__locale_;
|
||||
__locale_str_ = __l.__locale_str_;
|
||||
// __lc_ not copied
|
||||
return *this;
|
||||
}
|
||||
|
||||
friend bool operator==(const locale_t& __left, const locale_t& __right) {
|
||||
return __left.__locale == __right.__locale;
|
||||
return __left.__locale_ == __right.__locale_;
|
||||
}
|
||||
|
||||
friend bool operator==(const locale_t& __left, int __right) {
|
||||
return __left.__locale == nullptr && __right == 0;
|
||||
return __left.__locale_ == nullptr && __right == 0;
|
||||
}
|
||||
|
||||
friend bool operator==(const locale_t& __left, long long __right) {
|
||||
return __left.__locale == nullptr && __right == 0;
|
||||
return __left.__locale_ == nullptr && __right == 0;
|
||||
}
|
||||
|
||||
friend bool operator==(const locale_t& __left, std::nullptr_t) {
|
||||
return __left.__locale == nullptr;
|
||||
return __left.__locale_ == nullptr;
|
||||
}
|
||||
|
||||
friend bool operator==(int __left, const locale_t& __right) {
|
||||
return __left == 0 && nullptr == __right.__locale;
|
||||
return __left == 0 && nullptr == __right.__locale_;
|
||||
}
|
||||
|
||||
friend bool operator==(std::nullptr_t, const locale_t& __right) {
|
||||
return nullptr == __right.__locale;
|
||||
return nullptr == __right.__locale_;
|
||||
}
|
||||
|
||||
friend bool operator!=(const locale_t& __left, const locale_t& __right) {
|
||||
|
@ -163,24 +164,24 @@ public:
|
|||
}
|
||||
|
||||
operator bool() const {
|
||||
return __locale != nullptr;
|
||||
return __locale_ != nullptr;
|
||||
}
|
||||
|
||||
const char* __get_locale() const { return __locale_str; }
|
||||
const char* __get_locale() const { return __locale_str_; }
|
||||
|
||||
operator _locale_t() const {
|
||||
return __locale;
|
||||
return __locale_;
|
||||
}
|
||||
|
||||
lconv *__store_lconv(const lconv *__input_lc) {
|
||||
delete __lc;
|
||||
__lc = new __lconv_storage(__input_lc);
|
||||
return __lc->__get();
|
||||
delete __lc_;
|
||||
__lc_ = new __lconv_storage(__input_lc);
|
||||
return __lc_->__get();
|
||||
}
|
||||
private:
|
||||
_locale_t __locale;
|
||||
const char* __locale_str;
|
||||
__lconv_storage *__lc = nullptr;
|
||||
_locale_t __locale_;
|
||||
const char* __locale_str_;
|
||||
__lconv_storage *__lc_ = nullptr;
|
||||
};
|
||||
|
||||
// Locale management functions
|
||||
|
|
|
@ -194,18 +194,18 @@ class _LIBCPP_TEMPLATE_VIS any
|
|||
public:
|
||||
// construct/destruct
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr any() _NOEXCEPT : __h(nullptr) {}
|
||||
constexpr any() _NOEXCEPT : __h_(nullptr) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
any(any const & __other) : __h(nullptr)
|
||||
any(any const & __other) : __h_(nullptr)
|
||||
{
|
||||
if (__other.__h) __other.__call(_Action::_Copy, this);
|
||||
if (__other.__h_) __other.__call(_Action::_Copy, this);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
any(any && __other) _NOEXCEPT : __h(nullptr)
|
||||
any(any && __other) _NOEXCEPT : __h_(nullptr)
|
||||
{
|
||||
if (__other.__h) __other.__call(_Action::_Move, this);
|
||||
if (__other.__h_) __other.__call(_Action::_Move, this);
|
||||
}
|
||||
|
||||
template <
|
||||
|
@ -284,19 +284,19 @@ public:
|
|||
|
||||
// 6.3.3 any modifiers
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void reset() _NOEXCEPT { if (__h) this->__call(_Action::_Destroy); }
|
||||
void reset() _NOEXCEPT { if (__h_) this->__call(_Action::_Destroy); }
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void swap(any & __rhs) _NOEXCEPT;
|
||||
|
||||
// 6.3.4 any observers
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool has_value() const _NOEXCEPT { return __h != nullptr; }
|
||||
bool has_value() const _NOEXCEPT { return __h_ != nullptr; }
|
||||
|
||||
#if !defined(_LIBCPP_NO_RTTI)
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const type_info & type() const _NOEXCEPT {
|
||||
if (__h) {
|
||||
if (__h_) {
|
||||
return *static_cast<type_info const *>(this->__call(_Action::_TypeInfo));
|
||||
} else {
|
||||
return typeid(void);
|
||||
|
@ -320,7 +320,7 @@ private:
|
|||
type_info const * __info = nullptr,
|
||||
const void* __fallback_info = nullptr) const
|
||||
{
|
||||
return __h(__a, this, __other, __info, __fallback_info);
|
||||
return __h_(__a, this, __other, __info, __fallback_info);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -328,7 +328,7 @@ private:
|
|||
type_info const * __info = nullptr,
|
||||
const void* __fallback_info = nullptr)
|
||||
{
|
||||
return __h(__a, this, __other, __info, __fallback_info);
|
||||
return __h_(__a, this, __other, __info, __fallback_info);
|
||||
}
|
||||
|
||||
template <class>
|
||||
|
@ -344,8 +344,8 @@ private:
|
|||
friend add_pointer_t<_ValueType>
|
||||
any_cast(any *) _NOEXCEPT;
|
||||
|
||||
_HandleFuncPtr __h = nullptr;
|
||||
_Storage __s;
|
||||
_HandleFuncPtr __h_ = nullptr;
|
||||
_Storage __s_;
|
||||
};
|
||||
|
||||
namespace __any_imp
|
||||
|
@ -382,9 +382,9 @@ namespace __any_imp
|
|||
typedef allocator<_Tp> _Alloc;
|
||||
typedef allocator_traits<_Alloc> _ATraits;
|
||||
_Alloc __a;
|
||||
_Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s.__buf));
|
||||
_Tp * __ret = static_cast<_Tp*>(static_cast<void*>(&__dest.__s_.__buf));
|
||||
_ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
|
||||
__dest.__h = &_SmallHandler::__handle;
|
||||
__dest.__h_ = &_SmallHandler::__handle;
|
||||
return *__ret;
|
||||
}
|
||||
|
||||
|
@ -394,21 +394,21 @@ namespace __any_imp
|
|||
typedef allocator<_Tp> _Alloc;
|
||||
typedef allocator_traits<_Alloc> _ATraits;
|
||||
_Alloc __a;
|
||||
_Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s.__buf));
|
||||
_Tp * __p = static_cast<_Tp *>(static_cast<void*>(&__this.__s_.__buf));
|
||||
_ATraits::destroy(__a, __p);
|
||||
__this.__h = nullptr;
|
||||
__this.__h_ = nullptr;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __copy(any const & __this, any & __dest) {
|
||||
_SmallHandler::__create(__dest, *static_cast<_Tp const *>(
|
||||
static_cast<void const *>(&__this.__s.__buf)));
|
||||
static_cast<void const *>(&__this.__s_.__buf)));
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __move(any & __this, any & __dest) {
|
||||
_SmallHandler::__create(__dest, _VSTD::move(
|
||||
*static_cast<_Tp*>(static_cast<void*>(&__this.__s.__buf))));
|
||||
*static_cast<_Tp*>(static_cast<void*>(&__this.__s_.__buf))));
|
||||
__destroy(__this);
|
||||
}
|
||||
|
||||
|
@ -418,7 +418,7 @@ namespace __any_imp
|
|||
const void* __fallback_id)
|
||||
{
|
||||
if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_id))
|
||||
return static_cast<void*>(&__this.__s.__buf);
|
||||
return static_cast<void*>(&__this.__s_.__buf);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -470,8 +470,8 @@ namespace __any_imp
|
|||
unique_ptr<_Tp, _Dp> __hold(_ATraits::allocate(__a, 1), _Dp(__a, 1));
|
||||
_Tp * __ret = __hold.get();
|
||||
_ATraits::construct(__a, __ret, _VSTD::forward<_Args>(__args)...);
|
||||
__dest.__s.__ptr = __hold.release();
|
||||
__dest.__h = &_LargeHandler::__handle;
|
||||
__dest.__s_.__ptr = __hold.release();
|
||||
__dest.__h_ = &_LargeHandler::__handle;
|
||||
return *__ret;
|
||||
}
|
||||
|
||||
|
@ -482,22 +482,22 @@ namespace __any_imp
|
|||
typedef allocator<_Tp> _Alloc;
|
||||
typedef allocator_traits<_Alloc> _ATraits;
|
||||
_Alloc __a;
|
||||
_Tp * __p = static_cast<_Tp *>(__this.__s.__ptr);
|
||||
_Tp * __p = static_cast<_Tp *>(__this.__s_.__ptr);
|
||||
_ATraits::destroy(__a, __p);
|
||||
_ATraits::deallocate(__a, __p, 1);
|
||||
__this.__h = nullptr;
|
||||
__this.__h_ = nullptr;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __copy(any const & __this, any & __dest) {
|
||||
_LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s.__ptr));
|
||||
_LargeHandler::__create(__dest, *static_cast<_Tp const *>(__this.__s_.__ptr));
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
static void __move(any & __this, any & __dest) {
|
||||
__dest.__s.__ptr = __this.__s.__ptr;
|
||||
__dest.__h = &_LargeHandler::__handle;
|
||||
__this.__h = nullptr;
|
||||
__dest.__s_.__ptr = __this.__s_.__ptr;
|
||||
__dest.__h_ = &_LargeHandler::__handle;
|
||||
__this.__h_ = nullptr;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -505,7 +505,7 @@ namespace __any_imp
|
|||
void const* __fallback_info)
|
||||
{
|
||||
if (__any_imp::__compare_typeid<_Tp>(__info, __fallback_info))
|
||||
return static_cast<void*>(__this.__s.__ptr);
|
||||
return static_cast<void*>(__this.__s_.__ptr);
|
||||
return nullptr;
|
||||
|
||||
}
|
||||
|
@ -525,7 +525,7 @@ namespace __any_imp
|
|||
|
||||
|
||||
template <class _ValueType, class _Tp, class>
|
||||
any::any(_ValueType && __v) : __h(nullptr)
|
||||
any::any(_ValueType && __v) : __h_(nullptr)
|
||||
{
|
||||
__any_imp::_Handler<_Tp>::__create(*this, _VSTD::forward<_ValueType>(__v));
|
||||
}
|
||||
|
@ -567,16 +567,16 @@ void any::swap(any & __rhs) _NOEXCEPT
|
|||
{
|
||||
if (this == &__rhs)
|
||||
return;
|
||||
if (__h && __rhs.__h) {
|
||||
if (__h_ && __rhs.__h_) {
|
||||
any __tmp;
|
||||
__rhs.__call(_Action::_Move, &__tmp);
|
||||
this->__call(_Action::_Move, &__rhs);
|
||||
__tmp.__call(_Action::_Move, this);
|
||||
}
|
||||
else if (__h) {
|
||||
else if (__h_) {
|
||||
this->__call(_Action::_Move, &__rhs);
|
||||
}
|
||||
else if (__rhs.__h) {
|
||||
else if (__rhs.__h_) {
|
||||
__rhs.__call(_Action::_Move, this);
|
||||
}
|
||||
}
|
||||
|
@ -677,7 +677,7 @@ any_cast(any * __any) _NOEXCEPT
|
|||
static_assert(!is_reference<_ValueType>::value,
|
||||
"_ValueType may not be a reference.");
|
||||
typedef typename add_pointer<_ValueType>::type _ReturnType;
|
||||
if (__any && __any->__h) {
|
||||
if (__any && __any->__h_) {
|
||||
void *__p = __any->__call(_Action::_Get, nullptr,
|
||||
#if !defined(_LIBCPP_NO_RTTI)
|
||||
&typeid(_ValueType),
|
||||
|
|
|
@ -283,7 +283,7 @@ public:
|
|||
template<class _CompletionF = __empty_completion>
|
||||
class barrier {
|
||||
|
||||
__barrier_base<_CompletionF> __b;
|
||||
__barrier_base<_CompletionF> __b_;
|
||||
public:
|
||||
using arrival_token = typename __barrier_base<_CompletionF>::arrival_token;
|
||||
|
||||
|
@ -293,7 +293,7 @@ public:
|
|||
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
barrier(ptrdiff_t __count, _CompletionF __completion = _CompletionF())
|
||||
: __b(__count, _VSTD::move(__completion)) {
|
||||
: __b_(__count, _VSTD::move(__completion)) {
|
||||
}
|
||||
|
||||
barrier(barrier const&) = delete;
|
||||
|
@ -302,12 +302,12 @@ public:
|
|||
[[nodiscard]] _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
arrival_token arrive(ptrdiff_t __update = 1)
|
||||
{
|
||||
return __b.arrive(__update);
|
||||
return __b_.arrive(__update);
|
||||
}
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void wait(arrival_token&& __phase) const
|
||||
{
|
||||
__b.wait(_VSTD::move(__phase));
|
||||
__b_.wait(_VSTD::move(__phase));
|
||||
}
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void arrive_and_wait()
|
||||
|
@ -317,7 +317,7 @@ public:
|
|||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void arrive_and_drop()
|
||||
{
|
||||
__b.arrive_and_drop();
|
||||
__b_.arrive_and_drop();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -81,9 +81,9 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf8<wchar_t>
|
||||
: public codecvt<wchar_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
unsigned long __maxcode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
codecvt_mode _Mode_;
|
||||
codecvt_mode __mode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
public:
|
||||
typedef wchar_t intern_type;
|
||||
|
@ -94,8 +94,8 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
protected:
|
||||
result do_out(state_type& __st,
|
||||
|
@ -118,8 +118,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf8<char16_t>
|
||||
: public codecvt<char16_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char16_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -128,8 +128,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -152,8 +152,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf8<char32_t>
|
||||
: public codecvt<char32_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char32_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -162,8 +162,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf8(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -206,9 +206,9 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, false>
|
||||
: public codecvt<wchar_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
unsigned long __maxcode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
codecvt_mode _Mode_;
|
||||
codecvt_mode __mode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
public:
|
||||
typedef wchar_t intern_type;
|
||||
|
@ -219,8 +219,8 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
protected:
|
||||
result do_out(state_type& __st,
|
||||
|
@ -242,9 +242,9 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf16<wchar_t, true>
|
||||
: public codecvt<wchar_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
unsigned long __maxcode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
codecvt_mode _Mode_;
|
||||
codecvt_mode __mode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
public:
|
||||
typedef wchar_t intern_type;
|
||||
|
@ -255,8 +255,8 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
protected:
|
||||
result do_out(state_type& __st,
|
||||
|
@ -279,8 +279,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, false>
|
||||
: public codecvt<char16_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char16_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -289,8 +289,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -313,8 +313,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf16<char16_t, true>
|
||||
: public codecvt<char16_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char16_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -323,8 +323,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -347,8 +347,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, false>
|
||||
: public codecvt<char32_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char32_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -357,8 +357,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -381,8 +381,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf16<char32_t, true>
|
||||
: public codecvt<char32_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char32_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -391,8 +391,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -435,9 +435,9 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<wchar_t>
|
||||
: public codecvt<wchar_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
unsigned long __maxcode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
codecvt_mode _Mode_;
|
||||
codecvt_mode __mode_;
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
public:
|
||||
typedef wchar_t intern_type;
|
||||
|
@ -448,8 +448,8 @@ _LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<wchar_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
protected:
|
||||
result do_out(state_type& __st,
|
||||
|
@ -472,8 +472,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char32_t>
|
||||
: public codecvt<char32_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char32_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -482,8 +482,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char32_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
@ -506,8 +506,8 @@ template <>
|
|||
class _LIBCPP_TYPE_VIS __codecvt_utf8_utf16<char16_t>
|
||||
: public codecvt<char16_t, char, mbstate_t>
|
||||
{
|
||||
unsigned long _Maxcode_;
|
||||
codecvt_mode _Mode_;
|
||||
unsigned long __maxcode_;
|
||||
codecvt_mode __mode_;
|
||||
public:
|
||||
typedef char16_t intern_type;
|
||||
typedef char extern_type;
|
||||
|
@ -516,8 +516,8 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY
|
||||
explicit __codecvt_utf8_utf16(size_t __refs, unsigned long __maxcode,
|
||||
codecvt_mode __mode)
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), _Maxcode_(__maxcode),
|
||||
_Mode_(__mode) {}
|
||||
: codecvt<char16_t, char, mbstate_t>(__refs), __maxcode_(__maxcode),
|
||||
__mode_(__mode) {}
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_POP
|
||||
|
||||
protected:
|
||||
|
|
|
@ -116,11 +116,11 @@ struct __std_exception_data {
|
|||
|
||||
class exception { // base of all library exceptions
|
||||
public:
|
||||
exception() _NOEXCEPT : _Data() {}
|
||||
exception() _NOEXCEPT : __data_() {}
|
||||
|
||||
explicit exception(char const* __message) _NOEXCEPT : _Data() {
|
||||
_Data._What = __message;
|
||||
_Data._DoFree = true;
|
||||
explicit exception(char const* __message) _NOEXCEPT : __data_() {
|
||||
__data_._What = __message;
|
||||
__data_._DoFree = true;
|
||||
}
|
||||
|
||||
exception(exception const&) _NOEXCEPT {}
|
||||
|
@ -129,10 +129,10 @@ public:
|
|||
|
||||
virtual ~exception() _NOEXCEPT {}
|
||||
|
||||
virtual char const* what() const _NOEXCEPT { return _Data._What ? _Data._What : "Unknown exception"; }
|
||||
virtual char const* what() const _NOEXCEPT { return __data_._What ? __data_._What : "Unknown exception"; }
|
||||
|
||||
private:
|
||||
__std_exception_data _Data;
|
||||
__std_exception_data __data_;
|
||||
};
|
||||
|
||||
class bad_exception : public exception {
|
||||
|
|
|
@ -132,24 +132,24 @@ class _BMSkipTable<_Key, _Value, _Hash, _BinaryPredicate, false> {
|
|||
typedef _Key key_type;
|
||||
|
||||
const _Value __default_value_;
|
||||
std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table;
|
||||
std::unordered_map<_Key, _Value, _Hash, _BinaryPredicate> __table_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_BMSkipTable(size_t __sz, _Value __default, _Hash __hf, _BinaryPredicate __pred)
|
||||
: __default_value_(__default), __table(__sz, __hf, __pred) {}
|
||||
: __default_value_(__default), __table_(__sz, __hf, __pred) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(const key_type &__key, value_type __val)
|
||||
{
|
||||
__table [__key] = __val; // Would skip_.insert (val) be better here?
|
||||
__table_ [__key] = __val; // Would skip_.insert (val) be better here?
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type operator [](const key_type & __key) const
|
||||
{
|
||||
auto __it = __table.find (__key);
|
||||
return __it == __table.end() ? __default_value_ : __it->second;
|
||||
auto __it = __table_.find (__key);
|
||||
return __it == __table_.end() ? __default_value_ : __it->second;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -163,25 +163,25 @@ private:
|
|||
|
||||
typedef typename make_unsigned<key_type>::type unsigned_key_type;
|
||||
typedef std::array<value_type, 256> skip_map;
|
||||
skip_map __table;
|
||||
skip_map __table_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
_BMSkipTable(size_t /*__sz*/, _Value __default, _Hash /*__hf*/, _BinaryPredicate /*__pred*/)
|
||||
{
|
||||
std::fill_n(__table.begin(), __table.size(), __default);
|
||||
std::fill_n(__table_.begin(), __table_.size(), __default);
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
void insert(key_type __key, value_type __val)
|
||||
{
|
||||
__table[static_cast<unsigned_key_type>(__key)] = __val;
|
||||
__table_[static_cast<unsigned_key_type>(__key)] = __val;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type operator [](key_type __key) const
|
||||
{
|
||||
return __table[static_cast<unsigned_key_type>(__key)];
|
||||
return __table_[static_cast<unsigned_key_type>(__key)];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -82,19 +82,19 @@ public:
|
|||
typedef void reference;
|
||||
|
||||
ostream_joiner(ostream_type& __os, _Delim&& __d)
|
||||
: __output_iter(_VSTD::addressof(__os)), __delim(_VSTD::move(__d)), __first(true) {}
|
||||
: __output_iter_(_VSTD::addressof(__os)), __delim_(_VSTD::move(__d)), __first_(true) {}
|
||||
|
||||
ostream_joiner(ostream_type& __os, const _Delim& __d)
|
||||
: __output_iter(_VSTD::addressof(__os)), __delim(__d), __first(true) {}
|
||||
: __output_iter_(_VSTD::addressof(__os)), __delim_(__d), __first_(true) {}
|
||||
|
||||
|
||||
template<typename _Tp>
|
||||
ostream_joiner& operator=(const _Tp& __v)
|
||||
{
|
||||
if (!__first)
|
||||
*__output_iter << __delim;
|
||||
__first = false;
|
||||
*__output_iter << __v;
|
||||
if (!__first_)
|
||||
*__output_iter_ << __delim_;
|
||||
__first_ = false;
|
||||
*__output_iter_ << __v;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -103,9 +103,9 @@ public:
|
|||
ostream_joiner& operator++(int) _NOEXCEPT { return *this; }
|
||||
|
||||
private:
|
||||
ostream_type* __output_iter;
|
||||
_Delim __delim;
|
||||
bool __first;
|
||||
ostream_type* __output_iter_;
|
||||
_Delim __delim_;
|
||||
bool __first_;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
|||
|
||||
class latch
|
||||
{
|
||||
__atomic_base<ptrdiff_t> __a;
|
||||
__atomic_base<ptrdiff_t> __a_;
|
||||
|
||||
public:
|
||||
static constexpr ptrdiff_t max() noexcept {
|
||||
|
@ -72,7 +72,7 @@ public:
|
|||
}
|
||||
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit latch(ptrdiff_t __expected) : __a(__expected) { }
|
||||
constexpr explicit latch(ptrdiff_t __expected) : __a_(__expected) { }
|
||||
|
||||
~latch() = default;
|
||||
latch(const latch&) = delete;
|
||||
|
@ -81,19 +81,19 @@ public:
|
|||
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void count_down(ptrdiff_t __update = 1)
|
||||
{
|
||||
auto const __old = __a.fetch_sub(__update, memory_order_release);
|
||||
auto const __old = __a_.fetch_sub(__update, memory_order_release);
|
||||
if(__old == __update)
|
||||
__a.notify_all();
|
||||
__a_.notify_all();
|
||||
}
|
||||
inline _LIBCPP_INLINE_VISIBILITY
|
||||
bool try_wait() const noexcept
|
||||
{
|
||||
return 0 == __a.load(memory_order_acquire);
|
||||
return 0 == __a_.load(memory_order_acquire);
|
||||
}
|
||||
inline _LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void wait() const
|
||||
{
|
||||
__cxx_atomic_wait(&__a.__a_, [&]() -> bool {
|
||||
__cxx_atomic_wait(&__a_.__a_, [&]() -> bool {
|
||||
return try_wait();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -619,46 +619,46 @@ public:
|
|||
template <class _Key, class _CP, class _Compare>
|
||||
class __map_value_compare<_Key, _CP, _Compare, false>
|
||||
{
|
||||
_Compare comp;
|
||||
_Compare __comp_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_value_compare()
|
||||
_NOEXCEPT_(is_nothrow_default_constructible<_Compare>::value)
|
||||
: comp() {}
|
||||
: __comp_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
__map_value_compare(_Compare __c)
|
||||
_NOEXCEPT_(is_nothrow_copy_constructible<_Compare>::value)
|
||||
: comp(__c) {}
|
||||
: __comp_(__c) {}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const _Compare& key_comp() const _NOEXCEPT {return comp;}
|
||||
const _Compare& key_comp() const _NOEXCEPT {return __comp_;}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _CP& __x, const _CP& __y) const
|
||||
{return comp(__x.__get_value().first, __y.__get_value().first);}
|
||||
{return __comp_(__x.__get_value().first, __y.__get_value().first);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _CP& __x, const _Key& __y) const
|
||||
{return comp(__x.__get_value().first, __y);}
|
||||
{return __comp_(__x.__get_value().first, __y);}
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _Key& __x, const _CP& __y) const
|
||||
{return comp(__x, __y.__get_value().first);}
|
||||
{return __comp_(__x, __y.__get_value().first);}
|
||||
void swap(__map_value_compare& __y)
|
||||
_NOEXCEPT_(__is_nothrow_swappable<_Compare>::value)
|
||||
{
|
||||
using _VSTD::swap;
|
||||
swap(comp, __y.comp);
|
||||
swap(__comp_, __y.__comp_);
|
||||
}
|
||||
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
template <typename _K2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _K2& __x, const _CP& __y) const
|
||||
{return comp(__x, __y.__get_value().first);}
|
||||
{return __comp_(__x, __y.__get_value().first);}
|
||||
|
||||
template <typename _K2>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
bool operator()(const _CP& __x, const _K2& __y) const
|
||||
{return comp(__x.__get_value().first, __y);}
|
||||
{return __comp_(__x.__get_value().first, __y);}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -738,16 +738,16 @@ struct _LIBCPP_STANDALONE_DEBUG __value_type
|
|||
typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type;
|
||||
|
||||
private:
|
||||
value_type __cc;
|
||||
value_type __cc_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type& __get_value()
|
||||
{
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc));
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc_));
|
||||
#else
|
||||
return __cc;
|
||||
return __cc_;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -755,9 +755,9 @@ public:
|
|||
const value_type& __get_value() const
|
||||
{
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc));
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc_));
|
||||
#else
|
||||
return __cc;
|
||||
return __cc_;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -818,13 +818,13 @@ struct __value_type
|
|||
typedef pair<const key_type, mapped_type> value_type;
|
||||
|
||||
private:
|
||||
value_type __cc;
|
||||
value_type __cc_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type& __get_value() { return __cc; }
|
||||
value_type& __get_value() { return __cc_; }
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type& __get_value() const { return __cc; }
|
||||
const value_type& __get_value() const { return __cc_; }
|
||||
|
||||
private:
|
||||
__value_type();
|
||||
|
|
|
@ -80,31 +80,31 @@ functions. It avoids contention against users' own use of those facilities.
|
|||
|
||||
class __atomic_semaphore_base
|
||||
{
|
||||
__atomic_base<ptrdiff_t> __a;
|
||||
__atomic_base<ptrdiff_t> __a_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a(__count)
|
||||
constexpr explicit __atomic_semaphore_base(ptrdiff_t __count) : __a_(__count)
|
||||
{
|
||||
}
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void release(ptrdiff_t __update = 1)
|
||||
{
|
||||
if(0 < __a.fetch_add(__update, memory_order_release))
|
||||
if(0 < __a_.fetch_add(__update, memory_order_release))
|
||||
;
|
||||
else if(__update > 1)
|
||||
__a.notify_all();
|
||||
__a_.notify_all();
|
||||
else
|
||||
__a.notify_one();
|
||||
__a_.notify_one();
|
||||
}
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void acquire()
|
||||
{
|
||||
auto const __test_fn = [this]() -> bool {
|
||||
auto __old = __a.load(memory_order_relaxed);
|
||||
return (__old != 0) && __a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed);
|
||||
auto __old = __a_.load(memory_order_relaxed);
|
||||
return (__old != 0) && __a_.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed);
|
||||
};
|
||||
__cxx_atomic_wait(&__a.__a_, __test_fn);
|
||||
__cxx_atomic_wait(&__a_.__a_, __test_fn);
|
||||
}
|
||||
template <class Rep, class Period>
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
|
@ -118,11 +118,11 @@ public:
|
|||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
bool try_acquire()
|
||||
{
|
||||
auto __old = __a.load(memory_order_acquire);
|
||||
auto __old = __a_.load(memory_order_acquire);
|
||||
while (true) {
|
||||
if (__old == 0)
|
||||
return false;
|
||||
if (__a.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed))
|
||||
if (__a_.compare_exchange_strong(__old, __old - 1, memory_order_acquire, memory_order_relaxed))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ public:
|
|||
template<ptrdiff_t __least_max_value = _LIBCPP_SEMAPHORE_MAX>
|
||||
class counting_semaphore
|
||||
{
|
||||
__atomic_semaphore_base __semaphore;
|
||||
__atomic_semaphore_base __semaphore_;
|
||||
|
||||
public:
|
||||
static constexpr ptrdiff_t max() noexcept {
|
||||
|
@ -141,7 +141,7 @@ public:
|
|||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore(__count) { }
|
||||
constexpr explicit counting_semaphore(ptrdiff_t __count) : __semaphore_(__count) { }
|
||||
~counting_semaphore() = default;
|
||||
|
||||
counting_semaphore(const counting_semaphore&) = delete;
|
||||
|
@ -150,23 +150,23 @@ public:
|
|||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void release(ptrdiff_t __update = 1)
|
||||
{
|
||||
__semaphore.release(__update);
|
||||
__semaphore_.release(__update);
|
||||
}
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
void acquire()
|
||||
{
|
||||
__semaphore.acquire();
|
||||
__semaphore_.acquire();
|
||||
}
|
||||
template<class Rep, class Period>
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
bool try_acquire_for(chrono::duration<Rep, Period> const& __rel_time)
|
||||
{
|
||||
return __semaphore.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time));
|
||||
return __semaphore_.try_acquire_for(chrono::duration_cast<chrono::nanoseconds>(__rel_time));
|
||||
}
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
bool try_acquire()
|
||||
{
|
||||
return __semaphore.try_acquire();
|
||||
return __semaphore_.try_acquire();
|
||||
}
|
||||
template <class Clock, class Duration>
|
||||
_LIBCPP_AVAILABILITY_SYNC _LIBCPP_INLINE_VISIBILITY
|
||||
|
|
|
@ -180,23 +180,23 @@ __shared_mutex_base
|
|||
#if _LIBCPP_STD_VER > 14
|
||||
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_mutex
|
||||
{
|
||||
__shared_mutex_base __base;
|
||||
__shared_mutex_base __base_;
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY shared_mutex() : __base() {}
|
||||
_LIBCPP_INLINE_VISIBILITY shared_mutex() : __base_() {}
|
||||
_LIBCPP_INLINE_VISIBILITY ~shared_mutex() = default;
|
||||
|
||||
shared_mutex(const shared_mutex&) = delete;
|
||||
shared_mutex& operator=(const shared_mutex&) = delete;
|
||||
|
||||
// Exclusive ownership
|
||||
_LIBCPP_INLINE_VISIBILITY void lock() { return __base.lock(); }
|
||||
_LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base.try_lock(); }
|
||||
_LIBCPP_INLINE_VISIBILITY void unlock() { return __base.unlock(); }
|
||||
_LIBCPP_INLINE_VISIBILITY void lock() { return __base_.lock(); }
|
||||
_LIBCPP_INLINE_VISIBILITY bool try_lock() { return __base_.try_lock(); }
|
||||
_LIBCPP_INLINE_VISIBILITY void unlock() { return __base_.unlock(); }
|
||||
|
||||
// Shared ownership
|
||||
_LIBCPP_INLINE_VISIBILITY void lock_shared() { return __base.lock_shared(); }
|
||||
_LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base.try_lock_shared(); }
|
||||
_LIBCPP_INLINE_VISIBILITY void unlock_shared() { return __base.unlock_shared(); }
|
||||
_LIBCPP_INLINE_VISIBILITY void lock_shared() { return __base_.lock_shared(); }
|
||||
_LIBCPP_INLINE_VISIBILITY bool try_lock_shared() { return __base_.try_lock_shared(); }
|
||||
_LIBCPP_INLINE_VISIBILITY void unlock_shared() { return __base_.unlock_shared(); }
|
||||
|
||||
// typedef __shared_mutex_base::native_handle_type native_handle_type;
|
||||
// _LIBCPP_INLINE_VISIBILITY native_handle_type native_handle() { return __base::unlock_shared(); }
|
||||
|
@ -206,7 +206,7 @@ public:
|
|||
|
||||
class _LIBCPP_TYPE_VIS _LIBCPP_AVAILABILITY_SHARED_MUTEX shared_timed_mutex
|
||||
{
|
||||
__shared_mutex_base __base;
|
||||
__shared_mutex_base __base_;
|
||||
public:
|
||||
shared_timed_mutex();
|
||||
_LIBCPP_INLINE_VISIBILITY ~shared_timed_mutex() = default;
|
||||
|
@ -252,30 +252,30 @@ bool
|
|||
shared_timed_mutex::try_lock_until(
|
||||
const chrono::time_point<_Clock, _Duration>& __abs_time)
|
||||
{
|
||||
unique_lock<mutex> __lk(__base.__mut_);
|
||||
if (__base.__state_ & __base.__write_entered_)
|
||||
unique_lock<mutex> __lk(__base_.__mut_);
|
||||
if (__base_.__state_ & __base_.__write_entered_)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
cv_status __status = __base.__gate1_.wait_until(__lk, __abs_time);
|
||||
if ((__base.__state_ & __base.__write_entered_) == 0)
|
||||
cv_status __status = __base_.__gate1_.wait_until(__lk, __abs_time);
|
||||
if ((__base_.__state_ & __base_.__write_entered_) == 0)
|
||||
break;
|
||||
if (__status == cv_status::timeout)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
__base.__state_ |= __base.__write_entered_;
|
||||
if (__base.__state_ & __base.__n_readers_)
|
||||
__base_.__state_ |= __base_.__write_entered_;
|
||||
if (__base_.__state_ & __base_.__n_readers_)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
cv_status __status = __base.__gate2_.wait_until(__lk, __abs_time);
|
||||
if ((__base.__state_ & __base.__n_readers_) == 0)
|
||||
cv_status __status = __base_.__gate2_.wait_until(__lk, __abs_time);
|
||||
if ((__base_.__state_ & __base_.__n_readers_) == 0)
|
||||
break;
|
||||
if (__status == cv_status::timeout)
|
||||
{
|
||||
__base.__state_ &= ~__base.__write_entered_;
|
||||
__base.__gate1_.notify_all();
|
||||
__base_.__state_ &= ~__base_.__write_entered_;
|
||||
__base_.__gate1_.notify_all();
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -288,22 +288,22 @@ bool
|
|||
shared_timed_mutex::try_lock_shared_until(
|
||||
const chrono::time_point<_Clock, _Duration>& __abs_time)
|
||||
{
|
||||
unique_lock<mutex> __lk(__base.__mut_);
|
||||
if ((__base.__state_ & __base.__write_entered_) || (__base.__state_ & __base.__n_readers_) == __base.__n_readers_)
|
||||
unique_lock<mutex> __lk(__base_.__mut_);
|
||||
if ((__base_.__state_ & __base_.__write_entered_) || (__base_.__state_ & __base_.__n_readers_) == __base_.__n_readers_)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
cv_status status = __base.__gate1_.wait_until(__lk, __abs_time);
|
||||
if ((__base.__state_ & __base.__write_entered_) == 0 &&
|
||||
(__base.__state_ & __base.__n_readers_) < __base.__n_readers_)
|
||||
cv_status status = __base_.__gate1_.wait_until(__lk, __abs_time);
|
||||
if ((__base_.__state_ & __base_.__write_entered_) == 0 &&
|
||||
(__base_.__state_ & __base_.__n_readers_) < __base_.__n_readers_)
|
||||
break;
|
||||
if (status == cv_status::timeout)
|
||||
return false;
|
||||
}
|
||||
}
|
||||
unsigned __num_readers = (__base.__state_ & __base.__n_readers_) + 1;
|
||||
__base.__state_ &= ~__base.__n_readers_;
|
||||
__base.__state_ |= __num_readers;
|
||||
unsigned __num_readers = (__base_.__state_ & __base_.__n_readers_) + 1;
|
||||
__base_.__state_ &= ~__base_.__n_readers_;
|
||||
__base_.__state_ |= __num_readers;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -227,7 +227,7 @@ public:
|
|||
|
||||
// [span.cons], span constructors, copy, assignment, and destructor
|
||||
template <size_t _Sz = _Extent> requires(_Sz == 0)
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr} {}
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data_{nullptr} {}
|
||||
|
||||
constexpr span (const span&) noexcept = default;
|
||||
constexpr span& operator=(const span&) noexcept = default;
|
||||
|
@ -235,46 +235,46 @@ public:
|
|||
template <__span_compatible_iterator<element_type> _It>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit span(_It __first, size_type __count)
|
||||
: __data{_VSTD::to_address(__first)} {
|
||||
: __data_{_VSTD::to_address(__first)} {
|
||||
(void)__count;
|
||||
_LIBCPP_ASSERT(_Extent == __count, "size mismatch in span's constructor (iterator, len)");
|
||||
}
|
||||
|
||||
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit span(_It __first, _End __last) : __data{_VSTD::to_address(__first)} {
|
||||
constexpr explicit span(_It __first, _End __last) : __data_{_VSTD::to_address(__first)} {
|
||||
(void)__last;
|
||||
_LIBCPP_ASSERT((__last - __first >= 0), "invalid range in span's constructor (iterator, sentinel)");
|
||||
_LIBCPP_ASSERT(__last - __first == _Extent,
|
||||
"invalid range in span's constructor (iterator, sentinel): last - first != extent");
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data{__arr} {}
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span(type_identity_t<element_type> (&__arr)[_Extent]) noexcept : __data_{__arr} {}
|
||||
|
||||
template <__span_array_convertible<element_type> _OtherElementType>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {}
|
||||
constexpr span(array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {}
|
||||
|
||||
template <class _OtherElementType>
|
||||
requires __span_array_convertible<const _OtherElementType, element_type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data{__arr.data()} {}
|
||||
constexpr span(const array<_OtherElementType, _Extent>& __arr) noexcept : __data_{__arr.data()} {}
|
||||
|
||||
template <__span_compatible_range<element_type> _Range>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit span(_Range&& __r) : __data{ranges::data(__r)} {
|
||||
constexpr explicit span(_Range&& __r) : __data_{ranges::data(__r)} {
|
||||
_LIBCPP_ASSERT(ranges::size(__r) == _Extent, "size mismatch in span's constructor (range)");
|
||||
}
|
||||
|
||||
template <__span_array_convertible<element_type> _OtherElementType>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(const span<_OtherElementType, _Extent>& __other)
|
||||
: __data{__other.data()} {}
|
||||
: __data_{__other.data()} {}
|
||||
|
||||
template <__span_array_convertible<element_type> _OtherElementType>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr explicit span(const span<_OtherElementType, dynamic_extent>& __other) noexcept
|
||||
: __data{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); }
|
||||
: __data_{__other.data()} { _LIBCPP_ASSERT(_Extent == __other.size(), "size mismatch in span's constructor (other span)"); }
|
||||
|
||||
|
||||
// ~span() noexcept = default;
|
||||
|
@ -341,22 +341,22 @@ public:
|
|||
_LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
|
||||
{
|
||||
_LIBCPP_ASSERT(__idx < size(), "span<T, N>::operator[](index): index out of range");
|
||||
return __data[__idx];
|
||||
return __data_[__idx];
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
|
||||
{
|
||||
_LIBCPP_ASSERT(!empty(), "span<T, N>::front() on empty span");
|
||||
return __data[0];
|
||||
return __data_[0];
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
|
||||
{
|
||||
_LIBCPP_ASSERT(!empty(), "span<T, N>::back() on empty span");
|
||||
return __data[size()-1];
|
||||
return __data_[size()-1];
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; }
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data_; }
|
||||
|
||||
// [span.iter], span iterator support
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
|
||||
|
@ -383,7 +383,7 @@ public:
|
|||
{ return span<byte, _Extent * sizeof(element_type)>{reinterpret_cast<byte *>(data()), size_bytes()}; }
|
||||
|
||||
private:
|
||||
pointer __data;
|
||||
pointer __data_;
|
||||
};
|
||||
|
||||
|
||||
|
@ -409,7 +409,7 @@ public:
|
|||
static constexpr size_type extent = dynamic_extent;
|
||||
|
||||
// [span.cons], span constructors, copy, assignment, and destructor
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data{nullptr}, __size{0} {}
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span() noexcept : __data_{nullptr}, __size_{0} {}
|
||||
|
||||
constexpr span (const span&) noexcept = default;
|
||||
constexpr span& operator=(const span&) noexcept = default;
|
||||
|
@ -417,35 +417,35 @@ public:
|
|||
template <__span_compatible_iterator<element_type> _It>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(_It __first, size_type __count)
|
||||
: __data{_VSTD::to_address(__first)}, __size{__count} {}
|
||||
: __data_{_VSTD::to_address(__first)}, __size_{__count} {}
|
||||
|
||||
template <__span_compatible_iterator<element_type> _It, __span_compatible_sentinel_for<_It> _End>
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr span(_It __first, _End __last)
|
||||
: __data(_VSTD::to_address(__first)), __size(__last - __first) {
|
||||
: __data_(_VSTD::to_address(__first)), __size_(__last - __first) {
|
||||
_LIBCPP_ASSERT(__last - __first >= 0, "invalid range in span's constructor (iterator, sentinel)");
|
||||
}
|
||||
|
||||
template <size_t _Sz>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(type_identity_t<element_type> (&__arr)[_Sz]) noexcept : __data{__arr}, __size{_Sz} {}
|
||||
constexpr span(type_identity_t<element_type> (&__arr)[_Sz]) noexcept : __data_{__arr}, __size_{_Sz} {}
|
||||
|
||||
template <__span_array_convertible<element_type> _OtherElementType, size_t _Sz>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
|
||||
constexpr span(array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()}, __size_{_Sz} {}
|
||||
|
||||
template <class _OtherElementType, size_t _Sz>
|
||||
requires __span_array_convertible<const _OtherElementType, element_type>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data{__arr.data()}, __size{_Sz} {}
|
||||
constexpr span(const array<_OtherElementType, _Sz>& __arr) noexcept : __data_{__arr.data()}, __size_{_Sz} {}
|
||||
|
||||
template <__span_compatible_range<element_type> _Range>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(_Range&& __r) : __data(ranges::data(__r)), __size{ranges::size(__r)} {}
|
||||
constexpr span(_Range&& __r) : __data_(ranges::data(__r)), __size_{ranges::size(__r)} {}
|
||||
|
||||
template <__span_array_convertible<element_type> _OtherElementType, size_t _OtherExtent>
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
constexpr span(const span<_OtherElementType, _OtherExtent>& __other) noexcept
|
||||
: __data{__other.data()}, __size{__other.size()} {}
|
||||
: __data_{__other.data()}, __size_{__other.size()} {}
|
||||
|
||||
// ~span() noexcept = default;
|
||||
|
||||
|
@ -500,30 +500,30 @@ public:
|
|||
return {data() + __offset, __count};
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr size_type size() const noexcept { return __size; }
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes() const noexcept { return __size * sizeof(element_type); }
|
||||
[[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size == 0; }
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr size_type size() const noexcept { return __size_; }
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr size_type size_bytes() const noexcept { return __size_ * sizeof(element_type); }
|
||||
[[nodiscard]] _LIBCPP_INLINE_VISIBILITY constexpr bool empty() const noexcept { return __size_ == 0; }
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr reference operator[](size_type __idx) const noexcept
|
||||
{
|
||||
_LIBCPP_ASSERT(__idx < size(), "span<T>::operator[](index): index out of range");
|
||||
return __data[__idx];
|
||||
return __data_[__idx];
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr reference front() const noexcept
|
||||
{
|
||||
_LIBCPP_ASSERT(!empty(), "span<T>::front() on empty span");
|
||||
return __data[0];
|
||||
return __data_[0];
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr reference back() const noexcept
|
||||
{
|
||||
_LIBCPP_ASSERT(!empty(), "span<T>::back() on empty span");
|
||||
return __data[size()-1];
|
||||
return __data_[size()-1];
|
||||
}
|
||||
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data; }
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr pointer data() const noexcept { return __data_; }
|
||||
|
||||
// [span.iter], span iterator support
|
||||
_LIBCPP_INLINE_VISIBILITY constexpr iterator begin() const noexcept {
|
||||
|
@ -550,8 +550,8 @@ public:
|
|||
{ return {reinterpret_cast<byte *>(data()), size_bytes()}; }
|
||||
|
||||
private:
|
||||
pointer __data;
|
||||
size_type __size;
|
||||
pointer __data_;
|
||||
size_type __size_;
|
||||
};
|
||||
|
||||
template <class _Tp, size_t _Extent>
|
||||
|
|
|
@ -295,7 +295,7 @@ public:
|
|||
|
||||
// [string.view.cons], construct/copy
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
basic_string_view() _NOEXCEPT : __data (nullptr), __size(0) {}
|
||||
basic_string_view() _NOEXCEPT : __data_ (nullptr), __size_(0) {}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
basic_string_view(const basic_string_view&) _NOEXCEPT = default;
|
||||
|
@ -305,7 +305,7 @@ public:
|
|||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
basic_string_view(const _CharT* __s, size_type __len) _NOEXCEPT
|
||||
: __data(__s), __size(__len)
|
||||
: __data_(__s), __size_(__len)
|
||||
{
|
||||
#if _LIBCPP_STD_VER > 11
|
||||
_LIBCPP_ASSERT(__len == 0 || __s != nullptr, "string_view::string_view(_CharT *, size_t): received nullptr");
|
||||
|
@ -316,7 +316,7 @@ public:
|
|||
template <contiguous_iterator _It, sized_sentinel_for<_It> _End>
|
||||
requires (is_same_v<iter_value_t<_It>, _CharT> && !is_convertible_v<_End, size_type>)
|
||||
constexpr _LIBCPP_HIDE_FROM_ABI basic_string_view(_It __begin, _End __end)
|
||||
: __data(_VSTD::to_address(__begin)), __size(__end - __begin)
|
||||
: __data_(_VSTD::to_address(__begin)), __size_(__end - __begin)
|
||||
{
|
||||
_LIBCPP_ASSERT((__end - __begin) >= 0, "std::string_view::string_view(iterator, sentinel) received invalid range");
|
||||
}
|
||||
|
@ -338,12 +338,12 @@ public:
|
|||
} || is_same_v<typename remove_reference_t<_Range>::traits_type, _Traits>)
|
||||
)
|
||||
constexpr explicit _LIBCPP_HIDE_FROM_ABI
|
||||
basic_string_view(_Range&& __r) : __data(ranges::data(__r)), __size(ranges::size(__r)) {}
|
||||
basic_string_view(_Range&& __r) : __data_(ranges::data(__r)), __size_(ranges::size(__r)) {}
|
||||
#endif // _LIBCPP_STD_VER > 20
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
basic_string_view(const _CharT* __s)
|
||||
: __data(__s), __size(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
|
||||
: __data_(__s), __size_(_VSTD::__char_traits_length_checked<_Traits>(__s)) {}
|
||||
|
||||
#if _LIBCPP_STD_VER > 20
|
||||
basic_string_view(nullptr_t) = delete;
|
||||
|
@ -357,10 +357,10 @@ public:
|
|||
const_iterator end() const _NOEXCEPT { return cend(); }
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cbegin() const _NOEXCEPT { return __data; }
|
||||
const_iterator cbegin() const _NOEXCEPT { return __data_; }
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_iterator cend() const _NOEXCEPT { return __data + __size; }
|
||||
const_iterator cend() const _NOEXCEPT { return __data_ + __size_; }
|
||||
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX17 _LIBCPP_INLINE_VISIBILITY
|
||||
const_reverse_iterator rbegin() const _NOEXCEPT { return const_reverse_iterator(cend()); }
|
||||
|
@ -376,72 +376,72 @@ public:
|
|||
|
||||
// [string.view.capacity], capacity
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
size_type size() const _NOEXCEPT { return __size; }
|
||||
size_type size() const _NOEXCEPT { return __size_; }
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
size_type length() const _NOEXCEPT { return __size; }
|
||||
size_type length() const _NOEXCEPT { return __size_; }
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
size_type max_size() const _NOEXCEPT { return numeric_limits<size_type>::max() / sizeof(value_type); }
|
||||
|
||||
_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR
|
||||
bool empty() const _NOEXCEPT { return __size == 0; }
|
||||
bool empty() const _NOEXCEPT { return __size_ == 0; }
|
||||
|
||||
// [string.view.access], element access
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_reference operator[](size_type __pos) const _NOEXCEPT {
|
||||
return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data[__pos];
|
||||
return _LIBCPP_ASSERT(__pos < size(), "string_view[] index out of bounds"), __data_[__pos];
|
||||
}
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_reference at(size_type __pos) const
|
||||
{
|
||||
return __pos >= size()
|
||||
? (__throw_out_of_range("string_view::at"), __data[0])
|
||||
: __data[__pos];
|
||||
? (__throw_out_of_range("string_view::at"), __data_[0])
|
||||
: __data_[__pos];
|
||||
}
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_reference front() const _NOEXCEPT
|
||||
{
|
||||
return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data[0];
|
||||
return _LIBCPP_ASSERT(!empty(), "string_view::front(): string is empty"), __data_[0];
|
||||
}
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_reference back() const _NOEXCEPT
|
||||
{
|
||||
return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data[__size-1];
|
||||
return _LIBCPP_ASSERT(!empty(), "string_view::back(): string is empty"), __data_[__size_-1];
|
||||
}
|
||||
|
||||
_LIBCPP_CONSTEXPR _LIBCPP_INLINE_VISIBILITY
|
||||
const_pointer data() const _NOEXCEPT { return __data; }
|
||||
const_pointer data() const _NOEXCEPT { return __data_; }
|
||||
|
||||
// [string.view.modifiers], modifiers:
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
|
||||
void remove_prefix(size_type __n) _NOEXCEPT
|
||||
{
|
||||
_LIBCPP_ASSERT(__n <= size(), "remove_prefix() can't remove more than size()");
|
||||
__data += __n;
|
||||
__size -= __n;
|
||||
__data_ += __n;
|
||||
__size_ -= __n;
|
||||
}
|
||||
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
|
||||
void remove_suffix(size_type __n) _NOEXCEPT
|
||||
{
|
||||
_LIBCPP_ASSERT(__n <= size(), "remove_suffix() can't remove more than size()");
|
||||
__size -= __n;
|
||||
__size_ -= __n;
|
||||
}
|
||||
|
||||
_LIBCPP_CONSTEXPR_SINCE_CXX14 _LIBCPP_INLINE_VISIBILITY
|
||||
void swap(basic_string_view& __other) _NOEXCEPT
|
||||
{
|
||||
const value_type *__p = __data;
|
||||
__data = __other.__data;
|
||||
__other.__data = __p;
|
||||
const value_type *__p = __data_;
|
||||
__data_ = __other.__data_;
|
||||
__other.__data_ = __p;
|
||||
|
||||
size_type __sz = __size;
|
||||
__size = __other.__size;
|
||||
__other.__size = __sz;
|
||||
size_type __sz = __size_;
|
||||
__size_ = __other.__size_;
|
||||
__other.__size_ = __sz;
|
||||
}
|
||||
|
||||
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
|
||||
|
@ -729,8 +729,8 @@ public:
|
|||
#endif
|
||||
|
||||
private:
|
||||
const value_type* __data;
|
||||
size_type __size;
|
||||
const value_type* __data_;
|
||||
size_type __size_;
|
||||
};
|
||||
|
||||
#if _LIBCPP_STD_VER > 17
|
||||
|
|
|
@ -822,16 +822,16 @@ struct _LIBCPP_STANDALONE_DEBUG __hash_value_type
|
|||
typedef pair<key_type&&, mapped_type&&> __nc_rref_pair_type;
|
||||
|
||||
private:
|
||||
value_type __cc;
|
||||
value_type __cc_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type& __get_value()
|
||||
{
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc));
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc_));
|
||||
#else
|
||||
return __cc;
|
||||
return __cc_;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -839,9 +839,9 @@ public:
|
|||
const value_type& __get_value() const
|
||||
{
|
||||
#if _LIBCPP_STD_VER > 14
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc));
|
||||
return *_VSTD::launder(_VSTD::addressof(__cc_));
|
||||
#else
|
||||
return __cc;
|
||||
return __cc_;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -904,13 +904,13 @@ struct __hash_value_type
|
|||
typedef pair<const key_type, mapped_type> value_type;
|
||||
|
||||
private:
|
||||
value_type __cc;
|
||||
value_type __cc_;
|
||||
|
||||
public:
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
value_type& __get_value() { return __cc; }
|
||||
value_type& __get_value() { return __cc_; }
|
||||
_LIBCPP_INLINE_VISIBILITY
|
||||
const value_type& __get_value() const { return __cc; }
|
||||
const value_type& __get_value() const { return __cc_; }
|
||||
|
||||
private:
|
||||
~__hash_value_type();
|
||||
|
|
|
@ -490,7 +490,7 @@ struct __variant {
|
|||
template <size_t _Ip, class _Vp>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
static constexpr auto&& __get_alt(_Vp&& __v) {
|
||||
return __base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v).__impl);
|
||||
return __base::__get_alt<_Ip>(_VSTD::forward<_Vp>(__v).__impl_);
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -617,7 +617,7 @@ struct __variant {
|
|||
__visit_alt_at(size_t __index, _Visitor&& __visitor, _Vs&&... __vs) {
|
||||
return __base::__visit_alt_at(__index,
|
||||
_VSTD::forward<_Visitor>(__visitor),
|
||||
_VSTD::forward<_Vs>(__vs).__impl...);
|
||||
_VSTD::forward<_Vs>(__vs).__impl_...);
|
||||
}
|
||||
|
||||
template <class _Visitor, class... _Vs>
|
||||
|
@ -626,7 +626,7 @@ struct __variant {
|
|||
_Vs&&... __vs) {
|
||||
return __base::__visit_alt(
|
||||
_VSTD::forward<_Visitor>(__visitor),
|
||||
_VSTD::__as_variant(_VSTD::forward<_Vs>(__vs)).__impl...);
|
||||
_VSTD::__as_variant(_VSTD::forward<_Vs>(__vs)).__impl_...);
|
||||
}
|
||||
|
||||
template <class _Visitor, class... _Vs>
|
||||
|
@ -1309,7 +1309,7 @@ public:
|
|||
int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr variant() noexcept(is_nothrow_default_constructible_v<__first_type>)
|
||||
: __impl(in_place_index<0>) {}
|
||||
: __impl_(in_place_index<0>) {}
|
||||
|
||||
variant(const variant&) = default;
|
||||
variant(variant&&) = default;
|
||||
|
@ -1326,7 +1326,7 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr variant(_Arg&& __arg) noexcept(
|
||||
is_nothrow_constructible_v<_Tp, _Arg>)
|
||||
: __impl(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {}
|
||||
: __impl_(in_place_index<_Ip>, _VSTD::forward<_Arg>(__arg)) {}
|
||||
|
||||
template <size_t _Ip, class... _Args,
|
||||
class = enable_if_t<(_Ip < sizeof...(_Types)), int>,
|
||||
|
@ -1336,7 +1336,7 @@ public:
|
|||
explicit constexpr variant(
|
||||
in_place_index_t<_Ip>,
|
||||
_Args&&... __args) noexcept(is_nothrow_constructible_v<_Tp, _Args...>)
|
||||
: __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
|
||||
: __impl_(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
|
||||
|
||||
template <
|
||||
size_t _Ip,
|
||||
|
@ -1352,7 +1352,7 @@ public:
|
|||
initializer_list<_Up> __il,
|
||||
_Args&&... __args) noexcept(
|
||||
is_nothrow_constructible_v<_Tp, initializer_list<_Up>&, _Args...>)
|
||||
: __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
|
||||
: __impl_(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
|
||||
|
||||
template <
|
||||
class _Tp,
|
||||
|
@ -1363,7 +1363,7 @@ public:
|
|||
_LIBCPP_HIDE_FROM_ABI
|
||||
explicit constexpr variant(in_place_type_t<_Tp>, _Args&&... __args) noexcept(
|
||||
is_nothrow_constructible_v<_Tp, _Args...>)
|
||||
: __impl(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
|
||||
: __impl_(in_place_index<_Ip>, _VSTD::forward<_Args>(__args)...) {}
|
||||
|
||||
template <
|
||||
class _Tp,
|
||||
|
@ -1379,7 +1379,7 @@ public:
|
|||
initializer_list<_Up> __il,
|
||||
_Args&&... __args) noexcept(
|
||||
is_nothrow_constructible_v<_Tp, initializer_list< _Up>&, _Args...>)
|
||||
: __impl(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
|
||||
: __impl_(in_place_index<_Ip>, __il, _VSTD::forward<_Args>(__args)...) {}
|
||||
|
||||
~variant() = default;
|
||||
|
||||
|
@ -1398,7 +1398,7 @@ public:
|
|||
variant& operator=(_Arg&& __arg) noexcept(
|
||||
is_nothrow_assignable_v<_Tp&, _Arg> &&
|
||||
is_nothrow_constructible_v<_Tp, _Arg>) {
|
||||
__impl.template __assign<_Ip>(_VSTD::forward<_Arg>(__arg));
|
||||
__impl_.template __assign<_Ip>(_VSTD::forward<_Arg>(__arg));
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -1410,7 +1410,7 @@ public:
|
|||
enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
_Tp& emplace(_Args&&... __args) {
|
||||
return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
|
||||
return __impl_.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <
|
||||
|
@ -1423,7 +1423,7 @@ public:
|
|||
int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
_Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
|
||||
return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
|
||||
return __impl_.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <
|
||||
|
@ -1434,7 +1434,7 @@ public:
|
|||
enable_if_t<is_constructible_v<_Tp, _Args...>, int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
_Tp& emplace(_Args&&... __args) {
|
||||
return __impl.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
|
||||
return __impl_.template __emplace<_Ip>(_VSTD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
template <
|
||||
|
@ -1447,16 +1447,16 @@ public:
|
|||
int> = 0>
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
_Tp& emplace(initializer_list<_Up> __il, _Args&&... __args) {
|
||||
return __impl.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
|
||||
return __impl_.template __emplace<_Ip>(__il, _VSTD::forward<_Args>(__args)...);
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr bool valueless_by_exception() const noexcept {
|
||||
return __impl.valueless_by_exception();
|
||||
return __impl_.valueless_by_exception();
|
||||
}
|
||||
|
||||
_LIBCPP_HIDE_FROM_ABI
|
||||
constexpr size_t index() const noexcept { return __impl.index(); }
|
||||
constexpr size_t index() const noexcept { return __impl_.index(); }
|
||||
|
||||
template <
|
||||
bool _Dummy = true,
|
||||
|
@ -1469,11 +1469,11 @@ public:
|
|||
void swap(variant& __that) noexcept(
|
||||
__all<(is_nothrow_move_constructible_v<_Types> &&
|
||||
is_nothrow_swappable_v<_Types>)...>::value) {
|
||||
__impl.__swap(__that.__impl);
|
||||
__impl_.__swap(__that.__impl_);
|
||||
}
|
||||
|
||||
private:
|
||||
__variant_detail::__impl<_Types...> __impl;
|
||||
__variant_detail::__impl<_Types...> __impl_;
|
||||
|
||||
friend struct __variant_detail::__access::__variant;
|
||||
friend struct __variant_detail::__visitation::__variant;
|
||||
|
|
|
@ -739,25 +739,25 @@ locale::id::__init()
|
|||
|
||||
collate_byname<char>::collate_byname(const char* n, size_t refs)
|
||||
: collate<char>(refs),
|
||||
__l(newlocale(LC_ALL_MASK, n, 0))
|
||||
__l_(newlocale(LC_ALL_MASK, n, 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("collate_byname<char>::collate_byname"
|
||||
" failed to construct for " + string(n));
|
||||
}
|
||||
|
||||
collate_byname<char>::collate_byname(const string& name, size_t refs)
|
||||
: collate<char>(refs),
|
||||
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
__l_(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("collate_byname<char>::collate_byname"
|
||||
" failed to construct for " + name);
|
||||
}
|
||||
|
||||
collate_byname<char>::~collate_byname()
|
||||
{
|
||||
freelocale(__l);
|
||||
freelocale(__l_);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -766,7 +766,7 @@ collate_byname<char>::do_compare(const char_type* __lo1, const char_type* __hi1,
|
|||
{
|
||||
string_type lhs(__lo1, __hi1);
|
||||
string_type rhs(__lo2, __hi2);
|
||||
int r = strcoll_l(lhs.c_str(), rhs.c_str(), __l);
|
||||
int r = strcoll_l(lhs.c_str(), rhs.c_str(), __l_);
|
||||
if (r < 0)
|
||||
return -1;
|
||||
if (r > 0)
|
||||
|
@ -778,8 +778,8 @@ collate_byname<char>::string_type
|
|||
collate_byname<char>::do_transform(const char_type* lo, const char_type* hi) const
|
||||
{
|
||||
const string_type in(lo, hi);
|
||||
string_type out(strxfrm_l(0, in.c_str(), 0, __l), char());
|
||||
strxfrm_l(const_cast<char*>(out.c_str()), in.c_str(), out.size()+1, __l);
|
||||
string_type out(strxfrm_l(0, in.c_str(), 0, __l_), char());
|
||||
strxfrm_l(const_cast<char*>(out.c_str()), in.c_str(), out.size()+1, __l_);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -788,25 +788,25 @@ collate_byname<char>::do_transform(const char_type* lo, const char_type* hi) con
|
|||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
collate_byname<wchar_t>::collate_byname(const char* n, size_t refs)
|
||||
: collate<wchar_t>(refs),
|
||||
__l(newlocale(LC_ALL_MASK, n, 0))
|
||||
__l_(newlocale(LC_ALL_MASK, n, 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
|
||||
" failed to construct for " + string(n));
|
||||
}
|
||||
|
||||
collate_byname<wchar_t>::collate_byname(const string& name, size_t refs)
|
||||
: collate<wchar_t>(refs),
|
||||
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
__l_(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("collate_byname<wchar_t>::collate_byname(size_t refs)"
|
||||
" failed to construct for " + name);
|
||||
}
|
||||
|
||||
collate_byname<wchar_t>::~collate_byname()
|
||||
{
|
||||
freelocale(__l);
|
||||
freelocale(__l_);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -815,7 +815,7 @@ collate_byname<wchar_t>::do_compare(const char_type* __lo1, const char_type* __h
|
|||
{
|
||||
string_type lhs(__lo1, __hi1);
|
||||
string_type rhs(__lo2, __hi2);
|
||||
int r = wcscoll_l(lhs.c_str(), rhs.c_str(), __l);
|
||||
int r = wcscoll_l(lhs.c_str(), rhs.c_str(), __l_);
|
||||
if (r < 0)
|
||||
return -1;
|
||||
if (r > 0)
|
||||
|
@ -827,8 +827,8 @@ collate_byname<wchar_t>::string_type
|
|||
collate_byname<wchar_t>::do_transform(const char_type* lo, const char_type* hi) const
|
||||
{
|
||||
const string_type in(lo, hi);
|
||||
string_type out(wcsxfrm_l(0, in.c_str(), 0, __l), wchar_t());
|
||||
wcsxfrm_l(const_cast<wchar_t*>(out.c_str()), in.c_str(), out.size()+1, __l);
|
||||
string_type out(wcsxfrm_l(0, in.c_str(), 0, __l_), wchar_t());
|
||||
wcsxfrm_l(const_cast<wchar_t*>(out.c_str()), in.c_str(), out.size()+1, __l_);
|
||||
return out;
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
|
@ -1286,52 +1286,52 @@ ctype<char>::__classic_upper_table() _NOEXCEPT
|
|||
|
||||
ctype_byname<char>::ctype_byname(const char* name, size_t refs)
|
||||
: ctype<char>(0, false, refs),
|
||||
__l(newlocale(LC_ALL_MASK, name, 0))
|
||||
__l_(newlocale(LC_ALL_MASK, name, 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("ctype_byname<char>::ctype_byname"
|
||||
" failed to construct for " + string(name));
|
||||
}
|
||||
|
||||
ctype_byname<char>::ctype_byname(const string& name, size_t refs)
|
||||
: ctype<char>(0, false, refs),
|
||||
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
__l_(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("ctype_byname<char>::ctype_byname"
|
||||
" failed to construct for " + name);
|
||||
}
|
||||
|
||||
ctype_byname<char>::~ctype_byname()
|
||||
{
|
||||
freelocale(__l);
|
||||
freelocale(__l_);
|
||||
}
|
||||
|
||||
char
|
||||
ctype_byname<char>::do_toupper(char_type c) const
|
||||
{
|
||||
return static_cast<char>(toupper_l(static_cast<unsigned char>(c), __l));
|
||||
return static_cast<char>(toupper_l(static_cast<unsigned char>(c), __l_));
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype_byname<char>::do_toupper(char_type* low, const char_type* high) const
|
||||
{
|
||||
for (; low != high; ++low)
|
||||
*low = static_cast<char>(toupper_l(static_cast<unsigned char>(*low), __l));
|
||||
*low = static_cast<char>(toupper_l(static_cast<unsigned char>(*low), __l_));
|
||||
return low;
|
||||
}
|
||||
|
||||
char
|
||||
ctype_byname<char>::do_tolower(char_type c) const
|
||||
{
|
||||
return static_cast<char>(tolower_l(static_cast<unsigned char>(c), __l));
|
||||
return static_cast<char>(tolower_l(static_cast<unsigned char>(c), __l_));
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype_byname<char>::do_tolower(char_type* low, const char_type* high) const
|
||||
{
|
||||
for (; low != high; ++low)
|
||||
*low = static_cast<char>(tolower_l(static_cast<unsigned char>(*low), __l));
|
||||
*low = static_cast<char>(tolower_l(static_cast<unsigned char>(*low), __l_));
|
||||
return low;
|
||||
}
|
||||
|
||||
|
@ -1340,45 +1340,45 @@ ctype_byname<char>::do_tolower(char_type* low, const char_type* high) const
|
|||
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
ctype_byname<wchar_t>::ctype_byname(const char* name, size_t refs)
|
||||
: ctype<wchar_t>(refs),
|
||||
__l(newlocale(LC_ALL_MASK, name, 0))
|
||||
__l_(newlocale(LC_ALL_MASK, name, 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("ctype_byname<wchar_t>::ctype_byname"
|
||||
" failed to construct for " + string(name));
|
||||
}
|
||||
|
||||
ctype_byname<wchar_t>::ctype_byname(const string& name, size_t refs)
|
||||
: ctype<wchar_t>(refs),
|
||||
__l(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
__l_(newlocale(LC_ALL_MASK, name.c_str(), 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("ctype_byname<wchar_t>::ctype_byname"
|
||||
" failed to construct for " + name);
|
||||
}
|
||||
|
||||
ctype_byname<wchar_t>::~ctype_byname()
|
||||
{
|
||||
freelocale(__l);
|
||||
freelocale(__l_);
|
||||
}
|
||||
|
||||
bool
|
||||
ctype_byname<wchar_t>::do_is(mask m, char_type c) const
|
||||
{
|
||||
#ifdef _LIBCPP_WCTYPE_IS_MASK
|
||||
return static_cast<bool>(iswctype_l(c, m, __l));
|
||||
return static_cast<bool>(iswctype_l(c, m, __l_));
|
||||
#else
|
||||
bool result = false;
|
||||
wint_t ch = static_cast<wint_t>(c);
|
||||
if ((m & space) == space) result |= (iswspace_l(ch, __l) != 0);
|
||||
if ((m & print) == print) result |= (iswprint_l(ch, __l) != 0);
|
||||
if ((m & cntrl) == cntrl) result |= (iswcntrl_l(ch, __l) != 0);
|
||||
if ((m & upper) == upper) result |= (iswupper_l(ch, __l) != 0);
|
||||
if ((m & lower) == lower) result |= (iswlower_l(ch, __l) != 0);
|
||||
if ((m & alpha) == alpha) result |= (iswalpha_l(ch, __l) != 0);
|
||||
if ((m & digit) == digit) result |= (iswdigit_l(ch, __l) != 0);
|
||||
if ((m & punct) == punct) result |= (iswpunct_l(ch, __l) != 0);
|
||||
if ((m & xdigit) == xdigit) result |= (iswxdigit_l(ch, __l) != 0);
|
||||
if ((m & blank) == blank) result |= (iswblank_l(ch, __l) != 0);
|
||||
if ((m & space) == space) result |= (iswspace_l(ch, __l_) != 0);
|
||||
if ((m & print) == print) result |= (iswprint_l(ch, __l_) != 0);
|
||||
if ((m & cntrl) == cntrl) result |= (iswcntrl_l(ch, __l_) != 0);
|
||||
if ((m & upper) == upper) result |= (iswupper_l(ch, __l_) != 0);
|
||||
if ((m & lower) == lower) result |= (iswlower_l(ch, __l_) != 0);
|
||||
if ((m & alpha) == alpha) result |= (iswalpha_l(ch, __l_) != 0);
|
||||
if ((m & digit) == digit) result |= (iswdigit_l(ch, __l_) != 0);
|
||||
if ((m & punct) == punct) result |= (iswpunct_l(ch, __l_) != 0);
|
||||
if ((m & xdigit) == xdigit) result |= (iswxdigit_l(ch, __l_) != 0);
|
||||
if ((m & blank) == blank) result |= (iswblank_l(ch, __l_) != 0);
|
||||
return result;
|
||||
#endif
|
||||
}
|
||||
|
@ -1394,32 +1394,32 @@ ctype_byname<wchar_t>::do_is(const char_type* low, const char_type* high, mask*
|
|||
{
|
||||
*vec = 0;
|
||||
wint_t ch = static_cast<wint_t>(*low);
|
||||
if (iswspace_l(ch, __l))
|
||||
if (iswspace_l(ch, __l_))
|
||||
*vec |= space;
|
||||
#ifndef _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
|
||||
if (iswprint_l(ch, __l))
|
||||
if (iswprint_l(ch, __l_))
|
||||
*vec |= print;
|
||||
#endif
|
||||
if (iswcntrl_l(ch, __l))
|
||||
if (iswcntrl_l(ch, __l_))
|
||||
*vec |= cntrl;
|
||||
if (iswupper_l(ch, __l))
|
||||
if (iswupper_l(ch, __l_))
|
||||
*vec |= upper;
|
||||
if (iswlower_l(ch, __l))
|
||||
if (iswlower_l(ch, __l_))
|
||||
*vec |= lower;
|
||||
#ifndef _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA
|
||||
if (iswalpha_l(ch, __l))
|
||||
if (iswalpha_l(ch, __l_))
|
||||
*vec |= alpha;
|
||||
#endif
|
||||
if (iswdigit_l(ch, __l))
|
||||
if (iswdigit_l(ch, __l_))
|
||||
*vec |= digit;
|
||||
if (iswpunct_l(ch, __l))
|
||||
if (iswpunct_l(ch, __l_))
|
||||
*vec |= punct;
|
||||
#ifndef _LIBCPP_CTYPE_MASK_IS_COMPOSITE_XDIGIT
|
||||
if (iswxdigit_l(ch, __l))
|
||||
if (iswxdigit_l(ch, __l_))
|
||||
*vec |= xdigit;
|
||||
#endif
|
||||
#if !defined(__sun__)
|
||||
if (iswblank_l(ch, __l))
|
||||
if (iswblank_l(ch, __l_))
|
||||
*vec |= blank;
|
||||
#endif
|
||||
}
|
||||
|
@ -1433,20 +1433,20 @@ ctype_byname<wchar_t>::do_scan_is(mask m, const char_type* low, const char_type*
|
|||
for (; low != high; ++low)
|
||||
{
|
||||
#ifdef _LIBCPP_WCTYPE_IS_MASK
|
||||
if (iswctype_l(*low, m, __l))
|
||||
if (iswctype_l(*low, m, __l_))
|
||||
break;
|
||||
#else
|
||||
wint_t ch = static_cast<wint_t>(*low);
|
||||
if ((m & space) == space && iswspace_l(ch, __l)) break;
|
||||
if ((m & print) == print && iswprint_l(ch, __l)) break;
|
||||
if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l)) break;
|
||||
if ((m & upper) == upper && iswupper_l(ch, __l)) break;
|
||||
if ((m & lower) == lower && iswlower_l(ch, __l)) break;
|
||||
if ((m & alpha) == alpha && iswalpha_l(ch, __l)) break;
|
||||
if ((m & digit) == digit && iswdigit_l(ch, __l)) break;
|
||||
if ((m & punct) == punct && iswpunct_l(ch, __l)) break;
|
||||
if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l)) break;
|
||||
if ((m & blank) == blank && iswblank_l(ch, __l)) break;
|
||||
if ((m & space) == space && iswspace_l(ch, __l_)) break;
|
||||
if ((m & print) == print && iswprint_l(ch, __l_)) break;
|
||||
if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l_)) break;
|
||||
if ((m & upper) == upper && iswupper_l(ch, __l_)) break;
|
||||
if ((m & lower) == lower && iswlower_l(ch, __l_)) break;
|
||||
if ((m & alpha) == alpha && iswalpha_l(ch, __l_)) break;
|
||||
if ((m & digit) == digit && iswdigit_l(ch, __l_)) break;
|
||||
if ((m & punct) == punct && iswpunct_l(ch, __l_)) break;
|
||||
if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l_)) break;
|
||||
if ((m & blank) == blank && iswblank_l(ch, __l_)) break;
|
||||
#endif
|
||||
}
|
||||
return low;
|
||||
|
@ -1458,20 +1458,20 @@ ctype_byname<wchar_t>::do_scan_not(mask m, const char_type* low, const char_type
|
|||
for (; low != high; ++low)
|
||||
{
|
||||
#ifdef _LIBCPP_WCTYPE_IS_MASK
|
||||
if (!iswctype_l(*low, m, __l))
|
||||
if (!iswctype_l(*low, m, __l_))
|
||||
break;
|
||||
#else
|
||||
wint_t ch = static_cast<wint_t>(*low);
|
||||
if ((m & space) == space && iswspace_l(ch, __l)) continue;
|
||||
if ((m & print) == print && iswprint_l(ch, __l)) continue;
|
||||
if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l)) continue;
|
||||
if ((m & upper) == upper && iswupper_l(ch, __l)) continue;
|
||||
if ((m & lower) == lower && iswlower_l(ch, __l)) continue;
|
||||
if ((m & alpha) == alpha && iswalpha_l(ch, __l)) continue;
|
||||
if ((m & digit) == digit && iswdigit_l(ch, __l)) continue;
|
||||
if ((m & punct) == punct && iswpunct_l(ch, __l)) continue;
|
||||
if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l)) continue;
|
||||
if ((m & blank) == blank && iswblank_l(ch, __l)) continue;
|
||||
if ((m & space) == space && iswspace_l(ch, __l_)) continue;
|
||||
if ((m & print) == print && iswprint_l(ch, __l_)) continue;
|
||||
if ((m & cntrl) == cntrl && iswcntrl_l(ch, __l_)) continue;
|
||||
if ((m & upper) == upper && iswupper_l(ch, __l_)) continue;
|
||||
if ((m & lower) == lower && iswlower_l(ch, __l_)) continue;
|
||||
if ((m & alpha) == alpha && iswalpha_l(ch, __l_)) continue;
|
||||
if ((m & digit) == digit && iswdigit_l(ch, __l_)) continue;
|
||||
if ((m & punct) == punct && iswpunct_l(ch, __l_)) continue;
|
||||
if ((m & xdigit) == xdigit && iswxdigit_l(ch, __l_)) continue;
|
||||
if ((m & blank) == blank && iswblank_l(ch, __l_)) continue;
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
@ -1481,49 +1481,49 @@ ctype_byname<wchar_t>::do_scan_not(mask m, const char_type* low, const char_type
|
|||
wchar_t
|
||||
ctype_byname<wchar_t>::do_toupper(char_type c) const
|
||||
{
|
||||
return towupper_l(c, __l);
|
||||
return towupper_l(c, __l_);
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype_byname<wchar_t>::do_toupper(char_type* low, const char_type* high) const
|
||||
{
|
||||
for (; low != high; ++low)
|
||||
*low = towupper_l(*low, __l);
|
||||
*low = towupper_l(*low, __l_);
|
||||
return low;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype_byname<wchar_t>::do_tolower(char_type c) const
|
||||
{
|
||||
return towlower_l(c, __l);
|
||||
return towlower_l(c, __l_);
|
||||
}
|
||||
|
||||
const wchar_t*
|
||||
ctype_byname<wchar_t>::do_tolower(char_type* low, const char_type* high) const
|
||||
{
|
||||
for (; low != high; ++low)
|
||||
*low = towlower_l(*low, __l);
|
||||
*low = towlower_l(*low, __l_);
|
||||
return low;
|
||||
}
|
||||
|
||||
wchar_t
|
||||
ctype_byname<wchar_t>::do_widen(char c) const
|
||||
{
|
||||
return __libcpp_btowc_l(c, __l);
|
||||
return __libcpp_btowc_l(c, __l_);
|
||||
}
|
||||
|
||||
const char*
|
||||
ctype_byname<wchar_t>::do_widen(const char* low, const char* high, char_type* dest) const
|
||||
{
|
||||
for (; low != high; ++low, ++dest)
|
||||
*dest = __libcpp_btowc_l(*low, __l);
|
||||
*dest = __libcpp_btowc_l(*low, __l_);
|
||||
return low;
|
||||
}
|
||||
|
||||
char
|
||||
ctype_byname<wchar_t>::do_narrow(char_type c, char dfault) const
|
||||
{
|
||||
int r = __libcpp_wctob_l(c, __l);
|
||||
int r = __libcpp_wctob_l(c, __l_);
|
||||
return (r != EOF) ? static_cast<char>(r) : dfault;
|
||||
}
|
||||
|
||||
|
@ -1532,7 +1532,7 @@ ctype_byname<wchar_t>::do_narrow(const char_type* low, const char_type* high, ch
|
|||
{
|
||||
for (; low != high; ++low, ++dest)
|
||||
{
|
||||
int r = __libcpp_wctob_l(*low, __l);
|
||||
int r = __libcpp_wctob_l(*low, __l_);
|
||||
*dest = (r != EOF) ? static_cast<char>(r) : dfault;
|
||||
}
|
||||
return low;
|
||||
|
@ -1607,23 +1607,23 @@ locale::id codecvt<wchar_t, char, mbstate_t>::id;
|
|||
|
||||
codecvt<wchar_t, char, mbstate_t>::codecvt(size_t refs)
|
||||
: locale::facet(refs),
|
||||
__l(_LIBCPP_GET_C_LOCALE)
|
||||
__l_(_LIBCPP_GET_C_LOCALE)
|
||||
{
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::codecvt(const char* nm, size_t refs)
|
||||
: locale::facet(refs),
|
||||
__l(newlocale(LC_ALL_MASK, nm, 0))
|
||||
__l_(newlocale(LC_ALL_MASK, nm, 0))
|
||||
{
|
||||
if (__l == 0)
|
||||
if (__l_ == 0)
|
||||
__throw_runtime_error("codecvt_byname<wchar_t, char, mbstate_t>::codecvt_byname"
|
||||
" failed to construct for " + string(nm));
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::~codecvt()
|
||||
{
|
||||
if (__l != _LIBCPP_GET_C_LOCALE)
|
||||
freelocale(__l);
|
||||
if (__l_ != _LIBCPP_GET_C_LOCALE)
|
||||
freelocale(__l_);
|
||||
}
|
||||
|
||||
codecvt<wchar_t, char, mbstate_t>::result
|
||||
|
@ -1643,13 +1643,13 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
|
|||
// save state in case it is needed to recover to_nxt on error
|
||||
mbstate_t save_state = st;
|
||||
size_t n = __libcpp_wcsnrtombs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
|
||||
static_cast<size_t>(to_end-to), &st, __l);
|
||||
static_cast<size_t>(to_end-to), &st, __l_);
|
||||
if (n == size_t(-1))
|
||||
{
|
||||
// need to recover to_nxt
|
||||
for (to_nxt = to; frm != frm_nxt; ++frm)
|
||||
{
|
||||
n = __libcpp_wcrtomb_l(to_nxt, *frm, &save_state, __l);
|
||||
n = __libcpp_wcrtomb_l(to_nxt, *frm, &save_state, __l_);
|
||||
if (n == size_t(-1))
|
||||
break;
|
||||
to_nxt += n;
|
||||
|
@ -1666,7 +1666,7 @@ codecvt<wchar_t, char, mbstate_t>::do_out(state_type& st,
|
|||
{
|
||||
// Try to write the terminating null
|
||||
extern_type tmp[MB_LEN_MAX];
|
||||
n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l);
|
||||
n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l_);
|
||||
if (n == size_t(-1)) // on error
|
||||
return error;
|
||||
if (n > static_cast<size_t>(to_end-to_nxt)) // is there room?
|
||||
|
@ -1700,14 +1700,14 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
|
|||
// save state in case it is needed to recover to_nxt on error
|
||||
mbstate_t save_state = st;
|
||||
size_t n = __libcpp_mbsnrtowcs_l(to, &frm_nxt, static_cast<size_t>(fend-frm),
|
||||
static_cast<size_t>(to_end-to), &st, __l);
|
||||
static_cast<size_t>(to_end-to), &st, __l_);
|
||||
if (n == size_t(-1))
|
||||
{
|
||||
// need to recover to_nxt
|
||||
for (to_nxt = to; frm != frm_nxt; ++to_nxt)
|
||||
{
|
||||
n = __libcpp_mbrtowc_l(to_nxt, frm, static_cast<size_t>(fend-frm),
|
||||
&save_state, __l);
|
||||
&save_state, __l_);
|
||||
switch (n)
|
||||
{
|
||||
case 0:
|
||||
|
@ -1735,7 +1735,7 @@ codecvt<wchar_t, char, mbstate_t>::do_in(state_type& st,
|
|||
if (fend != frm_end) // set up next null terminated sequence
|
||||
{
|
||||
// Try to write the terminating null
|
||||
n = __libcpp_mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l);
|
||||
n = __libcpp_mbrtowc_l(to_nxt, frm_nxt, 1, &st, __l_);
|
||||
if (n != 0) // on error
|
||||
return error;
|
||||
++to_nxt;
|
||||
|
@ -1755,7 +1755,7 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
|
|||
{
|
||||
to_nxt = to;
|
||||
extern_type tmp[MB_LEN_MAX];
|
||||
size_t n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l);
|
||||
size_t n = __libcpp_wcrtomb_l(tmp, intern_type(), &st, __l_);
|
||||
if (n == size_t(-1) || n == 0) // on error
|
||||
return error;
|
||||
--n;
|
||||
|
@ -1769,11 +1769,11 @@ codecvt<wchar_t, char, mbstate_t>::do_unshift(state_type& st,
|
|||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_encoding() const noexcept
|
||||
{
|
||||
if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l) != 0)
|
||||
if (__libcpp_mbtowc_l(nullptr, nullptr, MB_LEN_MAX, __l_) != 0)
|
||||
return -1;
|
||||
|
||||
// stateless encoding
|
||||
if (__l == 0 || __libcpp_mb_cur_max_l(__l) == 1) // there are no known constant length encodings
|
||||
if (__l_ == 0 || __libcpp_mb_cur_max_l(__l_) == 1) // there are no known constant length encodings
|
||||
return 1; // which take more than 1 char to form a wchar_t
|
||||
return 0;
|
||||
}
|
||||
|
@ -1791,7 +1791,7 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
|
|||
int nbytes = 0;
|
||||
for (size_t nwchar_t = 0; nwchar_t < mx && frm != frm_end; ++nwchar_t)
|
||||
{
|
||||
size_t n = __libcpp_mbrlen_l(frm, static_cast<size_t>(frm_end-frm), &st, __l);
|
||||
size_t n = __libcpp_mbrlen_l(frm, static_cast<size_t>(frm_end-frm), &st, __l_);
|
||||
switch (n)
|
||||
{
|
||||
case 0:
|
||||
|
@ -1813,7 +1813,7 @@ codecvt<wchar_t, char, mbstate_t>::do_length(state_type& st,
|
|||
int
|
||||
codecvt<wchar_t, char, mbstate_t>::do_max_length() const noexcept
|
||||
{
|
||||
return __l == 0 ? 1 : static_cast<int>(__libcpp_mb_cur_max_l(__l));
|
||||
return __l_ == 0 ? 1 : static_cast<int>(__libcpp_mb_cur_max_l(__l_));
|
||||
}
|
||||
#endif // _LIBCPP_HAS_NO_WIDE_CHARACTERS
|
||||
|
||||
|
@ -3545,10 +3545,10 @@ __codecvt_utf8<wchar_t>::do_out(state_type&,
|
|||
uint8_t* _to_nxt = _to;
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
result r = ucs2_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#else
|
||||
result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#endif
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
|
@ -3568,13 +3568,13 @@ __codecvt_utf8<wchar_t>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf8_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#else
|
||||
uint32_t* _to = reinterpret_cast<uint32_t*>(to);
|
||||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#endif
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
|
@ -3608,9 +3608,9 @@ __codecvt_utf8<wchar_t>::do_length(state_type&,
|
|||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
return utf8_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
#else
|
||||
return utf8_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -3619,11 +3619,11 @@ int
|
|||
__codecvt_utf8<wchar_t>::do_max_length() const noexcept
|
||||
{
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 6;
|
||||
return 3;
|
||||
#else
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 7;
|
||||
return 4;
|
||||
#endif
|
||||
|
@ -3644,7 +3644,7 @@ __codecvt_utf8<char16_t>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = ucs2_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -3662,7 +3662,7 @@ __codecvt_utf8<char16_t>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf8_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -3694,14 +3694,14 @@ __codecvt_utf8<char16_t>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf8_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf8<char16_t>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 6;
|
||||
return 3;
|
||||
}
|
||||
|
@ -3721,7 +3721,7 @@ __codecvt_utf8<char32_t>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = ucs4_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -3739,7 +3739,7 @@ __codecvt_utf8<char32_t>::do_in(state_type&,
|
|||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf8_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -3771,14 +3771,14 @@ __codecvt_utf8<char32_t>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf8_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf8<char32_t>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 7;
|
||||
return 4;
|
||||
}
|
||||
|
@ -3806,10 +3806,10 @@ __codecvt_utf16<wchar_t, false>::do_out(state_type&,
|
|||
uint8_t* _to_nxt = _to;
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
result r = ucs2_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#else
|
||||
result r = ucs4_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#endif
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
|
@ -3829,13 +3829,13 @@ __codecvt_utf16<wchar_t, false>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf16be_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#else
|
||||
uint32_t* _to = reinterpret_cast<uint32_t*>(to);
|
||||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf16be_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#endif
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
|
@ -3869,9 +3869,9 @@ __codecvt_utf16<wchar_t, false>::do_length(state_type&,
|
|||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
return utf16be_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16be_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
#else
|
||||
return utf16be_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16be_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -3879,11 +3879,11 @@ int
|
|||
__codecvt_utf16<wchar_t, false>::do_max_length() const noexcept
|
||||
{
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 4;
|
||||
return 2;
|
||||
#else
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 6;
|
||||
return 4;
|
||||
#endif
|
||||
|
@ -3910,10 +3910,10 @@ __codecvt_utf16<wchar_t, true>::do_out(state_type&,
|
|||
uint8_t* _to_nxt = _to;
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
result r = ucs2_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#else
|
||||
result r = ucs4_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#endif
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
|
@ -3933,13 +3933,13 @@ __codecvt_utf16<wchar_t, true>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf16le_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#else
|
||||
uint32_t* _to = reinterpret_cast<uint32_t*>(to);
|
||||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf16le_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
#endif
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
|
@ -3973,9 +3973,9 @@ __codecvt_utf16<wchar_t, true>::do_length(state_type&,
|
|||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
return utf16le_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16le_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
#else
|
||||
return utf16le_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16le_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -3983,11 +3983,11 @@ int
|
|||
__codecvt_utf16<wchar_t, true>::do_max_length() const noexcept
|
||||
{
|
||||
#if defined(_LIBCPP_SHORT_WCHAR)
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 4;
|
||||
return 2;
|
||||
#else
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 6;
|
||||
return 4;
|
||||
#endif
|
||||
|
@ -4008,7 +4008,7 @@ __codecvt_utf16<char16_t, false>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = ucs2_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4026,7 +4026,7 @@ __codecvt_utf16<char16_t, false>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf16be_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4058,14 +4058,14 @@ __codecvt_utf16<char16_t, false>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf16be_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16be_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf16<char16_t, false>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 4;
|
||||
return 2;
|
||||
}
|
||||
|
@ -4085,7 +4085,7 @@ __codecvt_utf16<char16_t, true>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = ucs2_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4103,7 +4103,7 @@ __codecvt_utf16<char16_t, true>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf16le_to_ucs2(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4135,14 +4135,14 @@ __codecvt_utf16<char16_t, true>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf16le_to_ucs2_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16le_to_ucs2_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf16<char16_t, true>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 4;
|
||||
return 2;
|
||||
}
|
||||
|
@ -4162,7 +4162,7 @@ __codecvt_utf16<char32_t, false>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = ucs4_to_utf16be(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4180,7 +4180,7 @@ __codecvt_utf16<char32_t, false>::do_in(state_type&,
|
|||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf16be_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4212,14 +4212,14 @@ __codecvt_utf16<char32_t, false>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf16be_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16be_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf16<char32_t, false>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 6;
|
||||
return 4;
|
||||
}
|
||||
|
@ -4239,7 +4239,7 @@ __codecvt_utf16<char32_t, true>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = ucs4_to_utf16le(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4257,7 +4257,7 @@ __codecvt_utf16<char32_t, true>::do_in(state_type&,
|
|||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf16le_to_ucs4(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4289,14 +4289,14 @@ __codecvt_utf16<char32_t, true>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf16le_to_ucs4_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf16le_to_ucs4_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf16<char32_t, true>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 6;
|
||||
return 4;
|
||||
}
|
||||
|
@ -4323,7 +4323,7 @@ __codecvt_utf8_utf16<wchar_t>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4347,7 +4347,7 @@ __codecvt_utf8_utf16<wchar_t>::do_in(state_type&,
|
|||
uint32_t* _to_nxt = _to;
|
||||
#endif
|
||||
result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4379,13 +4379,13 @@ __codecvt_utf8_utf16<wchar_t>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf8_to_utf16_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_utf16_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
int
|
||||
__codecvt_utf8_utf16<wchar_t>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 7;
|
||||
return 4;
|
||||
}
|
||||
|
@ -4405,7 +4405,7 @@ __codecvt_utf8_utf16<char16_t>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4423,7 +4423,7 @@ __codecvt_utf8_utf16<char16_t>::do_in(state_type&,
|
|||
uint16_t* _to_end = reinterpret_cast<uint16_t*>(to_end);
|
||||
uint16_t* _to_nxt = _to;
|
||||
result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4455,14 +4455,14 @@ __codecvt_utf8_utf16<char16_t>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf8_to_utf16_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_utf16_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf8_utf16<char16_t>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 7;
|
||||
return 4;
|
||||
}
|
||||
|
@ -4482,7 +4482,7 @@ __codecvt_utf8_utf16<char32_t>::do_out(state_type&,
|
|||
uint8_t* _to_end = reinterpret_cast<uint8_t*>(to_end);
|
||||
uint8_t* _to_nxt = _to;
|
||||
result r = utf16_to_utf8(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4500,7 +4500,7 @@ __codecvt_utf8_utf16<char32_t>::do_in(state_type&,
|
|||
uint32_t* _to_end = reinterpret_cast<uint32_t*>(to_end);
|
||||
uint32_t* _to_nxt = _to;
|
||||
result r = utf8_to_utf16(_frm, _frm_end, _frm_nxt, _to, _to_end, _to_nxt,
|
||||
_Maxcode_, _Mode_);
|
||||
__maxcode_, __mode_);
|
||||
frm_nxt = frm + (_frm_nxt - _frm);
|
||||
to_nxt = to + (_to_nxt - _to);
|
||||
return r;
|
||||
|
@ -4532,14 +4532,14 @@ __codecvt_utf8_utf16<char32_t>::do_length(state_type&,
|
|||
{
|
||||
const uint8_t* _frm = reinterpret_cast<const uint8_t*>(frm);
|
||||
const uint8_t* _frm_end = reinterpret_cast<const uint8_t*>(frm_end);
|
||||
return utf8_to_utf16_length(_frm, _frm_end, mx, _Maxcode_, _Mode_);
|
||||
return utf8_to_utf16_length(_frm, _frm_end, mx, __maxcode_, __mode_);
|
||||
}
|
||||
|
||||
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
|
||||
int
|
||||
__codecvt_utf8_utf16<char32_t>::do_max_length() const noexcept
|
||||
{
|
||||
if (_Mode_ & consume_header)
|
||||
if (__mode_ & consume_header)
|
||||
return 7;
|
||||
return 4;
|
||||
}
|
||||
|
|
|
@ -152,21 +152,21 @@ static constinit __libcpp_mutex_t mut_back[__sp_mut_count] =
|
|||
};
|
||||
|
||||
_LIBCPP_CONSTEXPR __sp_mut::__sp_mut(void* p) noexcept
|
||||
: __lx(p)
|
||||
: __lx_(p)
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
__sp_mut::lock() noexcept
|
||||
{
|
||||
auto m = static_cast<__libcpp_mutex_t*>(__lx);
|
||||
auto m = static_cast<__libcpp_mutex_t*>(__lx_);
|
||||
__libcpp_mutex_lock(m);
|
||||
}
|
||||
|
||||
void
|
||||
__sp_mut::unlock() noexcept
|
||||
{
|
||||
__libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx));
|
||||
__libcpp_mutex_unlock(static_cast<__libcpp_mutex_t*>(__lx_));
|
||||
}
|
||||
|
||||
__sp_mut&
|
||||
|
|
|
@ -106,13 +106,13 @@ __shared_mutex_base::unlock_shared()
|
|||
|
||||
// Shared Timed Mutex
|
||||
// These routines are here for ABI stability
|
||||
shared_timed_mutex::shared_timed_mutex() : __base() {}
|
||||
void shared_timed_mutex::lock() { return __base.lock(); }
|
||||
bool shared_timed_mutex::try_lock() { return __base.try_lock(); }
|
||||
void shared_timed_mutex::unlock() { return __base.unlock(); }
|
||||
void shared_timed_mutex::lock_shared() { return __base.lock_shared(); }
|
||||
bool shared_timed_mutex::try_lock_shared() { return __base.try_lock_shared(); }
|
||||
void shared_timed_mutex::unlock_shared() { return __base.unlock_shared(); }
|
||||
shared_timed_mutex::shared_timed_mutex() : __base_() {}
|
||||
void shared_timed_mutex::lock() { return __base_.lock(); }
|
||||
bool shared_timed_mutex::try_lock() { return __base_.try_lock(); }
|
||||
void shared_timed_mutex::unlock() { return __base_.unlock(); }
|
||||
void shared_timed_mutex::lock_shared() { return __base_.lock_shared(); }
|
||||
bool shared_timed_mutex::try_lock_shared() { return __base_.try_lock_shared(); }
|
||||
void shared_timed_mutex::unlock_shared() { return __base_.unlock_shared(); }
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
|
|
Loading…
Reference in New Issue