Advertisement
Guest User

Untitled

a guest
Jan 18th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. // is_signed
  2.  
  3. template <class _Tp, bool = is_integral<_Tp>::value>
  4. struct ___is_signed : public integral_constant<bool, _Tp(-1) < _Tp(0)> {};
  5.  
  6. template <class _Tp>
  7. struct ___is_signed<_Tp, false> : public true_type {}; // floating point
  8.  
  9. template <class _Tp, bool = is_arithmetic<_Tp>::value>
  10. struct __is_signed : public ___is_signed<_Tp> {};
  11.  
  12. template <class _Tp> struct __is_signed<_Tp, false> : public false_type {};
  13.  
  14. template <class _Tp> struct is_signed : public __is_signed<_Tp> {};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement