Boost logo

Boost :

From: Gennadiy Rozental (gennadiy.rozental_at_[hidden])
Date: 2004-11-17 23:43:28


> > Furthermore, you
> > have O(N) instantiations for every lookup, we have O(1).
>
> I do not understand your code that well to contradict you, but I frankly
> very much doubt so.

Ok. I think I see where O(1) comes from. I've reimplemented my solution
based on similar idea.
Now the total size is ~60 lines and without *any* includes (see attached).
And it support

1. typed keywords to support strict type checking
2. non-typed keywords to support template functions parameters
3. optional parameters and default values ( could use with runtime if
without compile-time errors)

What are the other "every feature you support" but I don't?

Gennadiy.

begin 666 d.cpp
M+R\@3&EB<F%R>2!#;V1E"G1E;7!L871E/'1Y<&5N86UE($Y0,2QT>7!E;F%M
M92!.4#(^(" @(" @<W1R=6-T(&YA;65D7W!A<F%M971E<E]C;VUB:6YE.PIT
M96UP;&%T93QT>7!E;F%M92!4+"!T>7!E;F%M92!U;FEQ=65?:60^('-T<G5C
M="!N86UE9%]P87)A;65T97(["G1E;7!L871E/'1Y<&5N86UE('5N:7%U95]I
M9#X@(" @(" @(" @(" @<W1R=6-T(&ME>7=O<F0["@IS=')U8W0@;FEL('L*
M(" @('1E;7!L871E/'1Y<&5N86UE(%0^(&]P97)A=&]R(%0H*2![('1H<F]W
M(")A8V-E<W-?=&]?:6YV86QI9%]P87)A;65T97(B.R!R971U<FX@*BA4*BDP
M.R!]"GT["@IT96UP;&%T93QT>7!E;F%M92!$97)I=F5D/@IS=')U8W0@;F%M
M961?<&%R86UE=&5R7V)A<V4@>PH@(" @=&5M<&QA=&4\='EP96YA;64_at_3E ^
M"B @("!N86UE9%]P87)A;65T97)?8V]M8FEN93Q.4"Q$97)I=F5D/@H@(" @
M;W!E<F%T;W(L*"!.4"!C;VYS="8@;G @*2![(')E='5R;B!N86UE9%]P87)A
M;65T97)?8V]M8FEN93Q.4"Q$97)I=F5D/B@@;G L("IS=&%T:6-?8V%S=#Q$
M97)I=F5D*CXH=&AI<RD@*3L@?0I].PH*=&5M<&QA=&4@/&-L87-S($Y0+"!C
M;&%S<R!297-T(#T@;FEL/@IS=')U8W0@;F%M961?<&%R86UE=&5R7V-O;6)I
M;F4_at_.B!297-T+"!N86UE9%]P87)A;65T97)?8F%S93QN86UE9%]P87)A;65T
M97)?8V]M8FEN93Q.4"Q297-T/B ^('L*(" @(&YA;65D7W!A<F%M971E<E]C
M;VUB:6YE*$Y0(&-O;G-T)B!N<"P_at_4F5S="!C;VYS="8@<B I"B @(" Z(%)E
M<W0H('(@*2P@;5]P87)A;2@@;G @*2![?0H*(" @('1Y<&5N86UE($Y0.CID
M871A7W1Y<&4_at_8V]N<W0F(&]P97)A=&]R6UTH(&ME>7=O<F0\='EP96YA;64@
M3E Z.FED/B!K=R I(&-O;G-T('L@<F5T=7)N(&U?<&%R86U;:W==.R!]"B @
M("!U<VEN9R!297-T.CIO<&5R871O<EM=.PH@(" @=&5M<&QA=&4\='EP96YA
M;64_at_56YK;F]W;DED/@H@(" @;FEL(&]P97)A=&]R6UTH(&ME>7=O<F0\56YK
M;F]W;DED/B!K=R I(&-O;G-T('L@<F5T=7)N(&YI;"@I.R!]"@H@(" @8F]O
M;"!I<U]P<F5S96YT*"!K97EW;W)D/'1Y<&5N86UE($Y0.CII9#X@*2!C;VYS
M="![(')E='5R;B!T<G5E.R!]"B @("!U<VEN9R!297-T.CII<U]P<F5S96YT
M.PH@(" @=&5M<&QA=&4\='EP96YA;64_at_2U<^"B @("!B;V]L(&ES7W!R97-E
M;G0H($M7("D_at_8V]N<W0@>R!R971U<FX_at_9F%L<V4[('T@( H*(" @('5S:6YG
M(&YA;65D7W!A<F%M971E<E]B87-E/&YA;65D7W!A<F%M971E<E]C;VUB:6YE
M/$Y0+%)E<W0^(#XZ.F]P97)A=&]R+#L*"B @("!.4"!M7W!A<F%M.PI].PH*
M=&5M<&QA=&4\='EP96YA;64_at_5"P@='EP96YA;64@=6YI<75E7VED/@IS=')U
M8W0@;F%M961?<&%R86UE=&5R(#H@;F%M961?<&%R86UE=&5R7V)A<V4\;F%M
M961?<&%R86UE=&5R/%0L('5N:7%U95]I9#X@/B!["B @("!T>7!E9&5F(%0@
M(" @(" @(" @(&1A=&%?='EP93L*(" @('1Y<&5D968@=6YI<75E7VED(" @
M:60["@H@(" @97AP;&EC:70@;F%M961?<&%R86UE=&5R*"!4(&-O;G-T)B!V
M("D_at_.B!M7W9A;'5E*"!V("D@>WT*"B @("!4(&-O;G-T)B!O<&5R871O<EM=
M*"!K97EW;W)D/'5N:7%U95]I9#X@*2!C;VYS="![(')E='5R;B!M7W9A;'5E
M.R!]"B @("!B;V]L(" @("!I<U]P<F5S96YT*"!K97EW;W)D/'5N:7%U95]I
M9#X@*2!C;VYS="![(')E='5R;B!T<G5E.R!]"@H@(" @5"!C;VYS="8@;5]V
M86QU93L*?3L*"G1E;7!L871E/'1Y<&5N86UE('5N:7%U95]I9#X*<W1R=6-T
M(&ME>7=O<F0@>PH@(" @='EP961E9B!U;FEQ=65?:60@:60["@H@(" @=&5M
M<&QA=&4\='EP96YA;64_at_5#X*(" @(&YA;65D7W!A<F%M971E<CQ4+'5N:7%U
M95]I9#X*(" @(&]P97)A=&]R/2@@5"!C;VYS="8@=" I(&-O;G-T(" @>R!R
M971U<FX@;F%M961?<&%R86UE=&5R/%0L=6YI<75E7VED/B@@=" I.R!]"GT[
M"@IT96UP;&%T93QT>7!E;F%M92!4+"!T>7!E;F%M92!U;FEQ=65?:60^"G-T
M<G5C="!T>7!E9%]K97EW;W)D(#H@:V5Y=V]R9#QU;FEQ=65?:60^('L*(" @
M(&YA;65D7W!A<F%M971E<CQ4+'5N:7%U95]I9#X*(" @(&]P97)A=&]R/2@@
M5"!C;VYS="8@=" I(&-O;G-T(" @>R!R971U<FX@;F%M961?<&%R86UE=&5R
M/%0L=6YI<75E7VED/B@@=" I.R!]"GT["@HO+R\O+R\O+R\O+R\O+R\O+R\O
M+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O+R\O
M"B\O($5X86UP;&4Z"@HC:6YC;'5D92 \:6]S=')E86T^"B-I;F-L=61E(#QB
M;V]S="]S:&%R961?<'1R+FAP<#X*"FYA;65S<&%C92!T97-T"GL*("!T>7!E
M9%]K97EW;W)D/&-H87(@8V]N<W0J+'-T<G5C="!N86UE7W0^(&YA;64["B @
M='EP961?:V5Y=V]R9#QI;G0L<W1R=6-T(&EN9&5X7W0^(" @(" @("!I;F1E
M>#L*("!K97EW;W)D/'-T<G5C="!V86QU95]T/B @(" @(" @(" @(" @(" @
M('9A;'5E.PH*("!T96UP;&%T93QT>7!E;F%M92!686QU951Y<&4^"B @=F]I
M9"!F;V\Q*"!C:&%R(&-O;G-T*B!N+"!686QU951Y<&4@=BP@:6YT(&D@*0H@
M('L*(" @(" @<W1D.CIC;W5T(#P\(&X@/#P@)ULG(#P\(&D@/#P@(ET](B \
M/"!V(#P\('-T9#HZ96YD;#L*("!]"@H@('1E;7!L871E/&-L87-S(%!A<F%M
M<SX*("!V;VED(&9O;RA087)A;7,@8V]N<W0F('!A<F%M<RD*("!["B @(" @
M(&9O;S$H('!A<F%M<UMN86UE72P@<&%R86US6W9A;'5E72P@<&%R86US6VEN
M9&5X72 I.PH@('T*"B @=&5M<&QA=&4\8VQA<W,@4&%R86US/@H@('9O:60@
M8F]O*%!A<F%M<R!C;VYS="8@<&%R86US*0H@('L*(" @(" @9F]O,2@@<&%R
M86US6VYA;65=+"!P87)A;7-;=F%L=65=+"!P87)A;7,N:7-?<')E<V5N="AI
M;F1E>"D@/R!P87)A;7-;:6YD97A=(#H@," I.PH@('T*"B @:V5Y=V]R9#QS
M=')U8W0@:6YS=&%N8V5?=#X@:6YS=&%N8V4["@H@('1E;7!L871E/'1Y<&5N
M86UE(%0^"B @=F]I9"!M;V\Q*"!4*B!T("D*("!["B @(" @('-T9#HZ8V]U
M=" \/" B;F]N('-H87)E9" B(#P\("IT(#P\('-T9#HZ96YD;#L*("!]"@H@
M('1E;7!L871E/'1Y<&5N86UE(%0^"B @=F]I9"!M;V\Q*"!B;V]S=#H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(# ["GT*"@``
`
end


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