codecvt::do_length

virtual int do_length(State state&,
    From *first1, const From *last1, size_t len2) const throw();

The protected virtual member function effectively calls do_out(state, first1, last1, next1, buf, buf + len2, next2) for some buffer buf and pointer next2, then returns next2 - buf. (Thus, it is roughly analogous to the function mbrlen, at least when From is type char.)

The template version always returns the lesser of last1 - first1 and len2.