[Groonga-commit] groonga/grnxx at e8a2187 [master] Fix bugs and a typoe in traits.hpp.

Back to archive index

susumu.yata null+****@clear*****
Wed May 15 13:49:12 JST 2013


susumu.yata	2013-05-15 13:49:12 +0900 (Wed, 15 May 2013)

  New Revision: e8a2187ecb4eedea0c52bbe6d67e460a27b4eb75
  https://github.com/groonga/grnxx/commit/e8a2187ecb4eedea0c52bbe6d67e460a27b4eb75

  Message:
    Fix bugs and a typoe in traits.hpp.

  Modified files:
    lib/grnxx/traits.hpp

  Modified: lib/grnxx/traits.hpp (+4 -5)
===================================================================
--- lib/grnxx/traits.hpp    2013-05-15 13:27:26 +0900 (e7570c2)
+++ lib/grnxx/traits.hpp    2013-05-15 13:49:12 +0900 (f8c5550)
@@ -40,7 +40,7 @@ template <> struct PreferredArgument<GeoPoint> {
 // Check if operator<() is defined or not.
 struct HasLessHelper {
   template <typename T>
-  static auto check(T *p) -> decltype(p->operator<(), std::true_type());
+  static auto check(T *p) -> decltype(p->operator<(*p), std::true_type());
   template <typename T>
   static auto check(T *p) -> decltype(operator<(*p, *p), std::true_type());
   template <typename>
@@ -51,7 +51,7 @@ template <typename T>
 struct HasLess {
   static constexpr bool value() {
     return std::conditional<std::is_scalar<T>::value, std::true_type,
-                            decltype(HasLessHelper::check<T>(0))>::value;
+                            decltype(HasLessHelper::check<T>(0))>::type::value;
   }
 };
 
@@ -66,8 +66,7 @@ struct HasStartsWithHelper {
 template <typename T>
 struct HasStartsWith {
   static constexpr bool value() {
-    return std::conditional<std::is_scalar<T>::value, std::true_type,
-                            decltype(HasStartsWithHelper::check<T>(0))>::value;
+    return decltype(HasStartsWithHelper::check<T>(0))::value;
   }
 };
 
@@ -77,7 +76,7 @@ struct Traits {
   using Type = T;
   using ArgumentType = typename PreferredArgument<T>::Type;
 
-  static constexpr bool hass_less() {
+  static constexpr bool has_less() {
     return HasLess<T>::value();
   }
   static constexpr bool has_starts_with() {
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index