removing use of std::aligned_storage

That shit is deprecated in C++23, yo.
This commit is contained in:
Mark Gillard 2022-08-11 16:13:25 +03:00
parent 67c18a3251
commit 59ad6e6dfe
2 changed files with 6 additions and 6 deletions

View File

@ -38,7 +38,7 @@ TOML_IMPL_NAMESPACE_START
using map_iterator = std::conditional_t<IsConst, const_map_iterator, mutable_map_iterator>;
mutable map_iterator iter_;
mutable std::aligned_storage_t<sizeof(proxy_type), alignof(proxy_type)> proxy_;
alignas(proxy_type) mutable unsigned char proxy_[sizeof(proxy_type)];
mutable bool proxy_instantiated_ = false;
TOML_NODISCARD
@ -46,12 +46,12 @@ TOML_IMPL_NAMESPACE_START
{
if (!proxy_instantiated_)
{
auto p = ::new (static_cast<void*>(&proxy_)) proxy_type{ iter_->first, *iter_->second.get() };
auto p = ::new (static_cast<void*>(proxy_)) proxy_type{ iter_->first, *iter_->second.get() };
proxy_instantiated_ = true;
return p;
}
else
return TOML_LAUNDER(reinterpret_cast<proxy_type*>(&proxy_));
return TOML_LAUNDER(reinterpret_cast<proxy_type*>(proxy_));
}
public:

View File

@ -7108,7 +7108,7 @@ TOML_IMPL_NAMESPACE_START
using map_iterator = std::conditional_t<IsConst, const_map_iterator, mutable_map_iterator>;
mutable map_iterator iter_;
mutable std::aligned_storage_t<sizeof(proxy_type), alignof(proxy_type)> proxy_;
alignas(proxy_type) mutable unsigned char proxy_[sizeof(proxy_type)];
mutable bool proxy_instantiated_ = false;
TOML_NODISCARD
@ -7116,12 +7116,12 @@ TOML_IMPL_NAMESPACE_START
{
if (!proxy_instantiated_)
{
auto p = ::new (static_cast<void*>(&proxy_)) proxy_type{ iter_->first, *iter_->second.get() };
auto p = ::new (static_cast<void*>(proxy_)) proxy_type{ iter_->first, *iter_->second.get() };
proxy_instantiated_ = true;
return p;
}
else
return TOML_LAUNDER(reinterpret_cast<proxy_type*>(&proxy_));
return TOML_LAUNDER(reinterpret_cast<proxy_type*>(proxy_));
}
public: