parse: move internal helpers into an anonymous namespace
This commit is contained in:
parent
ba01794d0b
commit
8c934fbd2c
13
parse.cpp
13
parse.cpp
@ -16,10 +16,12 @@
|
|||||||
|
|
||||||
using cruft::parse;
|
using cruft::parse;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
namespace {
|
||||||
/// A trait class that records the C string parsing function for a given type.
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
/// A trait class that records the C string parsing function for a given
|
||||||
|
/// type.
|
||||||
///
|
///
|
||||||
/// Not all types will necessarily have a corresponding parsing function. eg,
|
/// Not all types will necessarily have a corresponding parsing function.
|
||||||
template <typename ValueT> struct parse_traits { };
|
template <typename ValueT> struct parse_traits { };
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
@ -35,7 +37,7 @@ template <> struct parse_traits<double> { static constexpr auto value = str
|
|||||||
template <> struct parse_traits<long double> { static constexpr auto value = strtold; };
|
template <> struct parse_traits<long double> { static constexpr auto value = strtold; };
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
template <typename ValueT>
|
template <typename ValueT>
|
||||||
ValueT
|
ValueT
|
||||||
c_iparse (cruft::view<char const*> &data)
|
c_iparse (cruft::view<char const*> &data)
|
||||||
@ -52,7 +54,7 @@ c_iparse (cruft::view<char const*> &data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-------------------------------------------------------------------------
|
||||||
template <typename ValueT>
|
template <typename ValueT>
|
||||||
ValueT
|
ValueT
|
||||||
c_fparse (cruft::view<char const*> &data)
|
c_fparse (cruft::view<char const*> &data)
|
||||||
@ -67,6 +69,7 @@ c_fparse (cruft::view<char const*> &data)
|
|||||||
data = data.consume (tail);
|
data = data.consume (tail);
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
x
Reference in New Issue
Block a user