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

_______________________________________________
help-gplusplus mailing list
help-gplusplus@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gplusplus

Reply via email to