mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/ChatCommands: Add Variant.get<typename> overload (PR #25267)
Co-authored-by: Treeston <treeston.mmoc@gmail.com>
This commit is contained in:
committed by
GitHub
parent
66491dbfb3
commit
dfeaa2e81f
@@ -156,10 +156,16 @@ namespace Trinity::ChatCommands
|
||||
Variant& operator=(T&& arg) { base::operator=(std::forward<T>(arg)); return *this; }
|
||||
|
||||
template <size_t index>
|
||||
constexpr decltype(auto) get() { return std::get<index>(static_cast<base const&>(*this)); }
|
||||
constexpr decltype(auto) get() { return std::get<index>(static_cast<base&>(*this)); }
|
||||
template <size_t index>
|
||||
constexpr decltype(auto) get() const { return std::get<index>(static_cast<base const&>(*this)); }
|
||||
template <typename type>
|
||||
constexpr decltype(auto) get() { return std::get<type>(static_cast<base&>(*this)); }
|
||||
template <typename type>
|
||||
constexpr decltype(auto) get() const { return std::get<type>(static_cast<base const&>(*this)); }
|
||||
|
||||
template <typename T>
|
||||
constexpr decltype(auto) visit(T&& arg) { return std::visit(std::forward<T>(arg), static_cast<base&>(*this)); }
|
||||
template <typename T>
|
||||
constexpr decltype(auto) visit(T&& arg) const { return std::visit(std::forward<T>(arg), static_cast<base const&>(*this)); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user