|
Boost : |
From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-08-27 22:48:53
"Daryle Walker" <darylew_at_[hidden]> wrote:
> On 8/22/04 2:19 PM, "Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> 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.
Jonathan
begin 666 base_from_member.hpp
M+R\@(&)O;W-T('5T:6QI='DO8F%S95]F<F]M7VUE;6)E<BYH<' @:&5A9&5R
M(&9I;&4@("TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+R\-"@T*+R\@($-O
M<'ER:6=H=" R,# Q+" R,# S($1A<GEL92!786QK97(N("!5<V4L(&UO9&EF
M:6-A=&EO;BP_at_86YD(&1I<W1R:6)U=&EO;B!A<F4-"B\O("!S=6)J96-T('1O
M('1H92!";V]S="!3;V9T=V%R92!,:6-E;G-E+"!697)S:6]N(#$N,"X@("A3
M964_at_86-C;VUP86YY:6YG(&9I;&4-"B\O("!,24-%3E-%7S%?,"YT>'0@;W(@
M82!C;W!Y(&%T(#QH='1P.B\O=W=W+F)O;W-T+F]R9R],24-%3E-%7S%?,"YT
M>'0^+BD-"@T*+R\@(%-E92 \:'1T<#HO+W=W=RYB;V]S="YO<F<O;&EB<R]U
M=&EL:71Y+SX_at_9F]R('1H92!L:6)R87)Y)W,@:&]M92!P86=E+@T*#0HO+R P
M."TR-RTP-#H_at_2F]N871H86X_at_5'5R:V%N:7,@;6%D92!M87AI;75M(&%R:71Y
M(&-O;F9I9W5R86)L92X-"@T*(VEF;F1E9B!"3T]35%]55$E,25197T)!4T5?
M1E)/35]-14U"15)?2%!0#0HC9&5F:6YE($)/3U-47U5424Q)5%E?0D%315]&
M4D]-7TU%34)%4E](4% -"@T*(VEN8VQU9&4@/&)O;W-T+W5T:6QI='E?9G=D
M+FAP<#X@("\O(')E<75I<F5D(&9O<B!P87)A;65T97(@9&5F875L=',-"B-I
M;F-L=61E(#QB;V]S="]P<F5P<F]C97-S;W(O87)I=&AM971I8R]I;F,N:'!P
M/@T*(VEN8VQU9&4@/&)O;W-T+W!R97!R;V-E<W-O<B]R97!E=&ET:6]N+V5N
M=6U?<&%R86US+FAP<#X-"B-I;F-L=61E(#QB;V]S="]P<F5P<F]C97-S;W(O
M<F5P971I=&EO;B]E;G5M7V)I;F%R>5]P87)A;7,N:'!P/@T*(VEN8VQU9&4@
M/&)O;W-T+W!R97!R;V-E<W-O<B]R97!E=&ET:6]N+W)E<&5A=%]F<F]M7W1O
M+FAP<#X-"@T*+R\@0V]N9FEG=7)A8FQE(&UA>&EM=6T_at_8V]N<W1R=6-T;W(@
M87)I='D-"B-I9FYD968_at_0D]/4U1?0D%315]&4D]-7TU%34)%4E]-05A?05))
M5%D-"B,@9&5F:6YE($)/3U-47T)!4T5?1E)/35]-14U"15)?34%87T%22519
M(#$P#0HC96YD:68-"@T*+R\-"B\O($UA8W)O(&YA;64Z($)/3U-47T-/3E-4
M4E5#5$]27T1%1BAZ+"!N+"!D871A*0T*+R\@1&5S8W)I<'1I;VXZ($5X<&%N
M9',@=&\-"B\O#0HO+R @("!T96UP;&%T93P@='EP96YA;64_at_5#$L("XN+BP@
M='EP96YA;64_at_5&X@/@T*+R\@(" @8F%S95]F<F]M7VUE;6)E<B@@5#$@>#$L
M("XN+BP_at_5&X@>&X@*0T*+R\@(" @(" @(#H@;65M8F5R*"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=65)1" ^#0IC;&%S<R!B87-E
M7V9R;VU?;65M8F5R#0I[#0IP<F]T96-T960Z#0H@(" @365M8F5R5'EP92 @
M;65M8F5R.PT*#0H@(" @8F%S95]F<F]M7VUE;6)E<B_at_I#0H@(" @(" @(#H@
M;65M8F5R*"D-"B @(" @(" @>WT-"@T*(" @($)/3U-47U!07U)%4$5!5%]&
M4D]-7U1/* T*(" @(" @(" Q+"!"3T]35%]04%])3D,H0D]/4U1?0D%315]&
M4D]-7TU%34)%4E]-05A?05))5%DI+ T*(" @(" @("!"3T]35%]#3TY35%)5
M0U1/4E]$148L(%\-"B @(" I#0H-"GT[(" O+R!B;V]S=#HZ8F%S95]F<F]M
M7VUE;6)E<@T*#0I](" O+R!N86UE<W!A8V4_at_8F]O<W0-"@T*(W5N9&5F($)/
M3U-47T-/3E-44E5#5$]27T1%1_at_T*#0HC96YD:68@("\O($)/3U-47U5424Q)
75%E?0D%315]&4D]-7TU%34)%4E](4% `
`
end
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk