X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FTraits.h;h=caeb852c3b6f3d85949398331b3a00be9a5bb9e2;hb=bc857f03fc85a34e84ae8fcdf2d910259940f711;hp=0a291024baf55b48421e579dc0633f6559f9b01b;hpb=89282758b5c8c2c12f8786f070876a3af6547bdd;p=folly.git diff --git a/folly/Traits.h b/folly/Traits.h index 0a291024..caeb852c 100644 --- a/folly/Traits.h +++ b/folly/Traits.h @@ -240,8 +240,10 @@ FOLLY_NAMESPACE_STD_BEGIN template struct pair; #ifndef _GLIBCXX_USE_FB +FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN template class basic_string; +FOLLY_GLIBCXX_NAMESPACE_CXX11_END #else template class basic_string; @@ -250,8 +252,10 @@ template class vector; template class deque; +FOLLY_GLIBCXX_NAMESPACE_CXX11_BEGIN template class list; +FOLLY_GLIBCXX_NAMESPACE_CXX11_END template class set; template @@ -320,67 +324,21 @@ struct is_negative_impl { #pragma GCC diagnostic ignored "-Wsign-compare" template -bool less_than_impl( - typename std::enable_if< - (rhs <= std::numeric_limits::max() - && rhs > std::numeric_limits::min()), - LHS - >::type const lhs -) { - return lhs < rhs; -} - -template -bool less_than_impl( - typename std::enable_if< - (rhs > std::numeric_limits::max()), - LHS - >::type const -) { - return true; -} - -template -bool less_than_impl( - typename std::enable_if< - (rhs <= std::numeric_limits::min()), - LHS - >::type const -) { - return false; +bool less_than_impl(LHS const lhs) { + return + rhs > std::numeric_limits::max() ? true : + rhs <= std::numeric_limits::min() ? false : + lhs < rhs; } #pragma GCC diagnostic pop template -bool greater_than_impl( - typename std::enable_if< - (rhs <= std::numeric_limits::max() - && rhs >= std::numeric_limits::min()), - LHS - >::type const lhs -) { - return lhs > rhs; -} - -template -bool greater_than_impl( - typename std::enable_if< - (rhs > std::numeric_limits::max()), - LHS - >::type const -) { - return false; -} - -template -bool greater_than_impl( - typename std::enable_if< - (rhs < std::numeric_limits::min()), - LHS - >::type const -) { - return true; +bool greater_than_impl(LHS const lhs) { + return + rhs > std::numeric_limits::max() ? false : + rhs < std::numeric_limits::min() ? true : + lhs > rhs; } } // namespace detail {