|
Boost : |
From: Edward Diener (eddielee_at_[hidden])
Date: 2003-01-18 12:55:24
"David Abrahams" <dave_at_[hidden]> wrote in message
news:u4r86xzwa.fsf_at_boost-consulting.com...
> "Edward Diener" <eddielee_at_[hidden]> writes:
>
> > "David Abrahams" <dave_at_[hidden]> wrote in message
> > news:un0lyy3d0.fsf_at_boost-consulting.com...
> >>
> >> In Boost.Python I'm using a system for interfaces such as this one
> >> where optional template parameters can be passed in any order. I'm
> >> using the properties of the type to detect their meaning. It works
> >> great. Using boost/mpl/has_xxx.hpp (and, for compilers which don't
> >> support it, is_base_and_derived) should be enough to build a nice
> >> policy-based interface.
> >
> > Is the technique of allowing optional template parameters to be passed
in
> > any order a part of MPL ? I haven't looked at MPL at all since I didn't
see
> > it in Boost 1.29 but maybe it is there and I missed it.
>
> No; it's implemented in Boost.Python using MPL components, though.
Maybe it should be refactored out into the MPL if it is generic enough to do
so and then others can use it more easily in their own policy-like classes ?
If it is not generic enough, maybe the technique can be documented
somewhere. I know as a user of policy-like classes the biggest difficulty is
having to choose the correct optional parameters when one wants to change
any one of them from the default. If your technique can get around this
limitation while providing multiple policies, I would love to read about how
it works so that if I ever design policy-based template classes I can use it
also. I am a big believer of 3rd party library ease of use while the inner
code can be as complex as necessary, a technique which Boost libraries
generally follow well.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk