Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2004-06-07 15:05:04


"Agoston Bejo" <gusz1_at_[hidden]> writes:

> "David Abrahams" <dave_at_[hidden]> wrote in message
> news:ur7srmmpm.fsf_at_boost-consulting.com...
>> "Wolfgang Meyer" <Wolfgang.Meyer_at_[hidden]> writes:
>>
>> >> that is something like this: How can I determine if a type T has such
> and
>> >> such member? It
>> >>
>> >> would look like something like this:
>> >>
>> >> has_member<T, paint>::result (true if T::paint() exists)
>> >> has_member<T, m_size>::result (true if T::m_size exists)
>> >
>> > AFAIK, checking for arbitrary members at compile time is not possible in
> a
>> > portable way.
>> >
>> > However, it seems that you can check for operators:
>> >
>> > http://lists.boost.org/MailArchives/boost/msg29007.php
>>
>> Much better techniques than the ones shown there are now known.
>>
>> --
>> Dave Abrahams
>> Boost Consulting
>> http://www.boost-consulting.com
>
>
> And where are they available, or at least can be read of?

You might look at
http://www.boost-consulting.com/boost/boost/detail/is_incrementable.hpp,
though it could be improved by using the comma operator to deal with
the possibility of void returns from a user defined operator++.

-- 
Dave Abrahams
Boost Consulting
http://www.boost-consulting.com

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