This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: numeric_limits<array type> generates a compiler error
Correction: I can only pass arithmetic types to numeric_limits::is_integer
On Wed, Feb 6, 2013 at 1:46 PM, Andy Venikov <avenikov@google.com> wrote:
> On Wed, Feb 6, 2013 at 1:35 PM, Daniel Krügler
> <daniel.kruegler@gmail.com> wrote:
> <snip>
>
>>> I would expect that your code should work.
>>
>> Oops, I need to correct myself. When instantiating the primary
>> template the function declarations will also be instantiates and this
>> example would indeed result in an invalid attempt to declare
>>
>> static constexpr char[10] min() noexcept;
>>
>> and all other functions. So, this is supposed to be ill-formed.
>>
>> - Daniel
>
> I see, so there's no requirement that functions that don't make sense
> for non-arithmetic types should simple be disabled.
> The context of the questions: right now, there's no way to directly
> query any type if it's integer. (i.e. there's no is_integer in
> type_traits).
> 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.
>
> Thanks,
> Andy.