[Groonga-commit] groonga/grnxx [master] Use std::numeric_limits.

Back to archive index

susumu.yata null+****@clear*****
Thu Feb 14 10:45:01 JST 2013


susumu.yata	2013-02-14 10:45:01 +0900 (Thu, 14 Feb 2013)

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

  Log:
    Use std::numeric_limits.

  Modified files:
    lib/duration.hpp
    lib/time.hpp

  Modified: lib/duration.hpp (+2 -4)
===================================================================
--- lib/duration.hpp    2013-02-14 10:40:42 +0900 (c88f03d)
+++ lib/duration.hpp    2013-02-14 10:45:01 +0900 (d13b690)
@@ -64,12 +64,10 @@ class Duration {
   StringBuilder &write_to(StringBuilder &builder) const;
 
   static constexpr Duration max() {
-    // TODO: This should use std::numeric_limits<T>::max().
-    return Duration(static_cast<int64_t>((uint64_t(1) << 63) - 1));
+    return Duration(std::numeric_limits<int64_t>::max());
   }
   static constexpr Duration min() {
-    // TODO: This should use std::numeric_limits<T>::min().
-    return Duration(static_cast<int64_t>(uint64_t(1) << 63));
+    return Duration(std::numeric_limits<int64_t>::min());
   }
 
  private:

  Modified: lib/time.hpp (+2 -4)
===================================================================
--- lib/time.hpp    2013-02-14 10:40:42 +0900 (ca25bfe)
+++ lib/time.hpp    2013-02-14 10:45:01 +0900 (45faf2e)
@@ -41,12 +41,10 @@ class Time {
   StringBuilder &write_to(StringBuilder &builder) const;
 
   static constexpr Time max() {
-    // TODO: This should use std::numeric_limits<T>::max().
-    return Time(static_cast<int64_t>((uint64_t(1) << 63) - 1));
+    return Time(std::numeric_limits<int64_t>::max());
   }
   static constexpr Time min() {
-    // TODO: This should use std::numeric_limits<T>::min().
-    return Time(static_cast<int64_t>(uint64_t(1) << 63));
+    return Time(std::numeric_limits<int64_t>::min());
   }
 
  private:
-------------- next part --------------
HTML����������������������������...
Download 



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