The same syntax is accepted by the only other C++ compiler I have access
too: Sun's. I guess what I don't understand is why, if I create a
temporary by explicitly calling the copy constructor, that temporary is
treated as an rvalue.
So how do you want to proceed? If you're certain that you'r
Daniel Jacobowitz wrote:
On Wed, Apr 30, 2008 at 05:51:32PM -0500, Jason Kraftcheck wrote:
Why can't I take a reference to an rvalue?
Because you can't modify rvalues. This is the definition of the C++
language. The next major revision of C++ will have T &&rref, the two
am
Daniel Jacobowitz wrote:
severity 478734 normal
thanks
On Wed, Apr 30, 2008 at 11:55:19AM -0500, Jason Kraftcheck wrote:
Severity: grave
This is not grave, g++ is perfectly usable for other code.
I emmits the following error message:
bug.cc: In function 'int main()':
bug.cc:6:
Package: g++-4.2
Version: 4.2.3-4
Severity: grave
Justification: renders package unusable
g++ refuses to compile the following syntax commonly used to force a
std::vector to release allocated memory:
#include
int main()
{
std::vector v;
v.clear();
v.swap( std::vector(v) );
Falk Hueffner wrote:
Jason Kraftcheck <[EMAIL PROTECTED]> writes:
In practice, how can it be anything other than a void*?
It can't. You know, the "-pedantic" option is called "-pedantic" for a
Yes, but there's a difference between pedantic and pointless. Alt
Falk Hueffner wrote:
Jason Kraftcheck <[EMAIL PROTECTED]> writes:
The C standard says there's a difference between printing a void*
and a int* (or any other type)? How can a pointer passed through a
var-args list be anything but a void*? The C standard may say that
%p prints a void*
Falk Hueffner wrote:
Jason Kraftcheck <[EMAIL PROTECTED]> writes:
If the following is compiled with the options -Wall -pedantic-errors :
#include
int main( )
{
int i;
printf("%p\n", &i );
return 0;
}
gcc emits the following:
voidptr.c: In function `main
Package: gcc-3.2
Version: 1:3.2.3-8
Severity: minor
If the following is compiled with the options -Wall -pedantic-errors :
#include
int main( )
{
int i;
printf("%p\n", &i );
return 0;
}
gcc emits the following:
voidptr.c: In function `main':
voidptr.c:5: warning: void fo
Falk Hueffner wrote:
Jason Kraftcheck <[EMAIL PROTECTED]> writes:
The output of the following code, when compiled with g++-3.3 is '2'. It
should be '1'.
I cannot reproduce this with g++-3.3 1:3.3.2-0pre5.0.1 (3.3.2
20031005) on Alpha. Maybe it's target specific
Package: g++-3.3
Version: 1:3.3.2-0pre4
Severity: normal
The output of the following code, when compiled with g++-3.3 is '2'. It
should be '1'.
#include
struct foo {
foo(): v(0), c(0) {}
int& value() { c++; return v; }
int count() { return c; }
int v, c;
};
10 matches
Mail list logo