|
Boost : |
From: Andy Little (andy_at_[hidden])
Date: 2004-06-25 15:01:59
"Rozental, Gennadiy" <gennadiy.rozental_at_[hidden]> wrote
> I could add proposed text, once somebody prepared it.
OK... update attached (modified from current release version).
Meanwhile I have done an example of the simplest possible concepts true and
false. I guess its half way between STATIC_ASSERT and assert(); and may be
useable in situations where STATIC_ASSERT or even assert() is currently
used. Whatever.. I like concepts :-) so I hope this helps to demystify them
a bit. Like many good things I guess you never notice youre using them until
it all goes wrong!
http://www.servocomm.freeserve.co.uk/Cpp/physical_quantity/concept_checking.cpp
BTW boost test has nice docs!
regards
Andy Little
begin 666 index.html
M/$A434P^#0H\2$5!1#X-"CQ4251,13Y4:&4_at_5&5S="!4;V]L<SPO5$E43$4^
M#0H\3$E.2R!R96P](G-T>6QE<VAE970B('1Y<&4](G1E>'0O8W-S(B!H<F5F
M/2(N+B\N+B]S='EL92]B=&PN8W-S(B!M961I83TB<V-R965N(CX-"CQ,24Y+
M(')E;#TB<W1Y;&5S:&5E="(@='EP93TB=&5X="]C<W,B(&AR968](BXN+RXN
M+W-T>6QE+V)T;"UP<FEN="YC<W,B(&UE9&EA/2)P<FEN="(^#0H\345402!H
M='1P+65Q=6EV/2)#;VYT96YT+4QA;F=U86=E(B!C;VYT96YT/2)E;BUU<R(^
M#0H\345402!H='1P+65Q=6EV/2)#;VYT96YT+51Y<&4B(&-O;G1E;G0](G1E
M>'0O:'1M;#L_at_8VAA<G-E=#UI<V\M.#@U.2TQ(CX-"CPO2$5!1#X-"CQ"3T19
M/@T*/$1)5B!C;&%S<STB:&5A9&5R(CX@/$$@:')E9CTB+BXO+BXO:6YD97_at_N
M:'1M;"(^0F]O<W0N5&5S=#PO03X@/B \02!H<F5F/2(N+B]I;F1E>"YH=&UL
M(CY#;VUP;VYE;G1S/"]!/B -"B @/B \4U!!3B!C;&%S<STB8W5R<F5N=%]A
M<G1I8VQE(CY4:&4_at_5&5S="!4;V]L<SPO4U!!3CX@/"]$258^#0H\1$E6(&-L
M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M:6YD96YT960B/D%M;VYG(&UA;GD@=&]O;',@:6X@<W5P<&QI960@
M=&]O;&)O>"P@=&AE<F4@:7,@=&AE($)/3U-47T-(14-+7T-,3U-%( T*(" @
M('1O;VP@=&AA="!P97)F;W)M(&9L;V%T:6YG('!O:6YT(&-O;7!A<FES;VX@
M;V8@=F%L=65S+B!3964@/$$@:')E9CTB9FQO871I;F=?<&]I;G1?8V]M<&%R
M:7-O;BYH=&UL(CYF;&]A=&EN9R -"B @("!P;VEN="!C;VUP87)I<V]N/"]!
M/B!P86=E(&9O<B!D971A:6QE9"!D97-C<FEP=&EO;B!O9B!U<V5D(&%L9V]R
M:71H;7,N/"]0/@T*(" \4"!C;&%S<STB9FER<W0M;&EN92UI;F1E;G1E9"(^
M26X_at_861D:71I;VX@=&\@=&]O;&)O>"P@=&AE(%1E<W0_at_5&]O;',@86QS;R!C
M;VYT86EN<R!S97!A<F%T92!O<W1R96%M7W1E<W1?<W1R96%M( T*(" @('1O
M;VPN(%1H:7,@:7,@8VQA<W,@9&5S:6=N960@=&\@<VEG;FEF:6-A;G1L>2!S
M:6UP;&EF>2!C;W)R96-T;F5S<R!T97-T:6YG(&]F('1H92!O<W1R96%M(&)A
M<V5D(&]U='!U=" -"B @("!P<F]C961U<F5S+B!&;W(@9&5T86EL960_at_9&5S
M8W)I<'1I;VX@;V8@:70G<R!I;G1E<F9A8V4_at_86YD('5S86=E('-E92!T:&4@
M/$$@:')E9CTB;W5T<'5T7W1E<W1?<W1R96%M+FAT;6PB/F]S=')E86U?=&5S
M=%]S=')E86T\+T$^( T*(" @('!A9V4N/"]0/@T*(" \4"!C;&%S<STB9FER
M<W0M;&EN92UI;F1E;G1E9"(^36]S="!O9B!T97-T('1O;VQS(&1I<F5C="!V
M86QU97,@;V8@:70G<R!A<F=U;65N=',@=&\@=&AE(&]U='!U="!S=')E86T@
M:6X@<V]M92!F;W)M(&]F(&QO9R!S=&%T96UE;G0N($EF(&%R9W5M96YT<R!T
M>7!E(&1O97,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/$)2/@T*(" @(#Q!(&AR968](BXN
M+RXN+W1E<W1S+W1E<W1?9G!?8V]M<&%R:7-O;G,N:'1M;"(^=&5S=%]F<%]C
M;VUP87)I<V]N<SPO03X@/"]0/@T*/"]$258^#0H\1$E6(&-L87-S/2)F;V]T
M97(B/B -"B @/$1)5B!C;&%S<STB9F]O=&5R+6)O9'DB/B -"B @(" \4#X@
M)F-O<'D@/$$@;F%M93TB0V]P>7)I9VAT(CY#;W!Y<FEG:'0\+T$^(#Q!(&AR
M968])VUA:6QT;SIR;V=E969F0&9U<V5M86EL+F-O;2<^1V5N;F%D:7D_at_4F]Z
M96YT86P\+T$^(#(P,#$M,C P-"X@/$)2/@T*(" @(" @57-E+"!M;V1I9FEC
M871I;VXL(&%N9"!D:7-T<FEB=71I;VX_at_87)E('-U8FIE8W0@=&\@=&AE($)O
M;W-T(%-O9G1W87)E($QI8V5N<V4L(%9E<G-I;VX@,2XP+B -"B @(" @("A3
M964_at_86-C;VUP86YY:6YG(&9I;&4@/$$@:')E9CTB+BXO+BXO+BXO+BXO+BXO
M3$E#14Y315\Q7S N='AT(CY,24-%3E-%7S%?,"YT>'0\+T$^(&]R(&-O<'D@
M870@#0H@(" @(" \02!H<F5F/2)H='1P.B\O=W=W+F)O;W-T+F]R9R],24-%
M3E-%7S%?,"YT>'0B/G=W=RYB;V]S="YO<F<O3$E#14Y315\Q7S N='AT/"]!
M/BD\+U ^#0H@(" @(" @(#Q0/E)E=FES960Z(" @(" @(" \(2TM("-"96=I
M;D1A=&4_at_9F]R;6%T.E-W,2 M+3XQ."!*86YU87)Y+" R,# T/"$M+2 C16YD
M1&%T92 M+3X@(" @(#PO4#X-"B @/"]$258^#0H\+T1)5CX-"CPO0D]$63X-
*"CPO2%1-3#X-"@``
`
end
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk