Is there a good way to allow a value class to accept a null handle as an argument to opAssign? I want to create a value class that behaves mostly like a handle and can also be set to null.
Members - Reputation: 442
Posted 17 March 2014 - 12:26 PM
Nevermind. I decided to create a companion, reference class to my value class and accept handles to that class in opAssign.
The problem is I want reference classes to work like Java (handle assignment if there is no value assignment), but that doesn't play nicely with the AngelScript syntax. Instead I'm creating value classes which are essentially handles to my application classes. Value classes don't play nicely with "null", but with the companion, no-count, reference classes I think it will work OK.