[Groonga-commit] groonga/grnxx at 81c9f20 [new_data_types] Add is_empty() to Array.

アーカイブの一覧に戻る

susumu.yata null+****@clear*****
Wed Nov 5 20:28:46 JST 2014


susumu.yata	2014-11-05 20:28:46 +0900 (Wed, 05 Nov 2014)

  New Revision: 81c9f20184e035f6e012adff9ec089c04d1441cb
  https://github.com/groonga/grnxx/commit/81c9f20184e035f6e012adff9ec089c04d1441cb

  Message:
    Add is_empty() to Array.

  Modified files:
    include/grnxx/array.hpp

  Modified: include/grnxx/array.hpp (+12 -0)
===================================================================
--- include/grnxx/array.hpp    2014-11-05 17:35:04 +0900 (69d4cd1)
+++ include/grnxx/array.hpp    2014-11-05 20:28:46 +0900 (e6b42f2)
@@ -40,6 +40,10 @@ class ArrayCRef {
     return values_[i];
   }
 
+  // Return whether the array is empty or not.
+  bool is_empty() const {
+    return size_ == 0;
+  }
   // Return the number of values.
   size_t size() const {
     return size_;
@@ -109,6 +113,10 @@ class ArrayRef {
     return values_[i];
   }
 
+  // Return whether the array is empty or not.
+  bool is_empty() const {
+    return size_ == 0;
+  }
   // Return the number of values.
   size_t size() const {
     return size_;
@@ -225,6 +233,10 @@ class Array {
     return static_cast<const Value *>(buffer_);
   }
 
+  // Return whether the array is empty or not.
+  bool is_empty() const {
+    return size_ == 0;
+  }
   // Return the number of values.
   size_t size() const {
     return size_;
-------------- next part --------------
HTML����������������������������...
ダウンロード 



More information about the Groonga-commit mailing list
アーカイブの一覧に戻る