K
Karl Heinz Buchegger
JKop said:[snip]
There's just one thing that I want to figure out:
SomeClass object = SomeClass();
There has to be some sort of way of turning the following:
SomeClass object();
into an object definition. I've tried:
class SomeClass object();
struct SomeClass object();
But still they're a function declaration. That doesn't make sense to me.
That's because there are circumstances (don't remember which exactly) where
the compiler cannot differentaiate between a function declaration and an
object definition.
That's why there is the rule: If it lools like a function declaration, it
is a function declaration.
There is nothing you can do about it.
class SomeClass object();
object is a function which returns a class SomeClass object.
That's the way it is.