|
Boost : |
From: David B. Held (dheld_at_[hidden])
Date: 2002-07-05 16:48:56
I am trying to implement Andrei's OptionallyInherit class, but I have
gotten stuck on trying to provide conversion c'tors between
compatible types. The attached files should illustrate my problem.
gcc-3.0 (can't get 3.1 to compile on my system yet) reports no
matching c'tor for ptr2 and ptr3. However, ptr2 should have a
compatible conversion c'tor, while ptr3 should not. I assume this
code requires too much type analysis from the compiler. I'm not sure
if that makes what I'm trying to do impossible, or just much more
difficult. Any comments are appreciated.
Dave
begin 666 optimally_inherit.hpp
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"B\O($-O<'ER:6=H
M=" H0RD@,C P,BP_at_1&%V:60_at_0BX@2&5L9"X*+R\@"B\O($-O9&4@:6YS<&ER
M960_at_8GD@06YD<F5I($%L97AA;F1R97-C=2=S($]P=&EO;F%L;'E);FAE<FET
M('1E;7!L871E(&%S('=E;&P*+R\@87,@8F]O<W0Z.F-O;7!R97-S961?<&%I
M<BX*+R\@"B\O(%!E<FUI<W-I;VX@=&\@8V]P>2P@=7-E+"!M;V1I9GDL('-E
M;&PL(&%N9"!D:7-T<FEB=71E('1H:7,@<V]F='=A<F4@:7,*+R\@9W)A;G1E
M9"!P<F]V:61E9"!T:&ES(&-O<'ER:6=H="!N;W1I8V4_at_87!P96%R<R!I;B!A
M;&P_at_8V]P:65S+B!4:&ES('-O9G1W87)E"B\O(&ES('!R;W9I9&5D(")A<R!I
M<R(@=VET:&]U="!E>'!R97-S(&]R(&EM<&QI960@=V%R<F%N='DL(&%N9"!W
M:71H(&YO(&-L86EM"B\O(&%S('1O(&ET<R!S=6ET86)I;&ET>2!F;W(@86YY
M('!U<G!O<V4N"B\O( HO+R!3964@:'1T<#HO+W=W=RYB;V]S="YO<F<O(&9O
M<B!M;W-T(')E8V5N="!V97)S:6]N+"!I;F-L=61I;F<@9&]C=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" @
M(&-L87-S('1R=65?="![('T["B @("!C;&%S<R!F86QS95]T('L@?3L*"B @
M("!T96UP;&%T92 \:6YT($-O;F0^"B @("!S=')U8W0_at_8F]O;#)T>7!E"B @
M("![('1Y<&5D968@=')U95]T('1Y<&4[('T["@H@(" @=&5M<&QA=&4@/#X*
M(" @('-T<G5C="!B;V]L,G1Y<&4\,#X*(" @('L@='EP961E9B!F86QS95]T
M('1Y<&4[('T["B @(" O+RTM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0H@
M(" @;F%M97-P86-E(&1E=&%I; H@(" @>PH@(" @(" @("\O+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2T*(" @(" @(" O+R!#:&EL9"!I;7!L96UE;G1A=&EO
M;@H@(" @(" @('1E;7!L871E(#QC;&%S<R!4,2P_at_8VQA<W,@5#(L(&-L87-S
M($9I<G-T27-%;7!T>2P_at_8VQA<W,@4V5C;VYD27-%;7!T>3X*(" @(" @("!S
M=')U8W0@;W!T:6UA;%]P87)E;G1S.PH@(" @(" @("\O+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2T*(" @(" @(" O+R!);FAE<FET(&)O=&@*(" @(" @("!T
M96UP;&%T92 \8VQA<W,@5#$L(&-L87-S(%0R/@H@(" @(" @('-T<G5C="!O
M<'1I;6%L7W!A<F5N=',\5#$L(%0R+"!F86QS95]T+"!F86QS95]T/@H@(" @
M(" @(" @(" Z('!U8FQI8R!4,2P@<'5B;&EC(%0R"B @(" @(" @>PH@(" @
M(" @(" @("!O<'1I;6%L7W!A<F5N=',H=F]I9"D*(" @(" @(" @(" @>R!]
M"@H@(" @(" @(" @("!T96UP;&%T92 \8VQA<W,@53$L(&-L87-S(%4R/@H@
M(" @(" @(" @("!O<'1I;6%L7W!A<F5N=',H;W!T:6UA;%]P87)E;G1S/%4Q
M+"!5,BP_at_9F%L<V5?="P_at_9F%L<V5?=#X_at_8V]N<W0F(')H<RD*(" @(" @(" @
M(" @.B!5,2AR:',I+"!5,BAR:',I"B @(" @(" @(" @('L@?0H@(" @(" @
M('T["B @(" @(" @+R\M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+0H@(" @(" @
M("\O($EN:&5R:70_at_9FER<W0*(" @(" @("!T96UP;&%T92 \8VQA<W,@5#$L
M(&-L87-S(%0R/@H@(" @(" @('-T<G5C="!O<'1I;6%L7W!A<F5N=',\5#$L
M(%0R+"!F86QS95]T+"!T<G5E7W0^"B @(" @(" @(" @(#H@<'5B;&EC(%0Q
M"B @(" @(" @>PH@(" @(" @(" @("!O<'1I;6%L7W!A<F5N=',H=F]I9"D*
M(" @(" @(" @(" @>R!]"@H@(" @(" @(" @("!T96UP;&%T92 \8VQA<W,@
M53$L(&-L87-S(%4R/@H@(" @(" @(" @("!O<'1I;6%L7W!A<F5N=',H;W!T
M:6UA;%]P87)E;G1S/%4Q+"!5,BP_at_9F%L<V5?="P@=')U95]T/B!C;VYS="8@
M<FAS*0H@(" @(" @(" @(" Z(%4Q*')H<RD*(" @(" @(" @(" @>R!4,BA5
M,B_at_I*3L@?0H@(" @(" @(" @(" O+R!%;F9O<F-E(&-O;G9E<G-I;VX@<G5L
M97,*(" @(" @("!].PH@(" @(" @("\O+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2T*(" @(" @(" O+R!);FAE<FET('-E8V]N9 H@(" @(" @('1E;7!L871E
M(#QC;&%S<R!4,2P_at_8VQA<W,@5#(^"B @(" @(" @<W1R=6-T(&]P=&EM86Q?
M<&%R96YT<SQ4,2P_at_5#(L('1R=65?="P_at_9F%L<V5?=#X*(" @(" @(" @(" @
M.B!P=6)L:6,@5#(*(" @(" @("!["B @(" @(" @(" @(&]P=&EM86Q?<&%R
M96YT<RAV;VED*0H@(" @(" @(" @("![('T*"B @(" @(" @(" @('1E;7!L
M871E(#QC;&%S<R!5,2P_at_8VQA<W,@53(^"B @(" @(" @(" @(&]P=&EM86Q?
M<&%R96YT<RAO<'1I;6%L7W!A<F5N=',\53$L(%4R+"!T<G5E7W0L(&9A;'-E
M7W0^(&-O;G-T)B!R:',I"B @(" @(" @(" @(#H_at_53(H<FAS*0H@(" @(" @
M(" @("![(%0Q*%4Q*"DI.R!]"B @(" @(" @(" @("\O($5N9F]R8V4_at_8V]N
M=F5R<VEO;B!R=6QE<PH@(" @(" @('T["B @(" @(" @+R\M+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM+2TM
M+2TM+2TM+2TM+2TM+0H@(" @(" @("\O($EN:&5R:70@;F5I=&AE<@H@(" @
M(" @('1E;7!L871E(#QC;&%S<R!4,2P_at_8VQA<W,@5#(^"B @(" @(" @<W1R
M=6-T(&]P=&EM86Q?<&%R96YT<SQ4,2P_at_5#(L('1R=65?="P@=')U95]T/@H@
M(" @(" @('L*(" @(" @(" @(" @;W!T:6UA;%]P87)E;G1S*'9O:60I"B @
M(" @(" @(" @('L@?0H*(" @(" @(" @(" @=&5M<&QA=&4@/&-L87-S(%4Q
M+"!C;&%S<R!5,CX*(" @(" @(" @(" @;W!T:6UA;%]P87)E;G1S*&]P=&EM
M86Q?<&%R96YT<SQ5,2P_at_53(L('1R=65?="P@=')U95]T/B!C;VYS="8@<FAS
M*0H@(" @(" @(" @("![(%0Q*%4Q*"DI.R!4,BA5,B_at_I*3L@?0H@(" @(" @
M(" @(" O+R!%;F9O<F-E(&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S=#HZ
M;W!T:6UA;&QY7VEN:&5R:70\5#$L(%0R/BP*(" @(" @("!B;V]S=#HZ;W!T
M:6UA;&QY7VEN:&5R:70\5#,L(%0T/@H@(" @/@I["G!U8FQI8SH*(" @('-M
M87)T7W!T<B_at_I('L@?0H*(" @('1E;7!L871E(#QC;&%S<R!5,2P_at_8VQA<W,@
M53(L(&-L87-S(%4S+"!C;&%S<R!5-#X*(" @('-M87)T7W!T<BAS;6%R=%]P
M='(\53$L(%4R+"!5,RP_at_530^(&-O;G-T)B!R:',I"B @(" @(" @.B!B;V]S
M=#HZ;W!T:6UA;&QY7VEN:&5R:70\"B @(" @(" @(" @(&)O;W-T.CIO<'1I
M;6%L;'E?:6YH97)I=#Q4,2P_at_5#(^+ H@(" @(" @(" @("!B;V]S=#HZ;W!T
M:6UA;&QY7VEN:&5R:70\5#,L(%0T/@H@(" @(" @(#XH<FAS*0H@(" @>R!]
M"GT["@II;G0@;6%I;B_at_I"GL*(" @('-M87)T7W!T<CQ0,2P_at_4#)A+"!0,RP@
M4#0^('!T<C$["B @("!S;6%R=%]P='(\4#$L(% R8BP_at_4#,L(% T/B!P='(R
M*'!T<C$I.PH@(" @<VUA<G1?<'1R/% Q+"!0,F$L(% S+"!0-#X@<'1R,RAP
M='(R*3L*"B @("!S=&0Z.F-O=70@/#P@<VEZ96]F*'!T<C$I(#P\('-T9#HZ
M96YD;#L*"B @("!S=&0Z.G-T<FEN9R!S.PH@(" @<W1D.CIG971L:6YE*'-T
.9#HZ8VEN+"!S*3L*?0H`
`
end
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk