|
Boost : |
From: Henrik Ravn (henrik_at_[hidden])
Date: 2001-11-04 15:28:04
> The in-comment documentation never explains the use of
> the second "Owner" template parameter, which in NOT defaulted
> in writeonly_property, IS defaulted in readonly_property, and
> not used in readwrite_property. (In other words, a person
> must use two parameters when defining a writeonly, one
> parameter when defining a readwrite, and either one or two
> when defining a readonly).
OK, I'm working on off-line documentation for this file, but in essence
the rationale for the Owner parameter is this:
Even a readonly property must be settable from somewhere. Likewise, a
writeonly property must be readable from somewhere. The Owner specifies
a class (typically the containing class) that can do this.
Now, in some cases, a readonly property may only be set once, when
constructed. In that case the Owner parameter is never needed, so it is
defaulted to a null class. This makes less sense for a writeonly
property since it is typically read after being set. The readwrite
property does not need an Owner since, per definition, it is both
settable and gettable.
able to be written to by or writeonly propertyOwner parameter is because
even of a property
>Samples only shows one template
> parameter for all of them
No, the "writeonly_property<std::string, X> name" property in the sample
specifies (as it must) something for the Owner parameter, namely the
containing class X.
Beauty
Henrik
>
> Truth,
> James Curran
>
> -----Original Message-----
> Message: 14
> Date: 4 Nov 2001 00:42:00 -0000
> From: <boost_at_[hidden]>
> Subject: New file uploaded to boost
>
> File : /class_properties/class_properties.hpp
> Uploaded by : henrik_at_[hidden]
>
>
>
> Info: http://www.boost.org Unsubscribe:
> <mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of
> Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk