#include <sstream>
#include <string>
#include <type_traits>
#include <utility>
#include "common-utils/errors/utils/errorHandling.hpp"
#include "common-utils/errors/utils/errorTypes.hpp"
Go to the source code of this file.
◆ DEFINE_LEXI_CAST_OVERLOAD
| #define DEFINE_LEXI_CAST_OVERLOAD |
( |
| TYPE, |
|
|
| ABBREVIATION ) |
Value: template<> \
inline auto ::CppUtils::Strings::lexical_cast<TYPE, std::char_traits<char>>(const std::string& str) \
{ \
return std::sto##ABBREVIATION(str); \
}
A macro for creating specializations of the lexical_cast<> template where the standard library already has functions specificically for this purpose.
- Note
- A full specialization is possible here because it doesn't matter if the input string is case-sensitive or not, all we're looking for are the integers that make up the number.