Boost logo

Boost :

From: Philippe A. Bouchard (philippeb_at_[hidden])
Date: 2002-07-24 08:59:55


I made some modifications to squad_ptr<> that enables assignments to derived
pointers.

"David B. Held" <dheld_at_[hidden]> wrote in message
news:ahkg6i$27q$1_at_main.gmane.org...
> "Philippe A. Bouchard" <philippeb_at_[hidden]> wrote in message
> news:ahk9m0$dsr$1_at_main.gmane.org...

[...]

> thousands of items. However, my typical listview record is maybe
> 80-120 bytes long. I'm quite sure I wouldn't notice the loss of another 4
> bytes to a count pointer. However, one wonders why one would use a

Ok then... What about a multithreaded application that manages thousands of
transactions with a duration dependent on different opinions from different
places?

[...]

Inconsistancy I've noticed: the whole point of policy-based design is
*choice*... but my preferences towards speed / memory gains with operator
new (size_t, void *) in a flexible way are shoved away.

Philippe A. Bouchard

begin 666 squad_ptr.h
M+RH*(" @5&AI<R!F:6QE(&ES('!A<G0@;V8@=&AE($9$22!L:6)R87)I97,*
M(" @0V]P>7)I9VAT("AC*2 R,# R(%!H:6QI<'!E($$N($)O=6-H87)D(#QP
M:&EL:7!P94!F;W)N=7_at_N8V]M/@H*(" @5&AI<R!L:6)R87)Y(&ES(&9R964@
M<V]F='=A<F4[('EO=2!C86X@<F5D:7-T<FEB=71E(&ET(&%N9"]O<@H@("!M
M;V1I9GD@:70@=6YD97(@=&AE('1E<FUS(&]F('1H92!'3E4_at_3&EB<F%R>2!'
M96YE<F%L(%!U8FQI8PH@("!,:6-E;G-E('9E<G-I;VX@,B!A<R!P=6)L:7-H
M960_at_8GD@=&AE($9R964_at_4V]F='=A<F4_at_1F]U;F1A=&EO;BX*"B @(%1H:7,@
M;&EB<F%R>2!I<R!D:7-T<FEB=71E9"!I;B!T:&4@:&]P92!T:&%T(&ET('=I
M;&P_at_8F4@=7-E9G5L+ H@("!B=70_at_5TE42$]55"!!3ED_at_5T%24D%.5%D[('=I
M=&AO=70_at_979E;B!T:&4@:6UP;&EE9"!W87)R86YT>2!O9_at_H@("!-15)#2$%.
M5$%"24Q)5%D@;W(@1DE43D534R!&3U(@02!005)424-53$%2(%!54E!/4T4N
M("!3964@=&AE($=.50H@("!,:6)R87)Y($=E;F5R86P_at_4'5B;&EC($QI8V5N
M<V4_at_9F]R(&UO<F4_at_9&5T86EL<RX*"B @(%EO=2!S:&]U;&0@:&%V92!R96-E
M:79E9"!A(&-O<'D@;V8@=&AE($=.52!,:6)R87)Y($=E;F5R86P_at_4'5B;&EC
M($QI8V5N<V4*(" @86QO;F<@=VET:"!T:&ES(&QI8G)A<GD[('-E92!T:&4@
M9FEL92!#3U!924Y'+DQ)0BX@($EF(&YO="P@=W)I=&4@=&\*(" @=&AE($9R
M964_at_4V]F='=A<F4_at_1F]U;F1A=&EO;BP_at_26YC+BP_at_-3D@5&5M<&QE(%!L86-E
M("T_at_4W5I=&4@,S,P+ H@("!";W-T;VXL($U!(# R,3$Q+3$S,#<L(%5302X*
M*B\*"@HC:69N9&5F(%-154%$7U!44E]("B-D969I;F4_at_4U%5041?4%127T@*
M"@HC:6YC;'5D92 B<')E8G5I;&0N:"(*"@IN86UE<W!A8V4_at_9F1I"GL*"@IT
M96UP;&%T92 \='EP96YA;64_at_7U0^"@ES=')U8W0@<W%U861?<'1R.PH*"B\J
M*@H)3V)J96-T('!O:6YT960@=&\@8GD@<W%U861?<'1R/#XN"@H)2&%S('1O
M(&)E(&EN<W1A;F-I871E9"!U<VEN9R!U;F-O;6UO;B!E>'!R97-S:6]N<RX@
M4V5E(&)E;&]W+@HJ+PH*=&5M<&QA=&4@/'1Y<&5N86UE(%]4/@H)<W1R=6-T
M('-Q=6%D7W1A<F=E= H)>PH)"71Y<&5D968_at_7U0@=F%L=65?='EP93L*"@D)
M9G)I96YD('9O:60@*B!S<75A9#Q?5#XH*3L*"@D)9G)I96YD(&-L87-S('-Q
M=6%D7W!T<CQ?5#X["@H*"0ES<75A9%]T87)G970H*2 Z(&U?8V]U;G1E<B_at_Q
M*0H)"7L*"0E]"@H)"7-T871I8R!V;VED("H@;W!E<F%T;W(@;F5W("A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BD*"0D)>PH)"0D)*RL@
M;5]P='(M/FU?8V]U;G1E<CL*"0D)?0H)"0ER971U<FX@;5]P='(["@D)?0H*
M"0EV;VED(')E<V5T*&5L96UE;G1?='EP92 J(&%?<" ](# I"@D)>PH)"0EI
M9B H;5]P='(@)B8@(2 M+2!M7W!T<BT^;5]C;W5N=&5R*0H)"0E["@D)"0ED
M96QE=&4@;5]P='(["@D)"7T*"0D);5]P='(@/2!A7W ["@D)?0H*"@EP<FEV
M871E._at_H)"65L96UE;G1?='EP92 J(&U?<'1R.PH)?3L*"@HO*BH*"4%L:6%S
M(&9O<B!S<75A9%]T87)G970\/B!M96UO<GD_at_86QL;V-A=&EO;BX**B\*"G1E
M;7!L871E(#QT>7!E;F%M92!?5#X*"6EN;&EN92!V;VED("H@<W%U860H*0H)
M>PH)"7)E='5R;B!B=69F97(\('-Q=6%D7W1A<F=E=#Q?5#X@/B_at_I("L@<&]S
M*"8@<W%U861?=&%R9V5T/%]4/CHZ;5]O8FIE8W0I.PH)?0H*"GT*"@HC96YD
#:68*
`
end

begin 666 testptr1.cpp
M(VEN8VQU9&4@/&EO<W1R96%M/@HC:6YC;'5D92 B<W%U861?<'1R+F_at_B"@IU
M<VEN9R!N86UE<W!A8V4@<W1D.PIU<VEN9R!N86UE<W!A8V4_at_[hidden]*<W1R
M=6-T('!A<F5N= I["@EC:&%R("H_at_9CL*"@EP87)E;G0H*0H)>PH)"6-O=70@
M/#P_at_7U]04D545%E?1E5.0U1)3TY?7R \/"!E;F1L.PH)?0H*"79I<G1U86P@
M?G!A<F5N="@I"@E["@D)8V]U=" \/"!?7U!2151465]&54Y#5$E/3E]?(#P\
M(&5N9&P["@E]"GT["@IS=')U8W0_at_8VAI;&0_at_.B!P87)E;G0*>PH)8VAI;&0H
M8VAA<B J(&%?<"P@+BXN*0H)>PH)"68@/2!A7W ["@D)8V]U=" \/"!?7U!2
M151465]&54Y#5$E/3E]?(#P\(&5N9&P["@E]"@H)=FER='5A;"!^8VAI;&0H
M*0H)>PH)"6-O=70@/#P_at_7U]04D545%E?1E5.0U1)3TY?7R \/"!E;F1L.PH)
M?0I].PH*:6YT(&UA:6XH*0I["@ES<75A9%]P='(\<&%R96YT/B!P(#T@;F5W
M("AN97<@*'-Q=6%D/&-H:6QD/B_at_I*2!C:&EL9"@B2F]H;B(L(")-8TEN;FES
M(BDI('-Q=6%D7W1A<F=E=#QP87)E;G0^*"D["@H)8V]U=" \/"!P+3YF(#P\
5(&5N9&P["@H)<F5T=7)N(# ["GT*
`
end


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