mirror of
https://git.suyu.dev/suyu/dynarmic.git
synced 2025-12-22 05:36:23 +01:00
Squashed 'externals/oaknut/' content from commit 86f2ca872
git-subtree-dir: externals/oaknut git-subtree-split: 86f2ca87222e59fb0b89b2f2a6b422a58a2e0892
This commit is contained in:
commit
621367dce8
22 changed files with 15077 additions and 0 deletions
24
include/oaknut/impl/string_literal.hpp
Normal file
24
include/oaknut/impl/string_literal.hpp
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
// SPDX-FileCopyrightText: Copyright (c) 2022 merryhime <https://mary.rs>
|
||||
// SPDX-License-Identifier: MIT
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
|
||||
namespace oaknut {
|
||||
|
||||
template<size_t N>
|
||||
struct StringLiteral {
|
||||
constexpr StringLiteral(const char (&str)[N])
|
||||
{
|
||||
std::copy_n(str, N, value);
|
||||
}
|
||||
|
||||
static constexpr std::size_t strlen = N - 1;
|
||||
static constexpr std::size_t size = N;
|
||||
|
||||
char value[N];
|
||||
};
|
||||
|
||||
} // namespace oaknut
|
||||
Loading…
Add table
Add a link
Reference in a new issue