|
Boost Users : |
From: Angus Leeming (angus.leeming_at_[hidden])
Date: 2004-09-03 03:04:38
Jonathan Turkanis wrote:
>
> "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!)
Hey! ;-)
> 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.
Hmmmmm. Looking at your solution, I can see that I was on the right track.
What puzzles me is why my attempt fails and yours succeeds. Mine complains
that 'bool' has no char_traits member when I try
is_ostream<bool>
Yours just works.
Ahhh. I think I get it. Yours is all wrapped up inside
template<typename T>
struct is_ostream
: mpl::bool_<detail::is_ostream_impl<T>::value>
{};
Clever, clever, clever.
> 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>, ...
Oh, great. I didn't think to look in the aux_ directory and so never
spotted has_xxx.hpp.
Many, many thanks for all this, Jonathan.
Angus
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