Skip to content

Commit d789eb3

Browse files
authored
Fix printing streampos to ostream
The expression (cout << y) works as described only if no shift operator of streampos into ostream is defined. That operator may be defined by user code and the result may be different.
1 parent 578d058 commit d789eb3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/standard-library/ios-typedefs.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ int main( )
6161
ofstream x( "iostream.txt" );
6262
x << "testing";
6363
streampos y = x.tellp( );
64-
cout << y << endl;
64+
cout << + y << endl;
6565
}
6666
```
6767

0 commit comments

Comments
 (0)