workaround for operator dot

U

Uenal Mutlu

Since operator dot ('.') is not defined, is there
maybe a workaround solution possible?
 
V

Victor Bazarov

Alvin said:
What is operator.()?

My guess is the OP wants to overload it. Since it is not
allowed, the OP wants to see what is available.

To the OP: operator-> is available, operator*() is available.
Make use of those.

V
 
U

Uenal Mutlu

My guess is the OP wants to overload it. Since it is not
allowed, the OP wants to see what is available.
Exactly.

To the OP: operator-> is available, operator*() is available.
Make use of those.

I know, but I would like to overload the dot to route
the access to a different class.
I have the feeling that this is somehow already possible,
but haven't figured out yet how.
 
V

Victor Bazarov

Uenal said:
[...]
I know, but I would like to overload the dot to route
the access to a different class.
I have the feeling that this is somehow already possible,
but haven't figured out yet how.


Well, you might want to hold onto that feeling. Nothing
compares to a dream that can never come true.

Oh, if you ever figure it out, come back and share. C++
programmers love to be surprised when it comes to C++.
 
J

Jonathan Turkanis

Uenal said:
I know, but I would like to overload the dot to route
the access to a different class.
I have the feeling that this is somehow already possible,
but haven't figured out yet how.

You might look at the delegation mechanism described here:

http://www.kangaroologic.com/interfaces/libs/interfaces/doc/index.html?path=2.6

as part of the proposed Boost Interfaces library.
(http://www.kangaroologic.com/interfaces/libs/interfaces/doc/index.html?path=2.6
)

An updated version will be available soon.

Jonathan
 
U

Uenal Mutlu

Uenal said:
[...]
I know, but I would like to overload the dot to route
the access to a different class.
I have the feeling that this is somehow already possible,
but haven't figured out yet how.


Well, you might want to hold onto that feeling. Nothing
compares to a dream that can never come true.

Oh, if you ever figure it out, come back and share. C++
programmers love to be surprised when it comes to C++.

Believe it or not, but I've got it! It is possible! And it is so simple.
I'll post it soon. Stay tuned :)
 

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

Forum statistics

Threads
474,293
Messages
2,571,500
Members
48,188
Latest member
GerardRush

Latest Threads

Top