This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: numeric_limits<array type> generates a compiler error


2013/2/6 Andy Venikov <avenikov@google.com>:
> Correction: I can only pass arithmetic types to numeric_limits::is_integer

No, you can pass every type that can be a valid return type of a
function. The actual intention of
std::numeric_limits is to query scalar-like "value types". It won't
work for function types, nor for
array types or for abstract types, for example.

>> I thought I could use numeric_limits::is_integer. But it looks like
>> I'll have to have a second layer, as I can only pass integral types
>> to is_integer.

Yes, you need your own intermediate layer if you want to support every
type to query for.

- Daniel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]