diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 48914c960..e4f8b25e8 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -104,6 +104,7 @@ add_library(common STATIC serialization/boost_flat_set.h serialization/boost_small_vector.hpp serialization/boost_vector.hpp + string_literal.h string_util.cpp string_util.h swap.h diff --git a/src/common/string_literal.h b/src/common/string_literal.h new file mode 100644 index 000000000..cc148edda --- /dev/null +++ b/src/common/string_literal.h @@ -0,0 +1,24 @@ +// Copyright 2022 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include +#include + +namespace Common { + +template +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 Common