Commit 9aaa9ee0 by Benjamin Kosnik Committed by Benjamin Kosnik

fpos.h (fpos::operator-): Don't return reference, return original, non-modified version.


2001-06-12  Benjamin Kosnik  <bkoz@redhat.com>

	* include/bits/fpos.h (fpos::operator-): Don't return reference,
	return original, non-modified version.
	(fpos::operator+): Same.
	* testsuite/27_io/fpos.cc: Add test.

[[Split portion of a mixed commit.]]

From-SVN: r43290.2
parent 7f3e3e0a
......@@ -3,7 +3,8 @@
* include/bits/fpos.h (fpos::operator-): Don't return reference,
return original, non-modified version.
(fpos::operator+): Same.
* testsuite/27_io/fpos.cc: Add test.
2001-06-12 Loren J. Rittle <ljrittle@acm.org>
libstdc++/2071
......
......@@ -107,12 +107,18 @@ void test02()
pos03 = pos03 + off02;
pos04 += off02;
VERIFY( pos03 == pos04 );
std::streampos pos05 = pos03;
std::streampos pos06 = pos03 + off02;
VERIFY ( pos05 == pos03 );
// q = p - o
// p -= o
pos03 = pos03 - off02;
pos04 -= off02;
VERIFY( pos03 == pos04 );
std::streampos pos07 = pos03;
std::streampos pos08 = pos03 - off02;
VERIFY ( pos07 == pos03 );
// o = p - q
VERIFY( 0 == pos03 - pos04 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment