That's all the standard has to say about it:
n3242, 21.4.7.8
- Requires:
pos <= size() - Throws:
out_of_range if pos > size() - Effects: determines the effective length of the
rlen string to copy as less than n and size() - pos - Returns:
basic_string<charT,traits,Allocator>(data()+pos,rlen) .
Thus, the answer will be negative, the complexity is not defined.
EDIT: Fixed according to n3242, pos> size not pos> = size
source share