Remove BEAST_NO_ZERO_AUTO_RETURN in Zero.h

This commit is contained in:
Joe Loser
2018-06-06 22:42:40 -04:00
committed by Nik Bougalis
parent 73fb3f0bfa
commit fc3a3d8267

View File

@@ -22,9 +22,6 @@
#include <ripple/beast/core/CompilerConfig.h> #include <ripple/beast/core/CompilerConfig.h>
// VS2013 SP1 fails with decltype return
#define BEAST_NO_ZERO_AUTO_RETURN 1
namespace beast { namespace beast {
/** Zero allows classes to offer efficient comparisons to zero. /** Zero allows classes to offer efficient comparisons to zero.
@@ -55,11 +52,7 @@ static constexpr Zero zero{};
/** Default implementation of signum calls the method on the class. */ /** Default implementation of signum calls the method on the class. */
template <typename T> template <typename T>
#if BEAST_NO_ZERO_AUTO_RETURN auto signum(T const& t)
int signum(T const& t)
#else
auto signum(T const& t) -> decltype(t.signum())
#endif
{ {
return t.signum(); return t.signum();
} }
@@ -70,11 +63,7 @@ namespace zero_helper {
// For argument dependent lookup to function properly, calls to signum must // For argument dependent lookup to function properly, calls to signum must
// be made from a namespace that does not include overloads of the function.. // be made from a namespace that does not include overloads of the function..
template <class T> template <class T>
#if BEAST_NO_ZERO_AUTO_RETURN auto call_signum(T const& t)
int call_signum (T const& t)
#else
auto call_signum(T const& t) -> decltype(t.signum())
#endif
{ {
return signum(t); return signum(t);
} }