Function uncat

Synopsis

#include <src/c4/format.hpp>

template <class Arg, class... Args>
size_t uncat(csubstr buf, Arg &C4_RESTRICT a, Args &C4_RESTRICT ...more)

Description

deserialize the arguments from the given buffer.

Returns
the number of characters read from the buffer, or csubstr::npos if a conversion was not successful.
See
c4::cat(). c4::uncat() is the inverse of c4::cat().

Mentioned in

Source

Lines 483-492 in src/c4/format.hpp.

template<class Arg, class... Args>
size_t uncat(csubstr buf, Arg & C4_RESTRICT a, Args & C4_RESTRICT ...more)
{
    size_t out = from_chars_first(buf, &a);
    if(C4_UNLIKELY(out == csubstr::npos)) return csubstr::npos;
    buf  = buf.len >= out ? buf.sub(out) : substr{};
    size_t num = uncat(buf, more...);
    if(C4_UNLIKELY(num == csubstr::npos)) return csubstr::npos;
    return out + num;
}





Add Discussion as Guest

Log in