Boost logo

Boost Users :

From: Jonathan Turkanis (technews_at_[hidden])
Date: 2004-09-02 12:42:21


"Angus Leeming" <angus.leeming_at_[hidden]> wrote in message
news:ch7h3d$466$1_at_sea.gmane.org...
> I'm trying to ascertain whether a given class is, or is derived from,
> std::basic_ostream, but I've ground to a halt.

I've attached a somewhat improved version inspired by your attempt. (Thanks!) It
only works on compilers which support has_xxx, but it should handle the case of
private inheritance now, by delegating to is_base_and_derived.

Note that with the current cvs it should not be necessary to write

    mpl::and_< mpl::bool_<has_char_type<U>::value>, ...

You can simply say

    mpl::and_< has_char_type<U>, ...

Best Regards,
Jonathan

begin 666 ios_traits.hpp
M+R\@*$,I($-O<'ER:6=H="!*;VYA=&AA;B!4=7)K86YI<R R,# S+@T*+R\@
M1&ES=')I8G5T960@=6YD97(@=&AE($)O;W-T(%-O9G1W87)E($QI8V5N<V4L
M(%9E<G-I;VX@,2XP+B H4V5E(&%C8V]M<&%N>6EN9PT*+R\@9FEL92!,24-%
M3E-%7S%?,"YT>'0@;W(@8V]P>2!A="!H='1P.B\O=W=W+F)O;W-T+F]R9R],
M24-%3E-%7S%?,"YT>'0N*0T*#0HC:69N9&5F($)/3U-47TE/7TE/4U]44D%)
M5%-?2%!07TE.0TQ51$5$#0HC9&5F:6YE($)/3U-47TE/7TE/4U]44D%)5%-?
M2%!07TE.0TQ51$5$(" @(" @( T*( T*(VEN8VQU9&4@/&ET97)A=&]R/B @
M(" @(" @(" @(" @(" @(" @(" @(" @(" O+R!B86-K7VEN<V5R=%]I=&5R
M871O<BX@(" @#0HC:6YC;'5D92 \:6]S9G=D/@T*(VEN8VQU9&4@/&)O;W-T
M+V-O;F9I9RYH<' ^(" @(" @(" @(" @(" @(" @(" O+R!S=&%T:6,@8V]N
M<W0N#0HC:6YC;'5D92 \8F]O<W0O;7!L+V%U>%\O:&%S7WAX>"YH<' ^(" @
M(" @(" @(" @(" @#0HC:6YC;'5D92 \8F]O<W0O;7!L+V%U>%\O;&%M8F1A
M7W-U<'!O<G0N:'!P/B @( T*(VEN8VQU9&4@/&)O;W-T+VUP;"]A;F0N:'!P
M/B @(" @(" @(" @(" @( T*(VEN8VQU9&4@/&)O;W-T+VUP;"]B;V]L+FAP
M<#X@(" @(" @(" @(" @(" -"B-I;F-L=61E(#QB;V]S="]M<&PO;W(N:'!P
M/B @(" @(" @(" @(" @( T*(VEN8VQU9&4@/&)O;W-T+W!R97!R;V-E<W-O
M<B]C870N:'!P/B @(" @(" @(" -"B-I;F-L=61E(#QB;V]S="]P<F5P<F]C
M97-S;W(O<F5P971I=&EO;B]E;G5M7W!A<F%M<RYH<' ^(" @(" @(" -"B-I
M;F-L=61E(#QB;V]S="]T>7!E7W1R86ET<R]I<U]B87-E7V%N9%]D97)I=F5D
M+FAP<#X@(" @(" @(" @(" -"B-I;F-L=61E(#QB;V]S="]T>7!E7W1R86ET
M<R]I<U]S86UE+FAP<#X@(" @(" @(" @(" @#0HC:6YC;'5D92 \8F]O<W0O
M='EP95]T<F%I=',O9&5T86EL+WEE<U]N;U]T>7!E+FAP<#X@(" @( T*#0HO
M+R -"B\O($UA8W)O(&YA;64Z($)/3U-47TE/7T)/3TQ?5%)!251?1$5&#0HO
M+R!$97-C<FEP=&EO;CH_at_57-E9"!T;R!G96YE<F%T92!T:&4@=')A:71S(&-L
M87-S97,@:7-?:7-T<F5A;2P@:7-?;W-T<F5A;2P-"B\O(" @(" @971C+@T*
M+R\-"B-D969I;F4_at_0D]/4U1?24]?0D]/3%]44D%)5%]$148H=')A:70L('1Y
M<&4L(&%R:71Y*2 @(" @(" @(" @(" @(" @(" @(" @("!<#0H@(" @;F%M
M97-P86-E(&)O;W-T('L@;F%M97-P86-E(&EO('L@;F%M97-P86-E(&1E=&%I
M;"![(" @(" @(" @(" @(" @(" @(" @7 T*(" @(" @=&5M<&QA=&4\0D]/
M4U1?4%!?14Y535]005)!35,H87)I='DL('1Y<&5N86UE(%0I/B @(" @(" @
M(" @(" @(" @(" @(%P-"B @(" @('1Y<&5?=')A:71S.CIY97-?='EP92!"
M3T]35%]04%]#050H=')A:70L(%]H96QP97(I(" @(" @(" @(" @(" @(" @
M("!<#0H@(" @(" @(" @*&-O;G-T('9O;&%T:6QE('1Y<&4\0D]/4U1?4%!?
M14Y535]005)!35,H87)I='DL(%0I/BHI.R @(" @(" @(" @7 T*(" @(" @
M='EP95]T<F%I=',Z.FYO7W1Y<&4_at_0D]/4U1?4%!?0T%4*'1R86ET+"!?:&5L
M<&5R*2_at_N+BXI.R @(" @(" @(" @(" @(%P-"B @(" @('1E;7!L871E/'1Y
M<&5N86UE(%0^(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @("!<#0H@(" @("!S=')U8W0_at_0D]/4U1?4%!?0T%4*'1R
M86ET+"!?:6UP;"D@>R @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @7 T*(" @(" @(" @("!"3T]35%]35$%424-?0T].4U1!3E0H8F]O;"P@
M=F%L=64@/2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @(" @
M(" @(" @(" @("AS:7IE;V8H0D]/4U1?4%!?0T%4*'1R86ET+"!?:&5L<&5R
M*2AS=&%T:6-?8V%S=#Q4*CXH,"DI*2 ]/2!<#0H@(" @(" @(" @(" @(" @
M<VEZ96]F*'1Y<&5?=')A:71S.CIY97-?='EP92DI*3L@(" @(" @(" @(" @
M(" @(" @(" @(" @(" @7 T*(" @(" @?3L@(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(%P-"B @("!](" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!<#0H@(" @
M=&5M<&QA=&4\='EP96YA;64_at_5#X@(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @7 T*(" @('-T<G5C="!T<F%I
M=" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(%P-"B @(" @(" @.B!M<&PZ.F)O;VQ?/&1E=&%I
M;#HZ0D]/4U1?4%!?0T%4*'1R86ET+"!?:6UP;"D\5#XZ.G9A;'5E/B @(" @
M(" @("!<#0H@(" @>R!"3T]35%]-4$Q?05587TQ!34)$05]355!03U)4*#$L
M('1R86ET+" H5"DI('T[(" @(" @(" @(" @(" @(" @(" @(" @7 T*(" @
M('T@?2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @(" O*BHO#0H-"FYA
M;65S<&%C92!B;V]S="![(&YA;65S<&%C92!I;R![(&YA;65S<&%C92!D971A
M:6P@>PT*#0I"3T]35%]-4$Q?2$%37UA86%]44D%)5%].04U%1%]$148H:&%S
M7V-H87)?='EP92P_at_8VAA<E]T>7!E+"!T<G5E*0T*0D]/4U1?35!,7TA!4U]8
M6%A?5%)!251?3D%-141?1$5&*&AA<U]T<F%I='-?='EP92P@=')A:71S7W1Y
M<&4L('1R=64I#0H-"GT@?2!]("\O($5N9"!N86UE<W!A8V5S(&1E=&%I;"P@
M:6\L(&)O;W-T+@T*#0HO+R -"B\O($UA8W)O(&YA;64Z($)/3U-47TE/7T)/
M3TQ?5%)!251?1$5&#0HO+R!$97-C<FEP=&EO;CH_at_57-E9"!T;R!G96YE<F%T
M92!T:&4@=')A:71S(&-L87-S97,@:7-?:7-T<F5A;2P@:7-?;W-T<F5A;2P-
M"B\O(" @(" @971C+@T*+R\-"B-D969I;F4_at_0D]/4U1?24]?24]37U1204E4
M7T1%1BAT<F%I="P_at_8F%S92D@(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @("!<#0H@(" @;F%M97-P86-E(&)O;W-T('L@;F%M97-P86-E(&EO('L@
M;F%M97-P86-E(&1E=&%I;"![(" @(" @(" @(" @(" @(" @(" @7 T*(" @
M(" @=&5M<&QA=&4\='EP96YA;64_at_5#X@(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @(" @('-T<G5C="!"
M3T]35%]04%]#050H=')A:70L(%]I;7!L*2![(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @("!<#0H@(" @(" @(" @=&5M<&QA=&4\='EP96YA
M;64_at_53X@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @7 T*(" @(" @(" @('-T<G5C="!D97)I=F5D7V9R;VU?8F%S92![
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @
M(" @(" @(" @(" @='EP961E9B!T>7!E;F%M92!5.CIC:&%R7W1Y<&4@(" @
M(" @(" @(" @(" @(" @(&-H87)?='EP93L@("!<#0H@(" @(" @(" @(" @
M('1Y<&5D968@='EP96YA;64_at_53HZ=')A:71S7W1Y<&4@(" @(" @(" @(" @
M(" @("!T<F%I='-?='EP93L_at_7 T*(" @(" @(" @(" @("!T>7!E9&5F(&UP
M;#HZ;W)?/" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(%P-"B @(" @(" @(" @(" @(" @(" @(" @(" @:7-?<V%M93P@
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!<#0H@
M(" @(" @(" @(" @(" @(" @(" @(" @(" @("!B87-E/&-H87)?='EP92P@
M=')A:71S7W1Y<&4^+"!5(" @(" @(" @(" @(" @7 T*(" @(" @(" @(" @
M(" @(" @(" @(" @(" ^+" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(%P-"B @(" @(" @(" @(" @(" @(" @(" @
M(" @:7-?8F%S95]A;F1?9&5R:79E9#P@(" @(" @(" @(" @(" @(" @(" @
M(" @(" @("!<#0H@(" @(" @(" @(" @(" @(" @(" @(" @(" @("!B87-E
M/&-H87)?='EP92P@=')A:71S7W1Y<&4^+"!5(" @(" @(" @(" @(" @7 T*
M(" @(" @(" @(" @(" @(" @(" @(" @(" ^(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @(" @(" @(" @
M(" @(" @(" @(" ^(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @('1Y<&4[(" @(" @("!<#0H@(" @(" @(" @(" @($)/3U-47U-4
M051)0U]#3TY35$%.5"AB;V]L+"!V86QU92 ]('1Y<&4Z.G9A;'5E*3L@(" @
M(" @(" @(" @7 T*(" @(" @(" @('T[(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-
M"B @(" @(" @("!T>7!E9&5F(&UP;#HZ86YD7SP@(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!<#0H@(" @(" @(" @
M(" @(" @(" @(" @(&UP;#HZ8F]O;%\\:&%S7V-H87)?='EP93Q4/CHZ=F%L
M=64^+" @(" @(" @(" @(" @(" @7 T*(" @(" @(" @(" @(" @(" @(" @
M("!M<&PZ.F)O;VQ?/&AA<U]T<F%I='-?='EP93Q4/CHZ=F%L=64^+" @(" @
M(" @(" @(" @(%P-"B @(" @(" @(" @(" @(" @(" @(" @9&5R:79E9%]F
M<F]M7V)A<V4\5#X@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!<
M#0H@(" @(" @(" @(" @(" @(" ^(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @("!T>7!E.R @(" @(" @7 T*(" @(" @(" @
M($)/3U-47U-4051)0U]#3TY35$%.5"AB;V]L+"!V86QU92 ]('1Y<&4Z.G9A
M;'5E*3L@(" @(" @(" @(" @(" @(%P-"B @(" @('T[(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @("!<#0H@(" @?2 @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M7 T*(" @('1E;7!L871E/'1Y<&5N86UE(%0^(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @("!S=')U
M8W0@=')A:70@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @("!<#0H@(" @(" @(#H@;7!L.CIB;V]L
M7SQD971A:6PZ.D)/3U-47U!07T-!5"AT<F%I="P_at_7VEM<&PI/%0^.CIV86QU
M93X@(" @(" @(" @7 T*(" @('L_at_0D]/4U1?35!,7T%56%],04U"1$%?4U50
M4$]25"@Q+"!T<F%I="P@*%0I*2!].R @(" @(" @(" @(" @(" @(" @(" @
M(%P-"B @("!]('T@(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @("!<#0H@(" @+RHJ
M+PT*#0I"3T]35%])3U]"3T],7U1204E47T1%1BAI<U]B86-K7VEN<V5R=&5R
M+"!S=&0Z.F)A8VM?:6YS97)T7VET97)A=&]R+" Q*0T*0D]/4U1?24]?24]3
M7U1204E47T1%1BAI<U]I<W1R96%M+"!S=&0Z.F)A<VEC7VES=')E86TI#0I"
M3T]35%])3U])3U-?5%)!251?1$5&*&ES7V]S=')E86TL('-T9#HZ8F%S:6-?
M;W-T<F5A;2D-"D)/3U-47TE/7TE/4U]44D%)5%]$148H:7-?:6]S=')E86TL
M('-T9#HZ8F%S:6-?:6]S=')E86TI#0I"3T]35%])3U])3U-?5%)!251?1$5&
M*&ES7W-T<F5A;6)U9BP@<W1D.CIB87-I8U]S=')E86UB=68I#0I"3T]35%])
M3U]"3T],7U1204E47T1%1BAI<U]S=')I;F=S=')E86TL('-T9#HZ8F%S:6-?
M<W1R:6YG<W1R96%M+" S*0T*0D]/4U1?24]?0D]/3%]44D%)5%]$148H:7-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@T*#0HC96YD:68@+R\@(VEF;F1E9B!"3T]35%])3U])3U-?
55%)!25137TA04%])3D-,541%1 T*
`
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