tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
strtoul.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_CSTDLIB_STRTOUL_HPP
4#define TETL_CSTDLIB_STRTOUL_HPP
5
8
9namespace etl {
10
14[[nodiscard]] constexpr auto strtoul(char const* str, char const** last, int base) noexcept -> unsigned long
15{
16 auto const res = strings::to_integer<unsigned long>(str, static_cast<unsigned long>(base));
17 if (last != nullptr) {
18 *last = res.end;
19 }
20 return res.value;
21}
22
26[[nodiscard]] constexpr auto strtoull(char const* str, char const** last, int base) noexcept -> unsigned long long
27{
28 auto const res = strings::to_integer<unsigned long long>(str, static_cast<unsigned long long>(base));
29 if (last != nullptr) {
30 *last = res.end;
31 }
32 return res.value;
33}
34
35} // namespace etl
36
37#endif // TETL_CSTDLIB_STRTOUL_HPP
constexpr auto to_integer(string_view str, Int base=Int(10)) noexcept -> to_integer_result< Int >
Definition to_integer.hpp:93
Definition adjacent_find.hpp:8
constexpr auto strtoul(char const *str, char const **last, int base) noexcept -> unsigned long
Interprets an integer value in a byte string pointed to by str.
Definition strtoul.hpp:14
constexpr auto strtoull(char const *str, char const **last, int base) noexcept -> unsigned long long
Interprets an integer value in a byte string pointed to by str.
Definition strtoul.hpp:26