This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
temporary object
- From: "He HongFu" <hhfesle1982 at 163 dot com>
- To: gcc at gcc dot gnu dot org <gcc at gcc dot gnu dot org>
- Date: Wed, 27 Aug 2003 17:46:50 +0000
- Subject: temporary object
Hi, All
Why I cannot compile it when I use a temporary object as an parameter of a reference.
but MSC can compile it sucessfully.
For example:
struct T {
int i;
int j;
};
void Foo(T&) {
}
int main() {
Foo(T(i,j));
}
Maybe g++ need some extra parameter to compile, what is?
Thanks in advance.