Files
dolphin/Source/Core/Common/StringLiteral.h
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
464 B
C++
Raw Normal View History

2023-01-30 22:36:25 +13:00
// Copyright 2023 Dolphin Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <algorithm>
2023-02-03 13:18:37 +13:00
namespace Common
{
2023-01-30 22:36:25 +13:00
// A useful template for passing string literals as arguments to templates
// from: https://ctrpeach.io/posts/cpp20-string-literal-template-parameters/
2023-01-31 17:29:16 +13:00
template <size_t N>
struct StringLiteral
{
consteval StringLiteral(const char (&str)[N]) { std::copy_n(str, N, value); }
2023-01-30 22:36:25 +13:00
char value[N];
};
2023-02-03 13:18:37 +13:00
} // namespace Common