|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2004-02-09 05:46:13
"David Abrahams" <dave_at_[hidden]> wrote in message
news:ud68thd7w.fsf_at_boost-consulting.com...
> "Andy Little" <andy_at_[hidden]> writes:
>
> > To me that reads Dont Use Leading Underscores. Period.
> >
> > Perhaps you need to lobby to have the wording changed to:
> >
> > "Each name that begins with an underscore is reserved to the
implementation
> > in the global namespace".
>
> Don't make work for the rest of us.
hmm... just pointing out the rules, which, if not followed, cause a large
volume of macros and workarounds,obscure bugs and hence a lot of tedious and
unnecessary work for somebody, but which, if followed, save that work for
everybody.
Rule actually reads:
"Each name that begins with an underscore is reserved to the implementation
for use as a name in the global namespace".
> If you care about the issue,
> perhaps you need to lobby.
Rule is fine as it stands AFAICS. Whatever ...
There is a rational header in boost/mpl/math/rational_c.hpp. but has no
functionality. Enclosed is an implementation with some functionality.
regards
Andy Little
begin 666 rational_c.txt
M#0HC:69N9&5F($)/3U-47TU03%]2051)3TY!3%]#7TA04%])3D-,541%1 T*
M(V1E9FEN92!"3T]35%]-4$Q?4D%424].04Q?0U](4%!?24Y#3%5$140-"@T*
M+R\M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0T*+R\@8F]O<W0O
M;7!L+W)A=&EO;F%L7V,N:'!P(&AE861E<B!F:6QE#0HO+R!3964@:'1T<#HO
M+W=W=RYB;V]S="YO<F<@9F]R('5P9&%T97,L(&1O8W5M96YT871I;VXL(&%N
M9"!R979I<VEO;B!H:7-T;W)Y+@T*+R\M+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+0T*+R\-"B\O($-O<'ER:6=H=" H8RD@,C P,"TP,@T*+R\@
M06QE:W-E>2!'=7)T;W9O>0T*+R\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6YC;'5D92 B8F]O<W0O
M;7!L+V1I=FED97,N:'!P(@T*(VEN8VQU9&4@(F)O;W-T+VUP;"]N96=A=&4N
M:'!P(@T*+R\@861D(" @(&]R+"!A;F0_at_971C#0H-"B\O(&-O;7!I;&4@=&EM
M92!R871I;VYA;"!N=6UB97(-"B\O('5S:6YG(&UP;"!O<&5R871O<G,-"@T*
M;F%M97-P86-E(&)O;W-T>VYA;65S<&%C92!M<&Q[#0H-"B @("!T96UP;&%T
M93P-"B @(" @(" @='EP96YA;64_at_26YT96=E<E1Y<&4L#0H@(" @(" @($EN
M=&5G97)4>7!E($XL#0H@(" @(" @($EN=&5G97)4>7!E($0-"B @(" ^#0H@
M(" @<W1R=6-T(')A=&EO;F%L7V,@.PT*?7TO+V)O;W-T.CIM<&P-"@T*;F%M
M97-P86-E(&)O;W-T>VYA;65S<&%C92!M<&Q[#0H-"B @("!T96UP;&%T93P-
M"B @(" @(" @='EP96YA;64_at_26YT96=E<E1Y<&4L#0H@(" @(" @($EN=&5G
M97)4>7!E($XL#0H@(" @(" @($EN=&5G97)4>7!E($0@/2 Q#0H@(" @/@T*
M(" @('-T<G5C="!R871I;VYA;%]C('L-"B @("!P<FEV871E._at_T*(" @(" @
M(" -"B @(" @(" @<W1A=&EC(&-O;G-T($EN=&5G97)4>7!E('!O<U]N=6UE
M7VEN( T*(" @(" @(" ]($X@/CT@," _($X_at_.B M3CL-"B @(" @(" @<W1A
M=&EC(&-O;G-T($EN=&5G97)4>7!E('!O<U]D96YO;5]I;B -"B @(" @(" @
M/2!$(#X](# @/R!$(#H@+40[#0H-"B @(" @(" @+R\@<W1A=&EC7V=C9"!R
M971U<FYS('5N<VEG;F5D(&QO;F<-"B @(" @(" @<W1A=&EC(&-O;G-T($EN
M=&5G97)4>7!E(&=C9" ]('-T871I8U]C87-T/$EN=&5G97)4>7!E/B -"B @
M(" @(" @*&)O;W-T.CIM871H.CIS=&%T:6-?9V-D/ T*(" @(" @(" @(" @
M<W1A=&EC7V-A<W0\=6YS:6=N960@;&]N9SXH<&]S7VYU;65?:6XI+ T*(" @
M(" @(" @(" @<W1A=&EC7V-A<W0\=6YS:6=N960@;&]N9SXH<&]S7V1E;F]M
M7VEN*0T*(" @(" @(" ^.CIV86QU92D[#0H-"B @(" @(" @<W1A=&EC(&-O
M;G-T($EN=&5G97)4>7!E(&YU;65?:6X@#0H@(" @(" @(#T@*"!.("H_at_1" ^
M/2 P*0T*(" @(" @(" _('!O<U]N=6UE7VEN( T*(" @(" @(" Z("UP;W-?
M;G5M95]I;CL@#0H@(" @<'5B;&EC._at_T*(" @(" @("!S=&%T:6,@8V]N<W0@
M26YT96=E<E1Y<&4@;G5M97)A=&]R(#T@;G5M95]I;B]G8V0[#0H@(" @(" @
M('-T871I8R!C;VYS="!);G1E9V5R5'EP92!D96YO;6EN871O<B ]('!O<U]D
M96YO;5]I;B]G8V0[#0H@(" @<')I=F%T93H-"B @(" @(" @='EP961E9B!R
M871I;VYA;%]C(#P-"B @(" @(" @(" @($EN=&5G97)4>7!E+ T*(" @(" @
M(" @(" @;G5M97)A=&]R+ T*(" @(" @(" @(" @9&5N;VUI;F%T;W(-"B @
M(" @(" @/B!M87EB95]T>7!E.PT*(" @('!U8FQI8SH@#0H@(" @(" @("\O
M<')E=F5N="!D:78@, T*(" @(" @("!T>7!E9&5F('1Y<&5N86UE(&EF7V,\
M#0H@(" @(" @(" @("!S=&%T:6-?8V%S=#QB;V]L/BAD96YO;6EN871O<BDL
M#0H@(" @(" @(" @("!M87EB95]T>7!E+ T*(" @(" @(" @(" @=F]I9%\-
M"B @(" @(" @/CHZ='EP92!T>7!E.PT*#0H@(" @(" @("\O*BHJ*BHJ*BHJ
M*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ#0H@(" @(" @("\O($AI+"!Y;W4_at_9V5T
M(&AE<F4@#0H@(" @(" @("\O(&EF(&1E;F]M:6YA=&]R(&ES('IE<F\@:64@
M,2\P#0H@(" @(" @($)/3U-47U-4051)0U]!4U-%4E0H9&5N;VUI;F%T;W(I
M.PT*(" @(" @(" O+RHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BHJ*BH-
M"B @("!].PT*(" @#0H@(" @=&5M<&QA=&4\#0H@(" @(" @('1Y<&5N86UE
M($EN=&5G97)4>7!E+ T*(" @(" @("!);G1E9V5R5'EP92!.+ T*(" @(" @
M("!);G1E9V5R5'EP92!$#0H@(" @/B -"B @("!S=')U8W0@;F5G871E/" -
M"B @(" @(" @<F%T:6]N86Q?8SP-"B @(" @(" @(" @($EN=&5G97)4>7!E
M+ T*(" @(" @(" @(" @3BP-"B @(" @(" @(" @($0-"B @(" @(" @/B -
M"B @(" ^>R -"B @(" @(" @='EP961E9B!T>7!E;F%M92!R871I;VYA;%]C
M/$EN=&5G97)4>7!E+"U.+$0^.CIT>7!E('1Y<&4[( T*(" @('T[#0H-"B @
M("!T96UP;&%T93P-"B @(" @(" @='EP96YA;64_at_26YT96=E<E1Y<&4L#0H@
M(" @(" O+R @='EP96YA;64_at_26YT96=E<E1Y<&4R+ T*(" @(" @("!);G1E
M9V5R5'EP92!.,2P-"B @(" @(" @26YT96=E<E1Y<&4_at_1#$L#0H@(" @(" @
M($EN=&5G97)4>7!E($XR+ T*(" @(" @("!);G1E9V5R5'EP92!$,@T*(" @
M(#X@#0H@(" @<W1R=6-T('!L=7,\( T*(" @(" @(')A=&EO;F%L7V,\26YT
M96=E<E1Y<&4L3C$L1#$^+ T*(" @(" @(')A=&EO;F%L7V,\26YT96=E<E1Y
M<&4L3C(L1#(^( T*(" @(#Y[( T*(" @(" @("!T>7!E9&5F('1Y<&5N86UE
M(')A=&EO;F%L7V,\#0H@(" @(" @(" @("!);G1E9V5R5'EP92P-"B @(" @
M(" @(" @($XQ("H_at_1#(@*R!.,B J($0Q+ T*(" @(" @(" @(" @1#$@*B!$
M,@T*(" @(" @(" ^.CIT>7!E('1Y<&4[( T*(" @('T[#0H@(" @#0H@(" @
M=&5M<&QA=&4\#0H@(" @(" @('1Y<&5N86UE($EN=&5G97)4>7!E+ T*(" @
M(" @("!);G1E9V5R5'EP92!.,2P-"B @(" @(" @26YT96=E<E1Y<&4_at_1#$L
M#0H@(" @(" @($EN=&5G97)4>7!E($XR+ T*(" @(" @("!);G1E9V5R5'EP
M92!$,@T*(" @(#X@#0H@(" @<W1R=6-T(&UI;G5S/ T*(" @(" @("!R871I
M;VYA;%]C/$EN=&5G97)4>7!E+$XQ+$0Q/BP-"B @(" @(" @<F%T:6]N86Q?
M8SQ);G1E9V5R5'EP92Q.,BQ$,CX@#0H@(" @/GL@#0H@(" @(" @('1Y<&5D
M968@='EP96YA;64@<F%T:6]N86Q?8SP-"B @(" @(" @(" @($EN=&5G97)4
M>7!E+ T*(" @(" @(" @(" @3C$@*B!$,B M($XR("H_at_1#$L#0H@(" @(" @
M(" @("!$,2 J($0R#0H@(" @(" @(#XZ.G1Y<&4@='EP93L@#0H@(" @?3L-
M"@T*(" @('1E;7!L871E/ T*(" @(" @("!T>7!E;F%M92!);G1E9V5R5'EP
M92P-"B @(" @(" @26YT96=E<E1Y<&4_at_3C$L#0H@(" @(" @($EN=&5G97)4
M>7!E($0Q+ T*(" @(" @("!);G1E9V5R5'EP92!.,BP-"B @(" @(" @26YT
M96=E<E1Y<&4_at_1#(-"B @(" ^( T*(" @('-T<G5C="!M=6QT:7!L:65S/ T*
M(" @(" @("!R871I;VYA;%]C/$EN=&5G97)4>7!E+$XQ+$0Q/BP-"B @(" @
M(" @<F%T:6]N86Q?8SQ);G1E9V5R5'EP92Q.,BQ$,CX@#0H@(" @/GL@#0H@
M(" @(" @('1Y<&5D968@='EP96YA;64@<F%T:6]N86Q?8SP-"B @(" @(" @
M(" @($EN=&5G97)4>7!E+ T*(" @(" @(" @(" @3C$J3C(L#0H@(" @(" @
M(" @("!$,2I$,@T*(" @(" @(" ^.CIT>7!E('1Y<&4[( T*(" @('T[#0H-
M"B @("!T96UP;&%T93P-"B @(" @(" @='EP96YA;64_at_26YT96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@;F5G7V$@/2 B
M(#P\(')A=%]N96=?83HZ;G5M97)A=&]R(#P\)R\G#0H@(" @/#P@<F%T7VYE
M9U]A.CID96YO;6EN871O<B \/"=<;B<[#0H-"B-I9B P#0H@(" @+R\@8VAE
M8VL_at_9&EV(# -"B @(" @='EP961E9B!R871I;VYA;%]C/&EN="PT+# ^(')A
M=%]B860[#0H@(" @('-T9#HZ8V]U=" \/"!R871?8F%D.CID96YO;6EN871O
;<B \/"=<;B<[#0HC96YD:68@(" -"GT-"@T*
`
end
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk