Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2006-07-13 06:03:41


On Sat, 17 Jun 2006 07:06:38 -0400, David Abrahams
<dave_at_[hidden]> wrote:

>Gennaro Prota <gennaro_prota_at_[hidden]> writes:
>
>> On Thu, 15 Jun 2006 13:19:36 -0400, David Abrahams
>> <dave_at_[hidden]> wrote:
>>
>>> BOOST_WORKAROUND(CXX_MSVC, <=, 7,1,0)
>>> BOOST_WORKAROUND(CXX_MSVC, tested_at, 7,1,0)
>>>
>>>is an implementable syntax.
>>
>> I'd have three questions, but maybe it's quicker to ask directly: "can
>> you post the implementation you are thinking to?"
>
>Sorry, what I was thinking of won't work because you can't paste
>anything onto "<=".

Yeah, that was one of the issues I was wondering about; you could have
been thinking of a technique which didn't involve token pasting :)
Anyway, one could of course use identifiers instead of <= and other
operators. Attached is an implementation which maps "<" to "below",
">" to "above", etc. Two of the possible invocation forms would be:

  BOOST_WORKAROUND(CXX_MSVC, last_tested, (8, 0, 0))
  BOOST_WORKAROUND(CXX_MSVC, up_to, (9, 0, 0))

