What is the use of namespacename::classname().function()

M

My4th

I am looking in some old code of someone who's gone. Why should one use
something like namespacename::classname().thefunction()? He repeatedly does
that.

The function is virtual and not static. If you create a temporary
namespacename::classname() class to call thefunction(), at least that is
what I understand of it, then would it not be more sense to make thefunction
static? What the use of making thefunction virtual if you already decide
which function you call, for the temp class you use?
 
R

Rolf Magnus

My4th said:
I am looking in some old code of someone who's gone. Why should one use
something like namespacename::classname().thefunction()? He repeatedly
does that.

The function is virtual and not static. If you create a temporary
namespacename::classname() class to call thefunction(), at least that is
what I understand of it, then would it not be more sense to make
thefunction static?

Only if calling it on temporaries is the only useful way of calling it.
What the use of making thefunction virtual if you already decide which
function you call, for the temp class you use?

Again, it depends on wether the temporary is the only way the function could
ever be used.
 
M

My4th

Rolf Magnus said:
Only if calling it on temporaries is the only useful way of calling it.

ok! I am stuying this code before I can say whether or not its used in other
contekstes also.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,149
Latest member
Vinay Kumar Nevatia0
Top