mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 11:03:00 +01:00
use std::decay helper type
This commit is contained in:
@@ -70,7 +70,7 @@ namespace OpenRCT2::Scripting
|
||||
DukObject obj(ctx);
|
||||
std::visit(
|
||||
[&obj](auto&& value) {
|
||||
using T = std::decay<decltype(value)>::type;
|
||||
using T = std::decay_t<decltype(value)>;
|
||||
obj.Set("type", T::ScriptingName);
|
||||
if constexpr (std::is_same_v<T, LoadParkCommand>)
|
||||
{
|
||||
|
||||
@@ -171,7 +171,7 @@ namespace OpenRCT2::Title
|
||||
catch (std::exception& e)
|
||||
{
|
||||
const char* commandName = std::visit(
|
||||
[](auto&& command) { return std::decay<decltype(command)>::type::Name; }, currentCommand);
|
||||
[](auto&& command) { return std::decay_t<decltype(command)>::Name; }, currentCommand);
|
||||
Console::Error::WriteLine("%s (command %i) failed with error: %s", commandName, _position, e.what());
|
||||
Console::Error::WriteLine(" Skipping to the next command.");
|
||||
}
|
||||
|
||||
@@ -279,7 +279,7 @@ namespace OpenRCT2::Title
|
||||
{
|
||||
std::visit(
|
||||
[index](auto&& command) {
|
||||
if constexpr (std::is_same_v<std::decay<decltype(command)>, LoadParkCommand>)
|
||||
if constexpr (std::is_same_v<std::decay_t<decltype(command)>, LoadParkCommand>)
|
||||
{
|
||||
if (command.SaveIndex == index)
|
||||
{
|
||||
@@ -511,7 +511,7 @@ namespace OpenRCT2::Title
|
||||
{
|
||||
std::visit(
|
||||
[&buffer, &seq, &sb](auto&& command) {
|
||||
using T = std::decay<decltype(command)>::type;
|
||||
using T = std::decay_t<decltype(command)>;
|
||||
if constexpr (std::is_same_v<T, LoadParkCommand>)
|
||||
{
|
||||
if (command.SaveIndex < seq.Saves.size())
|
||||
|
||||
Reference in New Issue
Block a user