This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
confusion about string.erase( --string.end() )
- From: Pawel Sikora <pluto at agmk dot net>
- To: gcc-help at gcc dot gnu dot org
- Date: Tue, 22 Nov 2011 16:31:42 +0100
- Subject: confusion about string.erase( --string.end() )
Hi,
afaics the gcc-4.6 accepts following code:
#include <string>
int main()
{
std::string line( "blabla" );
line.erase( --line.end() );
}
but other compilers reject such code:
msvc8 : error C2105: '--' needs l-value
comeau : error: expression must be a modifiable lvalue
is it a bug in g++?
BR,
PaweÅ.