#include<iostream>
struct Foo
{
};
void func(Foo& f)
{
std::cout << "foo" ;
}
int main()
{
func(Foo());//ok compile
std::cin.ignore();
return 1;
}
the standard doesn't say this king of thing is not legal ? Is it a bug ?
#include<iostream>
struct Foo
{
};
void func(Foo& f)
{
std::cout << "foo" ;
}
int main()
{
func(Foo());//ok compile
std::cin.ignore();
return 1;
}
the standard doesn't say this king of thing is not legal ? Is it a bug ?
It shouldn't be legal. But some older version of Visual C++ (for instance VC6) allow it, afaik.