ADTF  3.18.2
strings_numeric_traits_impl.h
Go to the documentation of this file.
1 
15 #ifndef A_UTIL_UTIL_STRINGS_DETAIL_STRINGS_NUMERIC_TRAITS_IMPL_HEADER_INCLUDED
16 #define A_UTIL_UTIL_STRINGS_DETAIL_STRINGS_NUMERIC_TRAITS_IMPL_HEADER_INCLUDED
17 
19 
20 namespace a_util {
21 namespace strings {
22 template <typename Numeric>
23 bool isNumeric(const char* str)
24 {
25  return IsNumericConvertible::check(str, Numeric());
26 }
27 
28 template <typename Numeric>
29 bool isNumeric(const std::string& str)
30 {
31  return isNumeric<Numeric>(str.c_str());
32 }
33 
34 } // namespace strings
35 } // namespace a_util
36 
37 #endif // A_UTIL_UTIL_STRINGS_DETAIL_STRINGS_NUMERIC_TRAITS_IMPL_HEADER_INCLUDED
bool isNumeric(const char *str)
Check whether a string is convertible to a value of type Numeric for generic programming.
Serves as the root component, with common functionality documented in core functionality.
Definition: base.h:24
Public API for string numeric trait functions.
static bool check(const char *from, const bool &)
Check whether a conversion of string from to a boolean type is possible.