Handle to some object, call its methods

Anonymous via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jul 15 09:39:48 PDT 2014


struct Subscription {
	const Object handle;
	private immutable size_t index;
	@disable this();
	private this(Object o, size_t i) {
		handle = o;
		index = i;
	}
}

I'd like this to be constructed with a handle to some object, and 
some other details. The source would create and return the 
Subscriptions, and the reader would call the object's const 
methods through the handle. The const "read" methods would take 
the Subscription as one of the arguments.


More information about the Digitalmars-d-learn mailing list