fixed_string: manually copy string data to avoid <algorithm>
This commit is contained in:
parent
428e5c683d
commit
07dfd4ef3e
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <algorithm>
|
#include <string_view>
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
@ -30,7 +30,8 @@ namespace cruft {
|
|||||||
constexpr
|
constexpr
|
||||||
fixed_string (char const _value[N+1]) noexcept
|
fixed_string (char const _value[N+1]) noexcept
|
||||||
{
|
{
|
||||||
std::copy_n (_value, N, value);
|
for (std::size_t i = 0; i <= N; ++i)
|
||||||
|
value[i] = _value[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr operator char const* () const { return value; }
|
constexpr operator char const* () const { return value; }
|
||||||
|
Loading…
Reference in New Issue
Block a user