Mengalami masalah dalam mengkompilasi sintaksis ini menggunakan Visual Studio Nov 2012 CTP C++ Compiler ... Hanya ingin memastikan saya tidak melewatkan sesuatu yang jelas.
Terima kasih!
EDIT: Header dihapus untuk membuatnya lebih sederhana.
class Location
{
public:
Location();
};
class Shape
{
public:
Shape();
Shape(Location location);
};
// Doing this by pointer works ...
// Shape::Shape(Location* location){}
// Shape::Shape() : Shape(new Location()){}
Shape::Shape(Location location)
{
}
Shape::Shape()
: Shape(Location())
// error C2143: syntax error: missing ';' before ':'
{
// int x = 0;
// (void) x; // Added these two lines in some cases to get it to compile.
// These two lines do nothing, but get around a compiler issue.
}
void
untuk menunjukkan fungsi tidak memerlukan argumen... AUGH! - person Nik Bougalis   schedule 17.01.2013