Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


JamesMintram

Member Since 01 Apr 2012
Offline Last Active Dec 25 2012 09:40 AM

Topics I've Started

Implicit cast to another class?

01 April 2012 - 12:00 PM

Hello,

Is it possible with angelcode script to create a class that can be implicitly cast to another class?
Here is an example of usage (not written in Angelcode but you should get the idea)

class node
{
};

class anotherNode
{
public:
	operator node () { return m_node; }

protected:
	node m_node;
};

void needsNode ( node item ) {}

anotherNode someItem;
needsNode ( someItem );	 //Here we call a function that needs a node class so someItem is implicity cast

I should also note that I am wanting to do this with references/handles not concrete objects.

Hopefully you can see what I am trying to achieve Posted Image

Regards,
James Mintram

PARTNERS