Commit 718c1385 by Maarten L. Hekkelman

Fix constructor for item

parent 29aac70e
...@@ -73,7 +73,6 @@ class item ...@@ -73,7 +73,6 @@ class item
template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0> template <typename T, std::enable_if_t<std::is_floating_point_v<T>, int> = 0>
item(const std::string_view name, const T &value) item(const std::string_view name, const T &value)
: m_name(name) : m_name(name)
, m_value(std::to_string(value))
{ {
auto r = cif::to_chars(m_buffer, m_buffer + sizeof(m_buffer) - 1, value, cif::chars_format::general); auto r = cif::to_chars(m_buffer, m_buffer + sizeof(m_buffer) - 1, value, cif::chars_format::general);
if (r.ec != std::errc()) if (r.ec != std::errc())
...@@ -87,7 +86,6 @@ class item ...@@ -87,7 +86,6 @@ class item
template <typename T, std::enable_if_t<std::is_integral_v<T>, int> = 0> template <typename T, std::enable_if_t<std::is_integral_v<T>, int> = 0>
item(const std::string_view name, const T &value) item(const std::string_view name, const T &value)
: m_name(name) : m_name(name)
, m_value(std::to_string(value))
{ {
auto r = std::to_chars(m_buffer, m_buffer + sizeof(m_buffer) - 1, value); auto r = std::to_chars(m_buffer, m_buffer + sizeof(m_buffer) - 1, value);
if (r.ec != std::errc()) if (r.ec != std::errc())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment