/ src / common / string_literal.h
string_literal.h
 1  // Copyright 2022 Citra Emulator Project
 2  // Licensed under GPLv2 or any later version
 3  // Refer to the license.txt file included.
 4  
 5  #pragma once
 6  
 7  #include <algorithm>
 8  #include <cstddef>
 9  
10  namespace Common {
11  
12  template <std::size_t N>
13  struct StringLiteral {
14      constexpr StringLiteral(const char (&str)[N]) {
15          std::copy_n(str, N, value);
16      }
17  
18      static constexpr std::size_t strlen = N - 1;
19      static constexpr std::size_t size = N;
20  
21      char value[N];
22  };
23  
24  } // namespace Common