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


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.


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