mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-11-18 01:38:08 -06:00
Merge pull request #14972 from jordan-woyak/paren-init-aggregate
Minor cleanups with "parenthesized initialization of aggregates".
This commit is contained in:
@@ -97,13 +97,7 @@ public:
|
||||
T& Construct(Args&&... args)
|
||||
{
|
||||
static_assert(sizeof(ManuallyConstructedValue) == sizeof(T));
|
||||
|
||||
// TODO: Remove placement-new version when we can require Clang 16.
|
||||
#if defined(__cpp_aggregate_paren_init) && (__cpp_aggregate_paren_init >= 201902L)
|
||||
return *std::construct_at(&m_value.data, std::forward<Args>(args)...);
|
||||
#else
|
||||
return *::new (&m_value.data) T{std::forward<Args>(args)...};
|
||||
#endif
|
||||
}
|
||||
|
||||
void Destroy() { std::destroy_at(&m_value.data); }
|
||||
|
||||
@@ -118,9 +118,7 @@ void BranchWatch::Load(const CPUThreadGuard& guard, std::FILE* file)
|
||||
|
||||
if (snapshot_metadata.is_selected)
|
||||
{
|
||||
// TODO C++20: Parenthesized initialization of aggregates has bad compiler support.
|
||||
m_selection.emplace_back(BranchWatchSelectionValueType{&*kv_iter, is_virtual, condition,
|
||||
snapshot_metadata.inspection});
|
||||
m_selection.emplace_back(&*kv_iter, is_virtual, condition, snapshot_metadata.inspection);
|
||||
}
|
||||
else if (hits_snapshot != 0)
|
||||
{
|
||||
@@ -144,9 +142,7 @@ void BranchWatch::IsolateHasExecuted(const CPUThreadGuard&)
|
||||
{
|
||||
if (kv.second.hits_snapshot == 0)
|
||||
{
|
||||
// TODO C++20: Parenthesized initialization of aggregates has bad compiler support.
|
||||
m_selection.emplace_back(
|
||||
BranchWatchSelectionValueType{&kv, is_virtual, condition, SelectionInspection{}});
|
||||
m_selection.emplace_back(&kv, is_virtual, condition);
|
||||
kv.second.hits_snapshot = kv.second.total_hits;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user