_tOut transform_when(_tIn first, _tOut result, _fPred pred, _fOp op) { yunseq((yconstraint(!is_undereferenceable(first)), 0), (yconstraint(!is_undereferenceable(result)), 0)); for(; pred(*first); yunseq((++first, 0), (++result, 0))) *result = op(*first); return result; }
_tIn next_if_eq(_tIn i, const _type& val, typename std::iterator_traits<_tIn>::difference_type n = 1) { yconstraint(!is_undereferenceable(i)); return *i == val ? std::next(i, n) : i; }
_tIn next_if(_tIn i, _fPred f, typename std::iterator_traits<_tIn>::difference_type n = 1) { yconstraint(!is_undereferenceable(i)); return f(*i) ? std::next(i, n) : i; }
Session::Session(const TextFile& tf) { ystdex::ifile_iterator i(*tf.GetPtr()); while(!tf.CheckEOF()) { if(YB_UNLIKELY(is_undereferenceable(i))) throw LoggedEvent("Bad Source!", Critical); llex.ParseByte(*i); ++i; } }