Sygaldry
Loading...
Searching...
No Matches
sygah-string_literal.hpp
1#pragma once
2/*
3Copyright 2023 Travis J. West, https://traviswest.ca, Input Devices and Music
4Interaction Laboratory (IDMIL), Centre for Interdisciplinary Research in Music
5Media and Technology (CIRMMT), McGill University, Montréal, Canada, and Univ.
6Lille, Inria, CNRS, Centrale Lille, UMR 9189 CRIStAL, F-59000 Lille, France
7
8SPDX-License-Identifier: MIT
9*/
10
11#include <cstddef>
12#include "sygah-consteval.hpp"
13
14namespace sygaldry {
15
18
21
23template<std::size_t N>
25{
27 char value[N];
29 _consteval string_literal(const char (&str)[N]) noexcept
30 {
31 for (std::size_t i = 0; i < N; ++i) value[i] = str[i];
32 }
33};
34
37}
A wrapper around a string lteral that enables using strings as template parameters.
Definition sygah-string_literal.hpp:25
_consteval string_literal(const char(&str)[N]) noexcept
Constructor from string literal.
Definition sygah-string_literal.hpp:29
char value[N]
The string buffer.
Definition sygah-string_literal.hpp:27