help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: always true warning


From: address@hidden
Subject: Re: always true warning
Date: 22 Dec 2006 07:47:10 -0800
User-agent: G2/1.0

Bernd Strieder wrote:
>
> I think I would prefer the warning in your case, if there are no other
> reasons for the template hackery, then it should not be done. If you
> have the same problem in more instances, then creating a custom traits
> class might be helpful, i.e. make general_version to a class and put
> the things depending on the integer type into it as typedefs or
> whatever, just extending the idea. Maybe you could use existing traits
> classes, like those from boost, I think they include signedness.
>

What I did is I implemented template fn bool isnegative() which is used
instead of <0.
This fn returns false in general and is specialized for signed types so
that it returns <0.

> I'm probably not reachable until next year, so I have to hope there are
> competent people to help you still reading, if you have more questions.

Happy new year ;)
m



reply via email to

[Prev in Thread] Current Thread [Next in Thread]