mirror of
				https://github.com/dolphin-emu/dolphin.git
				synced 2025-10-24 17:09:06 +00:00 
			
		
		
		
	Co-authored-by: Mai <mathew1800@gmail.com> Co-authored-by: BhaaL <bhaalsen@gmail.com> Co-authored-by: iwubcode <iwubcode@users.noreply.github.com>
		
			
				
	
	
		
			20 lines
		
	
	
	
		
			464 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
	
		
			464 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| // Copyright 2023 Dolphin Emulator Project
 | |
| // SPDX-License-Identifier: GPL-2.0-or-later
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <algorithm>
 | |
| 
 | |
| namespace Common
 | |
| {
 | |
| // A useful template for passing string literals as arguments to templates
 | |
| // from: https://ctrpeach.io/posts/cpp20-string-literal-template-parameters/
 | |
| template <size_t N>
 | |
| struct StringLiteral
 | |
| {
 | |
|   consteval StringLiteral(const char (&str)[N]) { std::copy_n(str, N, value); }
 | |
| 
 | |
|   char value[N];
 | |
| };
 | |
| 
 | |
| }  // namespace Common
 |