3#ifndef TETL_STRING_STOD_HPP
4#define TETL_STRING_STOD_HPP
6#include <etl/_cstddef/size_t.hpp>
7#include <etl/_iterator/distance.hpp>
8#include <etl/_string/basic_inplace_string.hpp>
9#include <etl/_strings/to_floating_point.hpp>
18template <size_t Capacity>
19[[nodiscard]]
constexpr auto stof(inplace_string<Capacity>
const& str, size_t* pos =
nullptr) ->
float
21 auto const result =
etl::
strings::to_floating_point<
float>({str.data(), str.size()});
23 *pos =
static_cast<size_t>(
etl::distance(str.data(), result.end));
33template <size_t Capacity>
34[[nodiscard]]
constexpr auto stod(inplace_string<Capacity>
const& str, size_t* pos =
nullptr) ->
double
36 auto const result =
etl::
strings::to_floating_point<
double>({str.data(), str.size()});
38 *pos =
static_cast<size_t>(
etl::distance(str.data(), result.end));
48template <size_t Capacity>
49[[nodiscard]]
constexpr auto stold(inplace_string<Capacity>
const& str, size_t* pos =
nullptr) ->
long double
51 auto const result =
etl::
strings::to_floating_point<
long double>({str.data(), str.size()});
53 *pos =
static_cast<size_t>(
etl::distance(str.data(), result.end));
constexpr auto stof(inplace_string< Capacity > const &str, size_t *pos=nullptr) -> float
Interprets a floating point value in a string str.
Definition stod.hpp:19
constexpr auto stold(inplace_string< Capacity > const &str, size_t *pos=nullptr) -> long double
Interprets a floating point value in a string str.
Definition stod.hpp:49
constexpr auto stod(inplace_string< Capacity > const &str, size_t *pos=nullptr) -> double
Interprets a floating point value in a string str.
Definition stod.hpp:34
Definition adjacent_find.hpp:9