General Utility Library for C++14
2.12
|
Declaration of to_number().
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2.1 of the license, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program. If not, see https://www.gnu.org/licenses/.
#include <array>
#include <cmath>
#include <cstdint>
#include <cstdlib>
#include <exception>
#include <limits>
#include <type_traits>
#include "gul14/internal.h"
#include "gul14/optional.h"
#include "gul14/string_view.h"
#include "gul14/substring_checks.h"
Go to the source code of this file.
Namespaces | |
gul14 | |
Namespace gul14 contains all functions and classes of the General Utility Library. | |
Functions | |
template<typename NumberType > | |
constexpr std::enable_if_t< std::is_integral< NumberType >::value and std::is_unsigned< NumberType >::value, optional< NumberType > > | gul14::to_number (gul14::string_view str) noexcept |
Convert an ASCII string_view into a number. More... | |
template<typename NumberType > | |
constexpr std::enable_if_t< std::is_integral< NumberType >::value and std::is_signed< NumberType >::value, optional< NumberType > > | gul14::to_number (gul14::string_view str) noexcept |
template<typename NumberType > | |
constexpr std::enable_if_t< std::is_floating_point< NumberType >::value, optional< NumberType > > | gul14::to_number (gul14::string_view str) noexcept |
template<> | |
constexpr optional< bool > | gul14::to_number< bool > (gul14::string_view str) noexcept |