|
Boost : |
From: Pavel Vozenilek (pavel_vozenilek_at_[hidden])
Date: 2004-08-28 03:25:11
"Jonathan Turkanis" wrote:
______________________________________________________________
> > > 7. stream_buf_wrapping.hpp: there are three hardcoded
> > > constructors like:
> > >
> > > template < typename T1, typename T2, typename T3 >
> > > basic_wrapping_ios( T1 x1, T2 x2, T3 x3 )
> > >
> > > for 1, 2 and 3 parameters though base_from_member
> > > supports up to 10 parameters.
> >
> > I wrote base_from_member, and I extended BFM after initially writing
> > More-I/O.
> >
> > > Boost.Preprocessor can be used here to generate
> > > contructors of all available arities.
> >
> > Any suggestions on how? And should I leave the arity number available
in
> > BFM (as a #define) so others can mirror it?
>
> I've attached a version of base_from_member.hpp with configurable maximum
arity,
> defaulting to 10. If you need higher arity, you #define
> BOOST_BASE_FROM_MEMBER_MAX_ARITY to an appropriate value before including
the
> header.
>
> The same technique will work for streambuf wrapping.
>
It may be better to use local iteration technique.
Some preprocessors (e.g. BCB) have quite low limit
on length of expanded macro (BCB has some 1-2kB).
Local iteration is also faster on EDG based frontends.
For base-from-member it is probably safe
but streamsbufs may be harder.
/Pavel
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk