Boost logo

Boost :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2005-02-09 14:44:06


Thorsten Ottosen wrote:
>> "Jonathan Turkanis" <technews_at_[hidden]> wrote in message

>>> I definitely prefer "assign" to "assign_range". Could you say more
>>> explcitly what the ambiguity would be if you try to make assign and
>>> insert to too much work?
>>
>> yes, the problem shows up when an implicit conversion from Derived*
>> to Base* is needed and when another templated overload exists. The
>> templated overload does not require any conversions and so is deemed
>> a better match.
>>
>> The attached code shows the problem.
>>
>> I guess the problem could be removed with disable_if<>.

The attached version uses a similar idea, but should work on compilers without
SFINAE.

Jonathan

begin 666 range.cpp
M(VEN8VQU9&4@/'9E8W1O<CX-"B-I;F-L=61E(#QB;V]S="]T>7!E7W1R86ET
M<R]I<U]P;VEN=&5R+FAP<#X-"B-I;F-L=61E(#QB;V]S="]S=&%T:6-?87-S
M97)T+FAP<#X-"@T*=&5M<&QA=&4\8F]O;"!)<U!O:6YT97(^#0IS=')U8W0@
M:6YS97)T7VEM<&P[#0H-"G1E;7!L871E/#X-"G-T<G5C="!I;G-E<G1?:6UP
M;#QT<G5E/B![#0H@(" @=&5M<&QA=&4\='EP96YA;64_at_0V]N=&%I;F5R+"!T
M>7!E;F%M92!)=&5R871O<BP@='EP96YA;64_at_5#X-"B @("!S=&%T:6,@=F]I
M9"!I;G-E<G0H0V]N=&%I;F5R)B!C;G0L($ET97)A=&]R(&ET+"!4*B!T*0T*
M(" @('L-"@T*(" @('T-"GT[#0H-"@T*=&5M<&QA=&4\/@T*<W1R=6-T(&EN
M<V5R=%]I;7!L/&9A;'-E/B![#0H@(" @=&5M<&QA=&4\='EP96YA;64_at_0V]N
M=&%I;F5R+"!T>7!E;F%M92!)=&5R871O<BP@='EP96YA;64_at_4F%N9V4^#0H@
M(" @<W1A=&EC('9O:60@:6YS97)T*$-O;G1A:6YE<B8_at_8VYT+"!)=&5R871O
M<B!I="P_at_8V]N<W0_at_4F%N9V4F('(I#0H@(" @>PT*(" @(" @("!"3T]35%]3
M5$%424-?05-315)4*"@@(6)O;W-T.CII<U]P;VEN=&5R/%)A;F=E/CHZ=F%L
M=64@*2D[#0H@(" @?0T*?3L-"@T*=&5M<&QA=&4\(&-L87-S(%0@/@T*<W1R
M=6-T(&YE=U]V96-T;W(-"GL-"B @("!T>7!E9&5F('-T9#HZ=F5C=&]R/%0J
M/B @(" @(" @(" @("!T>7!E.PT*(" @('1Y<&5D968@='EP96YA;64@='EP
M93HZ:71E<F%T;W(@(" @(&ET97)A=&]R.PT*#0H@(" @+R\@365R9V5D('=I
M=&@@4F%N9V4@;W9E<FQO860N#0H@(" @+R]V;VED(&EN<V5R="@@:71E<F%T
M;W(L(%0J("D-"B @(" O+WL-"B @(" O+WT-"@T*(" @('9O:60@:6YS97)T
M*"!I=&5R871O<BP_at_5"8@*0T*(" @('L-"B @("!]#0H-"B @("!T96UP;&%T
M93P_at_8VQA<W,@4F%N9V4@/@T*(" @('9O:60@:6YS97)T*"!I=&5R871O<B!I
M="P_at_8V]N<W0_at_4F%N9V4F('(@*0T*(" @('L-"B @(" @(" @:6YS97)T7VEM
M<&P\(&)O;W-T.CII<U]P;VEN=&5R/%)A;F=E/CHZ=F%L=64@/CHZ:6YS97)T
M*"IT:&ES+"!I="P@<BD[#0H@(" @?0T*#0H@(" @:71E<F%T;W(@8F5G:6XH
M*0T*(" @('L-"B @(" @(" @<F5T=7)N(&ET97)A=&]R*"D[#0H@(" @?0T*
M?3L-"@T*<W1R=6-T($9O;PT*>PT*?3L-"@T*<W1R=6-T($)A<B Z($9O;PT*
M>PT*?3L-"@T*=&5M<&QA=&4\(&-L87-S(%0L(&-L87-S(%4@/@T*=F]I9"!F
M;V\H*0T*>PT*(" @(&YE=U]V96-T;W(\5#X@=CL-"B @("!V+FEN<V5R="@@
M=BYB96=I;B_at_I+"!N97<@52 I.R @(" -"B @("!V+FEN<V5R="@@=BYB96=I
M;B_at_I+"!V("D[#0I]#0H-"FEN="!M86EN*"D-"GL-"@T*(" @(&9O;SQI;G0L
M:6YT/B_at_I.R O+R!O:PT*(" @(&9O;SQ&;V\L1F]O/B_at_I.R O+R!O:PT*(" @
>(&9O;SQ&;V\L0F%R/B_at_I.R O+R!D;V_at_-"@T*?0T*
`
end


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