mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add strtoimax, strtoumax
This commit is contained in:
parent
c532099a35
commit
ece20bf8ef
4 changed files with 87 additions and 0 deletions
30
sprout/cstdlib/strtoimax.hpp
Normal file
30
sprout/cstdlib/strtoimax.hpp
Normal file
|
@ -0,0 +1,30 @@
|
|||
#ifndef SPROUT_CSTDLIB_STRTOIMAX_HPP
|
||||
#define SPROUT_CSTDLIB_STRTOIMAX_HPP
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/cstdlib/str_to_int.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// strtol
|
||||
//
|
||||
inline SPROUT_CONSTEXPR std::intmax_t strtoimax(char const* str, char** endptr, int base = 10){
|
||||
return sprout::str_to_int<std::intmax_t>(str, endptr, base);
|
||||
}
|
||||
template<typename Char>
|
||||
inline SPROUT_CONSTEXPR std::intmax_t strtoimax(Char const* str, Char** endptr, int base = 10){
|
||||
return sprout::str_to_int<std::intmax_t>(str, endptr, base);
|
||||
}
|
||||
template<typename Char>
|
||||
inline SPROUT_CONSTEXPR std::intmax_t strtoimax(Char const* str, std::nullptr_t endptr, int base = 10){
|
||||
return sprout::str_to_int<std::intmax_t>(str, base);
|
||||
}
|
||||
template<typename Char>
|
||||
inline SPROUT_CONSTEXPR std::intmax_t strtoimax(Char const* str, int base = 10){
|
||||
return sprout::str_to_int<std::intmax_t>(str, base);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CSTDLIB_STRTOIMAX_HPP
|
Loading…
Add table
Add a link
Reference in a new issue