1
0
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:
Hielke Morsink
2022-06-21 22:30:39 +02:00
parent 0e5cfce073
commit 6a017ac761
3 changed files with 4 additions and 4 deletions

View File

@@ -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>)
{

View File

@@ -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.");
}

View File

@@ -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())