Ponca  fd5150bf9079aabdb82a6f05e419b76111c1f788
Point Cloud Analysis library
Loading...
Searching...
No Matches
typeutils.h
1/*
2This Source Code Form is subject to the terms of the Mozilla Public
3 License, v. 2.0. If a copy of the MPL was not distributed with this
4 file, You can obtain one at http://mozilla.org/MPL/2.0/.
5*/
6#pragma once
7
8namespace Ponca
9{
16 template <size_t N>
18 {
19 char value[N];
20 constexpr StringLiteral(const char (&str)[N]) { std::copy_n(str, N, value); }
21 };
22
32 inline constexpr bool strequal(const char* a, const char* b)
33 {
34 while (*a && *b)
35 {
36 if (*a != *b)
37 return false;
38
39 ++a;
40 ++b;
41 }
42
43 return *a == *b;
44 }
45} // namespace Ponca
This Source Code Form is subject to the terms of the Mozilla Public License, v.
Definition concepts.h:11
constexpr bool strequal(const char *a, const char *b)
Constexpr version of string comparison.
Definition typeutils.h:32
StringLiteral as template parameters.
Definition typeutils.h:18