mirror of
https://github.com/bolero-MURAKAMI/Sprout
synced 2025-08-03 12:49:50 +00:00
add atoi, atol, strtol
This commit is contained in:
parent
1968a6fac4
commit
50fd5f33bf
11 changed files with 307 additions and 55 deletions
20
sprout/cstdlib/atol.hpp
Normal file
20
sprout/cstdlib/atol.hpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#ifndef SPROUT_CSTDLIB_ATOL_HPP
|
||||
#define SPROUT_CSTDLIB_ATOL_HPP
|
||||
|
||||
#include <sprout/config.hpp>
|
||||
#include <sprout/cstdlib/decimal_to_int.hpp>
|
||||
|
||||
namespace sprout {
|
||||
//
|
||||
// atol
|
||||
//
|
||||
inline SPROUT_CONSTEXPR long atol(char const* str) {
|
||||
return sprout::decimal_to_int<long>(str);
|
||||
}
|
||||
template<typename Char>
|
||||
inline SPROUT_CONSTEXPR int atol(Char const* str) {
|
||||
return sprout::decimal_to_int<int>(str);
|
||||
}
|
||||
} // namespace sprout
|
||||
|
||||
#endif // #ifndef SPROUT_CSTDLIB_ATOL_HPP
|
Loading…
Add table
Add a link
Reference in a new issue