"David Abrahams" <[EMAIL PROTECTED]> wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > "Edward Diener" <[EMAIL PROTECTED]> writes: > > > "David Abrahams" <[EMAIL PROTECTED]> wrote in message > > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > >> > >> 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. _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost