|
OpenTTD
|
A "fake" pointer to enable operator-> on temporaries. More...
#include <linkgraph.h>
Public Member Functions | |
| FakePointer (const SmallPair< NodeID, Tedge_wrapper > &pair) | |
| Construct a fake pointer from a pair of NodeID and edge. | |
| SmallPair< NodeID, Tedge_wrapper > * | operator-> () |
| Retrieve the pair by operator->. | |
Public Member Functions inherited from SmallPair< NodeID, Tedge_wrapper > | |
| SmallPair (const NodeID &first, const Tedge_wrapper &second) | |
| Initializes this Pair with data. | |
Additional Inherited Members | |
Data Fields inherited from SmallPair< NodeID, Tedge_wrapper > | |
| NodeID | first |
| Tedge_wrapper | second |
A "fake" pointer to enable operator-> on temporaries.
As the objects returned from operator* aren't references but real objects, we have to return something that implements operator->, but isn't a pointer from operator->. A fake pointer.
Definition at line 193 of file linkgraph.h.
|
inline |
Construct a fake pointer from a pair of NodeID and edge.
| pair | Pair to be "pointed" to (in fact shallow-copied). |
Definition at line 200 of file linkgraph.h.
|
inline |
Retrieve the pair by operator->.
Definition at line 206 of file linkgraph.h.
1.8.1.2