1

Possible Duplicate:
What is an unnamed type in C++?

I am new in OOP with C++. I would really appreciate if anyone can simply give me some idea about the "nameless object." When it is created and what is the advantage? Thanks in advance.

Community
  • 1
  • 1
newbie
  • 4,639
  • 10
  • 32
  • 45

1 Answers1

4

Probably you mean "anonymous" which is the same as it's a Greek word which translates to "without name". So try looking for anonymous classes and methods to learn more:

For an easy example let's say :

rectangle(point(0,0),point(100,100));

The point(0,0) and point(100,100) create "nameless" objects (I hope you are referring to this and not something else).

johnsyweb
  • 136,902
  • 23
  • 188
  • 247
isioutis
  • 304
  • 2
  • 13
  • 1
    well… if `rectangle` and `point` are both types, then that line will create three anonymous temporaries and then discard them. – Potatoswatter Jan 02 '12 at 08:35
  • As Potatoswatter says, these are anonymous *temporaries*, which are not the same as anonymous *types*, but it's not entirely clear from the question in which of these @Skeptic is interested. – johnsyweb Jan 02 '12 at 08:47