Note that "CXX_MSVC" is used, though the macro actually defined is
"BOOST_CXX_MSVC" and that the version numbers are grouped into a tuple
(though this isn't necessary for the machinery to work). There's still
the comma before the tuple, as I didn't want to carry the house of
cards too far.

A further easy step would be to enable a generic placeholder, say 'x',
for minor and patch numbers, so that something like

  BOOST_WORKAROUND(CXX_CW, last_tested, (9, x, x)) // CodeW. 9.x

would be valid.

The big problem about all this is, as you know, that BOOST_PP_IS_UNARY
isn't guaranteed to work everywhere, which is why Paul didn't make it
part of the pp-lib interface. It *should* work on this scenario but
I'm not sure.

--
[ Gennaro Prota, C++ developer for hire ]
[    resume:  available on request      ]
begin 644 Source1.cpp
M+R\C9&5F:6YE($)/3U-47T1%5$5#5%]/551$051%1%]73U)+05)/54Y$4PT*
M#0HC:6YC;'5D92`B8F]O<W0O<')E<')O8V5S<V]R+V-O;G1R;VPO:6EF+FAP
M<"(-"B-I;F-L=61E(")B;V]S="]P<F5P<F]C97-S;W(O='5P;&4O96%T+FAP
M<"(-"B-I;F-L=61E(")B;V]S="]P<F5P<F]C97-S;W(O;&]G:6-A;"]C;VUP
M;"YH<'`B#0H-"B-I;F-L=61E(")B;V]S="]P<F5P<F]C97-S;W(O9&5T86EL
M+VES7W5N87)Y+FAP<"(@+R\@3D(A(2$-"@T*#0HO+R`M+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2T-"@T*(V1E9FEN92!"3T]35%])4U],05-47U1%4U1%1"AE*2`@("`@("`@
M("`@("`@("`@("`@("`@("!<#0H@("`@0D]/4U1?4%!?24E&*"`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(%P-"B`@("`@("`@0D]/
M4U1?4%!?25-?54Y!4EDH($)/3U-47U9%4E-)3TY?(",C(&4@*"A^*2D@*2`@
M7`T*("`@("`@+"!"3T]35%])4U],05-47U1%4U1%1%])("`@("`@("`@("`@
M("`@("`@("`@("`@("!<#0H@("`@("`L(#`@0D]/4U1?4%!?5%503$5?14%4
M*#$I("`@("`@("`@("`@("`@("`@("`@("`@(%P-"B`@("`I*&4I("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@+RHJ+PT*
M#0HC9&5F:6YE($)/3U-47TE37TQ!4U1?5$535$5$7TDH92D@("`@("`@7`T*
M("`@($)/3U-47U!07T-/35!,*"!"3T]35%]04%])4U]53D%262@@(%P-"B`@
M("`@("`@0D]/4U1?5D524TE/3E\@(R,@92@@("`@("`@("`@("!<#0H@("`@
M("`@("`@("!"3T]35%]615)324].7VQA<W1?=&5S=&5D("`@7`T*("`@("`@
M("`I*"A^*2D@("`@("`@("`@("`@("`@("`@("`@("`@(%P-"B`@("`I("D@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`O*BHO#0H-"B-D969I;F4@
M0D]/4U1?5D524TE/3E]L87-T7W1E<W1E9"AX*2!X#0H-"@T*+R\@+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM#0H-"B-D969I;F4_at_0D]/4U1?5D524TE/3E].54U"15(H;6%J
M;W(L(&UI;F]R+"!P871C:"D_at_7`T*("`@("@@*&UA:F]R*2HQ,#`J,3`P,#`P
M=2`K("AM:6YO<BD@*B`Q,#`P,#!U("L@*'!A=&-H*2`I("\J*B\-"@T*+R\@
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM#0H-"B-D969I;F4_at_0D]/4U1?5T]22T%23U5.1"AS
M>6UB;VPL('1E<W0L('9T=7!L92D@(%P-"B`@("`H("`@*"A"3T]35%\C(W-Y
M;6)O;"D@(3T@,"D@)B8@("`@("`@("`@("`@(%P-"B`@("`@("`@0D]/4U1?
M5T]22T%23U5.1%])35!,*$)/3U-47R,C<WEM8F]L("`@(%P-"B`@("`@("`@
M+"!T97-T("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(%P-"B`@
M("`@("`@+"!"3T]35%]615)324].7TY534)%4B!V='5P;&4I("`@("`@("`@
M(%P-"B`@("`I("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("\J*B\-"@T*#0HC9&5F:6YE($)/3U-47U=/4DM!4D]53D1?24U03"AS
M>6UB;VPL('1E<W0L('9E<BD@("`@("`@("`@7`T*("`@("@@("`@0D]/4U1?
M4%!?24E&*"`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(%P-
M"B`@("`@("`@("`@($)/3U-47TE37TQ!4U1?5$535$5$*'1E<W0I("`@("`@
M("`@("`@("`@("`@("!<#0H@("`@("`@("`@("`L($)/3U-47U=/4DM!4D]5
M3D1?3$%35"AS>6UB;VPL('9E<BD@("`@("`@("`@7`T*("`@("`@("`@("`@
M+"!"3T]35%]73U)+05)/54Y$7TY/4DU!3"AS>6UB;VPL('1E<W0L('9E<BD@
M(%P-"B`@("`@("`@("D@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("!<#0H@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@7`T*("`@("D@("`@
M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("\J*B\-"@T*(VEF9&5F($)/3U-47T1%5$5#5%]/551$051%1%]73U)+05)/
M54Y$4PT*(V1E9FEN92!"3T]35%]73U)+05)/54Y$7TQ!4U0H<WEM8F]L+"!V
M97(I(%P-"B`@("`H("@H=F5R*2\H=F5R*2D@+R`H("AS>6UB;VPI(#X@*'9E
M<BD@/R`P(#H@,2`I("D-"B-E;'-E#0HC9&5F:6YE($)/3U-47U=/4DM!4D]5
M3D1?3$%35"AS>6UB;VPL('9E<BD@*"AV97(I+RAV97(I*0T*(V5N9&EF#0H-
M"B-D969I;F4_at_0D]/4U1?5T]22T%23U5.1%].3U)-04PH<WEM8F]L+"!T97-T
M+"!V97(I(%P-"B`@("`H("AS>6UB;VPI($)/3U-47U9%4E-)3TY?(R-T97-T
M("AV97(I("D-"@T*+R\@+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM#0HO+R!3>6YT87@@97AA
M;7!L97,Z#0HO+PT*+R\@0D]/4U1?5T]22T%23U5.1"A#6%A?35-60RP@=7!?
M=&\L("@Q+"`R+"`S*2D-"B\O($)/3U-47U=/4DM!4D]53D0H0UA87TU35D,L
M('1E<W1E9%]A="P@*#$L(#(L(#,I*0T*+R\-"B\O($ET('=O=6QD(&)E('!O
M<W-I8FQE('1O(&5N86)L92!T:&4@<'`M=&]K96X@?'A\(&%S('!L86-E:&]L
M9&5R#0HO+R!F;W(@;6EN;W(@86YD('!A=&-H(&YU;6)E<G,-"B\O#0HO+R!"
M3T]35%]73U)+05)/54Y$*$-86%]-4U9#+"!B96QO=R`H."P@,"P@>"DI#0HO
M+PT*(V1E9FEN92!"3T]35%]615)324].7V)E;&]W("`@("`@("`@/`T*(V1E
M9FEN92!"3T]35%]615)324].7W5P7W1O("`@("`@("`@/#T-"B-D969I;F4@
M0D]/4U1?5D524TE/3E]A8F]V92`@("`@("`@(#X-"B-D969I;F4_at_0D]/4U1?
M5D524TE/3E]O;G=A<F0@("`@("`@(#X-"B-D969I;F4_at_0D]/4U1?5D524TE/
M3E]O=&AE<E]T:&5N("`@("$]#0HC9&5F:6YE($)/3U-47U9%4E-)3TY?97%U
M86P@("`@("`@("`]/0T*#0H-"@T*#0HC9&5F:6YE($)/3U-47T-86%]-4U9#
M($)/3U-47U9%4E-)3TY?3E5-0D52*#@L(#`L(#`I#0H-"B-D969I;F4_at_0UA8
M7TU35D,@)3TD*24])2$])2DF*"`O+R!C86XG="!I;G1E<F9E<F4@/"TM#0H-
M"FEN="!M86EN*"D-"GL-"B`@("!"3T]35%]73U)+05)/54Y$*$-86%]-4U9#
M+"!L87-T7W1E<W1E9"P@*#@L(#`L(#`I*3L-"B`@("!"3T]35%]73U)+05)/
E54Y$*$-86%]-4U9#+"!U<%]T;RP@*#DL(#`L(#`I*3L-"GT-"E]7
`
end

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