-Wenum-compare and template metaprogramming

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

 



In template metaprogramming, we may write something like

~~~~~
template <typename A, typename B>
struct BetterType
{
  typedef If<(Priority<A>::value > Priority<B>::value), A, B>::type type;
};
~~~~~

However, GCC -Wenum-compare (enabled by default) would complain
at each POT of BetterType.  It seems annoying.

Of course we can cast the operands of compare to int.  But should we
make GCC more clever and not to complain this causal idiom?
-- 
Xi Ruoyao <ryxi@xxxxxxxxxxxxxxxxx>
School of Aerospace Science and Technology, Xidian University




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux