Boost logo

Boost Users :

Subject: Re: [Boost-users] Determine at compile time whether type has subtraction semantics?
From: John Reid (j.reid_at_[hidden])
Date: 2011-02-18 13:27:09


On 18/02/11 18:05, Dave Abrahams wrote:
> On Fri, Feb 18, 2011 at 12:55 PM, Steven Watanabe<watanabesj_at_[hidden]> wrote:
>> AMDG
>>
>> On 2/18/2011 9:50 AM, John Reid wrote:
>>>
>>> Is it possible to determine at compile-time if a type has subtraction
>>> semantics? E.g. in struct A<T> I would like to decide at compile-time
>>> not to execute&A::subtract in the register_fns method. Then the
>>> subtract method is not instantiated and there is no error.
>>
>> I believe the type traits extensions in the
>> review queue handle this.
>
Thanks.

> Just to be clear, you can only check syntax at compile-time, not semantics.
>
Fair point.


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