|
Boost : |
From: David Abrahams (dave_at_[hidden])
Date: 2003-11-13 18:17:17
"Brock Peabody" <brock.peabody_at_[hidden]> writes:
>> -----Original Message-----
>> From: boost-bounces_at_[hidden] [mailto:boost-bounces_at_[hidden]]
>> On Behalf Of David Abrahams
>> Sent: Thursday, November 13, 2003 4:06 PM
>> To: boost_at_[hidden]
>> Subject: [boost] Re: compile time member detection
>>
>> "Brock Peabody" <brock.peabody_at_[hidden]> writes:
>>
>> > Is anyone interested in a generic facility for member detection? I
>> couldn't
>> > find anything in boost to do it
>>
>> See boost/mpl/aux_/has_xxx.hpp for detecting member types.
>
> Do you think it would be useful to have a public facility for doing
> this,
Yes.
> along with detection for other types of members such as data, function,
> static function, static data?
Not sure about that part. I mean, I know it would be useful, but I'm
not certain whether it's useful *enough*. I just have no opinion.
> These types of inspection can provide very nice resolutions to
> problems that otherwise require more intrusive solutions like
> derivation or specialization.
Occasionally.
> Anyway, if there's another solution in the works I'll drop it, but
> otherwise I would be happy to boostify and document what I've got.
I think I'd like it to work the way the MPL one does; we're already
re-using that facility in several libraries. But I guess I understand
why you want to say has_member_type when you need a separate test for
has_member_data. OK, a mild vote yes from me.
-- Dave Abrahams Boost Consulting www.boost-consulting.com
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk