Began working on mfem_resolver formatters
This commit is contained in:
@@ -71,7 +71,7 @@ namespace serif::utils::errors {
|
||||
|
||||
// Note if we move to C++26 we can replace this with a more standard and less convoluted
|
||||
// formated static_assert.
|
||||
sizeof(serif_error_printer<message, code>);
|
||||
[[maybe_unused]] std::size_t error_kick = sizeof(serif_error_printer<message, code>);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
19
src/include/serif/utils/format/strings.hpp
Normal file
19
src/include/serif/utils/format/strings.hpp
Normal file
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <span>
|
||||
#include <format>
|
||||
#include <type_traits>
|
||||
|
||||
namespace serif::utils::misc::format {
|
||||
template <typename T>
|
||||
std::string join(const std::span<T>& elements, std::string_view delimiter)
|
||||
{
|
||||
std::string out;
|
||||
for (const auto& element : elements) {
|
||||
out = std::format("{}{}{}", out, delimiter, element);
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <string_view>
|
||||
#include <cstdio>
|
||||
#include <cstdlib>
|
||||
#include <utility>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace serif::utils::misc::terminal {
|
||||
@@ -71,4 +72,4 @@ namespace serif::utils::misc::terminal {
|
||||
|
||||
return std::string_view(term) != "dumb";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user