7#include "../macros.hpp"
9#include "exception.hpp"
16hi_export_module(hikogui.utility.charconv);
18hi_export
namespace hi {
inline namespace v1 {
26template<std::
integral T>
31 hilet first =
buffer.data();
32 hilet last = first +
buffer.size();
34 hilet[
new_last,
ec] = std::to_chars(first, last, value);
48template<std::
floating_po
int T>
53 hilet first =
buffer.data();
54 hilet last = first +
buffer.size();
56 hilet[
new_last,
ec] = std::to_chars(first, last, value, std::chars_format::general);
72template<std::
integral T>
77 hilet first = str.data();
78 hilet last = first +
ssize(str);
80 hilet[
new_last,
ec] = std::from_chars(first, last, value, base);
82 throw parse_error(
"Can not convert string to integer");
95template<std::
floating_po
int T>
100 hilet first = str.data();
101 hilet last = first +
ssize(str);
103 hilet[
new_last,
ec] = std::from_chars(first, last, value);
105 throw parse_error(
"Can not convert string to floating point");
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
T from_string(std::string_view str, int base=10)
Convert a string to an integer.
Definition charconv.hpp:73
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
Exception thrown during parsing on an error.
Definition exception_intf.hpp:47
T back_inserter(T... args)