"Angus Leeming" wrote in message
news:ch7h3d$466$1@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.
The attached file ios_traits.hpp is from my iostreams library currently under
review. It contains MPL-compatible metafunctions is_istream, is_ostream,
is_iostream and is_streambuf to test whether a given type is the same as or
derived from the corresponding standard library template.
It has served me well, but I'd be happy to have others examine it.
Note that it is fairly common for a stream to derive privately from
basic_streambuf; with the current implementation, testing such a stream using
is_streambuf causes a compiler error.
Jonathan
begin 666 ios_traits.hpp
M+R\@*$,I($-O<'ER:6=H="!*;VYA=&AA;B!4=7)K86YI6EN9PT*+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%\O;&%M8F1A7W-U<'!O7!E7W1R86ET7!E7W1R
M86ET7!E+FAP<#X@(" @( T*
M#0HO+R -"B\O($UA8W)O(&YA;64Z($)/3U-47TE/7T)/3TQ?5%)!251?1$5&
M#0HO+R!$97-CR @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @7 T*(" @(" @(" @("!"3T]35%]35$%424-?0T].4U1!3E0H8F]O
M;"P@=F%L=64@/2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @
M(" @(" @(" @(" @("AS:7IE;V8H0D]/4U1?4%!?0T%4*'1R86ET+"!?:&5L
M<&5R*2AS=&%T:6-?8V%S=#Q4*CXH,"DI*2 ]/2!<#0H@(" @(" @(" @(" @
M(" @R!"3T]35%]-4$Q?05587TQ!34)$05]355!03U)4
M*#$L('1R86ET+" H5"DI('T[(" @(" @(" @(" @(" @(" @(" @(" @7 T*
M(" @('T@?2 @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @
M(" @(" @(" @(" @(" @(" @(" @(" @(" @(" @(%P-"B @(" O*BHO#0H-
M"D)/3U-47TE/7T)/3TQ?5%)!251?1$5&*&ES7V)A8VM?:6YS97)T97(L('-T
M9#HZ8F%C:U]I;G-E2!FF%T:6]N(&]F(&)A7!E('=I;&P@8V%U