Skip to content

Commit

Permalink
Avoid std::is_unsigned
Browse files Browse the repository at this point in the history
Use of std::is_unsigned and friends caused lots of compile failures in C++11 and above. So much for that idea...
  • Loading branch information
noloader committed Jun 24, 2023
1 parent 3b1cf30 commit f156aeb
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@
#include "stdcpp.h"
#include "trap.h"

#if defined(CRYPTOPP_CXX11)
# include <type_traits>
#endif

#if !defined(CRYPTOPP_DOXYGEN_PROCESSING)

#if (CRYPTOPP_MSC_VERSION)
Expand Down Expand Up @@ -700,11 +696,6 @@ template <class T1, class T2> inline const T1 UnsignedMin(const T1& a, const T2&
{
CRYPTOPP_COMPILE_ASSERT((sizeof(T1)<=sizeof(T2) && T2(-1)>0) || (sizeof(T1)>sizeof(T2) && T1(-1)>0));

#if defined(CRYPTOPP_CXX11)
CRYPTOPP_COMPILE_ASSERT(std::is_unsigned_v<T1> == true);
CRYPTOPP_COMPILE_ASSERT(std::is_unsigned_v<T2> == true);
#endif

if (sizeof(T1)<=sizeof(T2))
return b < (T2)a ? (T1)b : a;
else
Expand Down

0 comments on commit f156aeb

Please sign in to comment.