Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-08-29 22:34:14


"Daryle Walker" <darylew_at_[hidden]> wrote in message
news:BD58038C.E8DE%darylew_at_hotmail.com...
> On 8/28/04 4:25 AM, "Pavel Vozenilek" <pavel_vozenilek_at_[hidden]> wrote:
>
> > "Jonathan Turkanis" wrote:
> [SNIP]
> >> 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.
>
> Do you have an example of this alternate technique? (Or at least what I
> should look up.)

Hi Daryle,

    I believe the attached file does what Pavel has in mind. Let someone else
check it, though, since I'm not preprocessor expert.

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+" R,# T($1A<GEL92!786QK97(N("!5<V4L
M(&UO9&EF:6-A=&EO;BP_at_86YD#0HO+R @9&ES=')I8G5T:6]N(&%R92!S=6)J
M96-T('1O('1H92!";V]S="!3;V9T=V%R92!,:6-E;G-E+"!697)S:6]N(#$N
M,"X@("A3964-"B\O("!A8V-O;7!A;GEI;F<@9FEL92!,24-%3E-%7S%?,"YT
M>'0@;W(@82!C;W!Y(&%T#0HO+R @/&AT=' Z+R]W=W<N8F]O<W0N;W)G+TQ)
M0T5.4T5?,5\P+G1X=#XN*0T*#0HO+R @4V5E(#QH='1P.B\O=W=W+F)O;W-T
M+F]R9R]L:6)S+W5T:6QI='DO/B!F;W(@=&AE(&QI8G)A<GDG<R!H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!A<'!L>2!T:&4@;W9E<G)I9&4L(&EF(&%N>2P@
M9F]R(&%L;"!S;W5R8V4-"B\O(&9I;&5S(&1U<FEN9R!P<F]J96-T(&-O;7!I
M;&EN9R!F;W(@8V]N<VES=&5N8WDN#0H-"B\O($-O;G1R:6)U=&5D(&)Y($IO
M;F%T:&%N(%1U<FMA;FES#0H-"B-I9FYD968_at_0D]/4U1?0D%315]&4D]-7TU%
M34)%4E]-05A?05))5%D-"B-D969I;F4_at_0D]/4U1?0D%315]&4D]-7TU%34)%
M4E]-05A?05))5%D@(#$P#0HC96YD:68-"@T*#0HO+R @06X@:71E<F%T:6]N
M(&]F(&$@8V]N<W1R=6-T;W(@=&5M<&QA=&4_at_9F]R(&)A<V5?9G)O;5]M96UB
M97(@("TM+2TM+2TM+2TM+2TO+PT*#0HO+R!!(&UA8W)O('1H870@<VAO=6QD
M(&5X<&%N9"!T;SH-"B\O(" @("!T96UP;&%T92 \('1Y<&5N86UE(%0Q+" N
M+BXL('1Y<&5N86UE(%1N(#X-"B\O(" @("!B87-E7V9R;VU?;65M8F5R*"!4
M,2!X,2P@+BXN+"!4;B!X;B I#0HO+R @(" @(" @(#H@;65M8F5R*"!X,2P@
M+BXN+"!X;B I#0HO+R @(" @(" @('M]#0HO+R!4:&ES(&UA8W)O('-H;W5L
M9"!O;FQY('!E<G-I<W0@=VET:&EN('1H:7,@9FEL92X-"@T*(V1E9FEN92!"
M3T]35%]04DE6051%7T-44E]$148H(&X@*2 @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @("!<#0H@(" @=&5M<&QA=&4@/"!"3T]35%]04%]%
M3E5-7U!!4D%-4RAN+"!T>7!E;F%M92!4*2 ^(" @(" @(" @(" @(" @(" @
M(%P-"@EE>'!L:6-I="!B87-E7V9R;VU?;65M8F5R*"!"3T]35%]04%]%3E5-
M7T))3D%265]005)!35,H;BP_at_5"P@>"D@*2 @7 T*"2 @(" Z(&UE;6)E<B@@
M0D]/4U1?4%!?14Y535]005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-15\Q(#QB;V]S="]U=&EL:71Y+V)A<V5?9G)O;5]M96UB97(N
M:'!P/@T*(R!D969I;F4_at_0D]/4U1?4%!?251%4D%424].7TQ)34E44R H,"P@
M0D]/4U1?0D%315]&4D]-7TU%34)%4E]-05A?05))5%DI#0HC(&EN8VQU9&4@
M0D]/4U1?4%!?251%4D%412_at_I#0HC96YD:68-"@T*?3L@+R\@8F]O<W0Z.F)A
M<V5?9G)O;5]M96UB97(-"@T*?2 @+R\@;F%M97-P86-E(&)O;W-T#0H-"B\O
M(%5N9&\@86YY('!R:79A=&4@;6%C<F]S#0HC=6YD968_at_0D]/4U1?4%))5D%4
M15]#5%)?1$5&#0H-"B-E;F1I9B @+R\@0D]/4U1?551)3$E465]"05-%7T92
M3TU?345-0D527TA04 T*#0HC:68_at_0D]/4U1?4%!?25-?251%4D%424Y'#0H@
M(" @0D]/4U1?4%))5D%415]#5%)?1$5&*$)/3U-47U!07TE.0RA"3T]35%]0
94%])5$52051)3TXH*2DI#0HC96YD:68-"@``
`
end


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk