mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
[upstream_utils] StringMap: fix structured bindings with move-only types (#7127)
This commit is contained in:
@@ -159,7 +159,17 @@ decltype(auto) get(const StringMapEntry<ValueTy> &E) {
|
||||
if constexpr (Index == 0)
|
||||
return E.first();
|
||||
else
|
||||
return E.second;
|
||||
return (E.second);
|
||||
}
|
||||
|
||||
// Allow structured bindings on StringMapEntry.
|
||||
template <std::size_t Index, typename ValueTy>
|
||||
decltype(auto) get(StringMapEntry<ValueTy> &E) {
|
||||
static_assert(Index < 2);
|
||||
if constexpr (Index == 0)
|
||||
return E.first();
|
||||
else
|
||||
return (E.second);
|
||||
}
|
||||
|
||||
} // end namespace wpi
|
||||
|
||||
Reference in New Issue
Block a user