Jump to content

  • Log In with Google      Sign In   
  • Create Account


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


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
	operator node () { return m_node; }

	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

James Mintram