[ox/std] Make CharBufferWriter constructor take a Span
This commit is contained in:
parent
e13eebaf0b
commit
8f25ef96ff
3
deps/ox/src/ox/std/buffer.hpp
vendored
3
deps/ox/src/ox/std/buffer.hpp
vendored
@ -100,8 +100,7 @@ class CharBuffWriter {
|
|||||||
char *m_buff = nullptr;
|
char *m_buff = nullptr;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
template<std::size_t sz>
|
explicit constexpr CharBuffWriter(ox::Span<char> buff) noexcept:
|
||||||
explicit constexpr CharBuffWriter(ox::Array<char, sz> &buff) noexcept:
|
|
||||||
m_cap(buff.size()),
|
m_cap(buff.size()),
|
||||||
m_buff(buff.data()) {
|
m_buff(buff.data()) {
|
||||||
}
|
}
|
||||||
|
2
deps/ox/src/ox/std/fmt.hpp
vendored
2
deps/ox/src/ox/std/fmt.hpp
vendored
@ -88,7 +88,7 @@ class FmtArg {
|
|||||||
if constexpr(is_bool_v<T>) {
|
if constexpr(is_bool_v<T>) {
|
||||||
return v ? "true" : "false";
|
return v ? "true" : "false";
|
||||||
} else if constexpr(is_integer_v<T>) {
|
} else if constexpr(is_integer_v<T>) {
|
||||||
ox::CharBuffWriter w(dataStr.data(), DataSz);
|
ox::CharBuffWriter w{dataStr};
|
||||||
std::ignore = ox::writeItoa(v, w);
|
std::ignore = ox::writeItoa(v, w);
|
||||||
return dataStr.data();
|
return dataStr.data();
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user