Code compiles and passes tests without NO_STDLIB define

This commit is contained in:
Andreas Tsouchlos 2022-02-20 00:26:48 +01:00
parent 6ba83fd582
commit 9bd1104e5f
3 changed files with 3 additions and 2 deletions

View File

@ -12,6 +12,7 @@
#include <stdint.h> #include <stdint.h>
#include "std_lib.h"
#include "utility.h" #include "utility.h"

View File

@ -5,6 +5,7 @@
#ifndef CONST_FMT_NO_CPP_STD_LIB #ifndef CONST_FMT_NO_CPP_STD_LIB
#include <array> #include <array>
#include <cstring>
#else #else

View File

@ -20,8 +20,7 @@ template <std::size_t N>
class ConstString { class ConstString {
public: public:
constexpr ConstString(const char (&content)[N]) noexcept { constexpr ConstString(const char (&content)[N]) noexcept {
std::copy(&content[0], (&content[N-1] + 1), std::copy(&content[0], (&content[N - 1] + 1), m_content.begin());
m_content.begin());
} }
constexpr char operator[](std::size_t index) const noexcept { constexpr char operator[](std::size_t index) const noexcept {