Boost logo

Boost Users :

From: Andy Little (andy_at_[hidden])
Date: 2006-02-27 06:54:08


"Andy Little" wrote

> The expectation ( based on OP's light reading of examples I guess ) is this
>
> assert( boost::is_same <
> mpl::transform<
> vector_c<int,1,2,3> ,vector_c<int,1,1,1> ,some_plus_func
> > ::type ,
> vector_c<int,2,3,4>
> >::value == true);
>
> Personally I think ( even ) that is with (some mods) a realistic expectation.

FWIW Enclosed is a small sample which seems to work ok in VC7.1 and gcc4.01,
bearing in mind its based on expectations not status quo
Formatting of output works best in vc7.1 BTW.

IOW Its not impossible to make it work. Might be useful as a relatively simple
demo anyway. Could also be used to explain the reasons for rejecting this
approach too of course ;-)

regards
Andy Little

begin 666 test.cpp
M+RH-"B @('-T86YD86QO;F4@=F5C=&]R7V,@861D('5S:6YG('1R86YS9F]R
M;5]C#0H@("!T97-T960_at_5D,W+C$@9V-C(#0N,#$-"BHO#0H-"FYA;65S<&%C
M92!M>7L-"@T*(" @("\O<W1A;F1A;&]N92!V96-T;W)?8PT*(" @('1E;7!L
M871E(#QT>7!E;F%M92!4+"!4($XQ+"!4($XR+"!4($XS/@T*(" @('-T<G5C
M="!V96-T;W)?8WL-"B @(" @(" @<W1A=&EC(&-O;G-T(%0@;C$@/2!.,3L-
M"B @(" @(" @<W1A=&EC(&-O;G-T(%0@;C(@/2!.,CL-"B @(" @(" @<W1A
M=&EC(&-O;G-T(%0@;C,@/2!.,SL-"B @(" @(" @='EP961E9B!4('9A;'5E
M7W1Y<&4[#0H@(" @?3L-"@T*(" @("\O('1R86YS9F]R;2!A;&=O<FET:&T-
M"B @("!T96UP;&%T92 \='EP96YA;64_at_4S$@+"!T>7!E;F%M92!3,B L('1Y
M<&5N86UE($9U;F-T:6]N/@T*(" @('-T<G5C="!T<F%N<V9O<FU?8SL-"@T*
M(" @("\O<W!E8VEA;&ES92!T<F%N<V9O<FT_at_9F]R('9E8W1O<E]C('-I9VYA
M='5R97,-"B @(" O+W=O<FMS(&]N;'D_at_9F]R(&EN=',@:&5R90T*(" @('1E
M;7!L871E(#P-"B @(" @(" @='EP96YA;64_at_5"P-"B @(" @(" @=&5M<&QA
M=&4@/'1Y<&5N86UE+"!4($YX+"!4($YY("P_at_5"!.>B ^(&-L87-S(%-E<75E
M;F-E+ T*(" @(" @("!4($XQ3"Q4($XR3"Q4($XS3"P-"B @(" @(" @5"!.
M,5(L5"!.,E(L5"!.,U(L#0H@(" @(" @('1E;7!L871E(#QI;G0L(&EN=#X@
M8VQA<W,@1G5N8RP-"B @(" @(" @:6YT($9&,2P@:6YT($9&,@T*(" @(#X-
M"B @("!S=')U8W0@=')A;G-F;W)M7V,\#0H@(" @(" @(%-E<75E;F-E/%0L
M3C%,+$XR3"Q.,TP^+ T*(" @(" @("!397%U96YC93Q4+$XQ4BQ.,E(L3C-2
M/BP-"B @(" @(" @1G5N8SQ&1C$L1D8R/B -"B @(" ^>PT*(" @(" @("!T
M>7!E9&5F("!397%U96YC93P-"B @(" @(" @(" @(%0L#0H@(" @(" @(" @
M(" H1G5N8SQ.,4PL3C%2/CHZ=F%L=64I+ T*(" @(" @(" @(" @*$9U;F,\
M3C),+$XR4CXZ.G9A;'5E*2P-"B @(" @(" @(" @("A&=6YC/$XS3"Q.,U(^
M.CIV86QU92D@#0H@(" @(" @(#X@='EP93L-"B @("!].PT*#0H@(" @=&5M
M<&QA=&4@/&EN="!,+"!I;G0_at_4CX-"B @("!S=')U8W0@<&QU<U]C>PT*(" @
M(" @("!S=&%T:6,@:6YT(&-O;G-T('9A;'5E(#T_at_3" K(%([#0H@(" @?3L-
M"@T*?2\O;7D-"@T*(VEN8VQU9&4@/&EO<W1R96%M/@T*#0II;G0@;6%I;B_at_I
M#0I[#0H@(" @='EP961E9B!M>3HZ=F5C=&]R7V,\:6YT+#$L,BPS/B!V,3L-
M"B @("!T>7!E9&5F(&UY.CIV96-T;W)?8SQI;G0L,2PQ+#$^('8R.PT*(" @
M('1Y<&5D968@;7DZ.G1R86YS9F]R;5]C/ T*(" @(" @("!V,2QV,BP@#0H@
M(" @(" @(&UY.CIP;'5S7V,\,"PP/B -"B @(" ^.CIT>7!E(')E<W5L=#L-
M"@T*(" @('-T9#HZ8V]U=" \/"!T>7!E:60H=C$I+FYA;64H*2 \/" G7&XG
M( T*(" @(#P\("(@*R B(#P\('1Y<&5I9"AV,BDN;F%M92_at_I(" \/" G7&XG
M#0H@(" @/#P@(B ]("(@/#P@('1Y<&5I9"AR97-U;'0I+FYA;64H*2 \/"=<
.;B<[#0H@(" @#0I]#0H`
`
end


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net