[cap-talk] Capability begginer questions
Rob Meijer
capibara at xs4all.nl
Wed Oct 3 10:08:53 EDT 2007
On Wed, October 3, 2007 15:24, Kevin Reid wrote:
> Assuming that you intend protected capabilities (which have superior
> properties), there is no reason for the "key" to be random; it might
> as well be a pointer or index referring to the implementation of the
> capability (what is invoked/accessed when the capability is used).
I've been using function objects as such in C++, but never realy
considderd them to be true capabilities, but maybe they are?
That is, if we have a File class, define a cast operator to a ReadFacet
function object and a cast operator to a WriteFacet function object, where
the *Facet has as a member a reference to the File object. These function
objects, implementing some operator()(...) method that simply invokes the
proper method of the File object, can than be 'used as' capabilities that
can be passed arround and invoked. I'm not realy sure if you should brand
these function objects capabilities, but for practical purposes I think they
are quite u usefull way to use 'as' capabilities in C++.
Rob
More information about the cap-talk
mailing list