Boost logo

Boost Users :

Subject: Re: [Boost-users] Comparing is_pointer with true_
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-01-19 12:27:17


AMDG

jean-louis.a.leroy_at_[hidden] wrote:
>> I'm quite sure that I follow. Do you mean that you have a template like
>> this:
>> template<bool B>
>> void f(mpl::bool_<B>);
>>
>
> Nearly. It's more like this:
>
> template<class WritePointers, ...>
> struct WriteAttributes {
> template<class Attribute>
> void operator ()(Attribute a) const
> {
> typedef ... attribute_type;
> write(is_convertible<is_pointer<attribute_type>, WritePointers>(), ...);
> }
> template<...>
> void write(mpl::false_, ...); // non-pointer pass
> template<...>
> void write(mpl::true_, ...); // pointer pass
> // ...
> };
>

I see. How about

boost::mpl::equal_to<is_pointer<attribute_type>, WritePointers>

In Christ,
Steven Watanabe


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