On Thu, May 02, 2002 at 08:18:32PM +0200, Lars Gullik Bjønnes wrote:
> I think that
> 
>        str.substr(0) == str
>        str.substr(0, <number larger than leght of str>) == str
> 
> easy to check though.

  21.3.6.7  basic_string::substr                    [lib.string::substr]

  basic_string<charT,traits,Allocator>
    substr(size_type pos = 0, size_type n = npos) const;

  Requires:
    pos <= size()
  Throws:
    out_of_range if pos > size().
  Effects:
    Determines  the  effective  length rlen of the string to copy as the
    smaller of n and size() - pos.

Looks as though you are right.

Andre'

-- 
Those who desire to give up Freedom in order to gain Security,
will not have, nor do they deserve, either one. (T. Jefferson)

Reply via email to