Commit e020e694 authored by Dominik Charousset's avatar Dominik Charousset

Document behavior or parse function on error

parent 71b529ee
...@@ -31,6 +31,7 @@ namespace parser { ...@@ -31,6 +31,7 @@ namespace parser {
// Sum up integers when parsing positive integers. // Sum up integers when parsing positive integers.
// @returns `false` on an overflow, otherwise `true`. // @returns `false` on an overflow, otherwise `true`.
// @pre `isdigit(c) || (Base == 16 && isxdigit(c))` // @pre `isdigit(c) || (Base == 16 && isxdigit(c))`
// @warning can leave `x` in an intermediate state when retuning `false`
template <int Base, class T> template <int Base, class T>
bool add_ascii(T& x, char c, enable_if_tt<std::is_integral<T>, int> u = 0) { bool add_ascii(T& x, char c, enable_if_tt<std::is_integral<T>, int> u = 0) {
CAF_IGNORE_UNUSED(u); CAF_IGNORE_UNUSED(u);
......
...@@ -31,6 +31,7 @@ namespace parser { ...@@ -31,6 +31,7 @@ namespace parser {
// Subtracs integers when parsing negative integers. // Subtracs integers when parsing negative integers.
// @returns `false` on an underflow, otherwise `true`. // @returns `false` on an underflow, otherwise `true`.
// @pre `isdigit(c) || (Base == 16 && isxdigit(c))` // @pre `isdigit(c) || (Base == 16 && isxdigit(c))`
// @warning can leave `x` in an intermediate state when retuning `false`
template <int Base, class T> template <int Base, class T>
bool sub_ascii(T& x, char c, enable_if_tt<std::is_integral<T>, int> u = 0) { bool sub_ascii(T& x, char c, enable_if_tt<std::is_integral<T>, int> u = 0) {
CAF_IGNORE_UNUSED(u); CAF_IGNORE_UNUSED(u);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment