Quirks of 'alias foo this'

2011-04-25 Thread Sean Cavanaugh
So my research into making a nice friendly to use COM interface wrapper for D has had a few odd turns and I am wondering if there is an answer to making the implementation nicer. I discovered the 'alias foo this' syntax to let structs nearly seamlessly impersonate a member variable. This has

Re: Quirks of 'alias foo this'

2011-04-25 Thread Andrej Mitrovic
I have a similar problem. :) I'd like to catch a call to a COM object to check if it was properly initialized first. Here's one way to do it with regular classes: http://codepad.org/lHsQf4UG You can read about whitehole here: http://www.digitalmars.com/d/2.0/phobos/std_typecons.html#WhiteHole

Re: Quirks of 'alias foo this'

2011-04-25 Thread Andrej Mitrovic
Well I've tried it with a COM object and it seems to work. So I'll definitely use this technique now. I do wish whitehole gave me the option to throw a custom error message.