From 7c05fdfa4e8531de0224049f68b36dfce1238cd6 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 21 Jul 2011 17:00:33 +0000 Subject: [PATCH] Core: empty() method for STL compatibility for containers git-svn-id: svn://ultimatepp.org/upp/trunk@3687 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/Core/Topt.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/uppsrc/Core/Topt.h b/uppsrc/Core/Topt.h index eda7cda4c..975001443 100644 --- a/uppsrc/Core/Topt.h +++ b/uppsrc/Core/Topt.h @@ -424,6 +424,7 @@ template inline const T& ntl_max(const T& a, const T& b) { return a > const_iterator end() const { return B::End(); } \ void clear() { B::Clear(); } \ size_type size() { return B::GetCount(); } \ + bool empty() const { return B::IsEmpty(); } \ #define STL_BI_COMPATIBILITY(C) \ typedef T value_type; \ @@ -437,6 +438,7 @@ template inline const T& ntl_max(const T& a, const T& b) { return a > size_type size() { return GetCount(); } \ typedef Iterator iterator; \ typedef T& reference; \ + bool empty() const { return IsEmpty(); } \ iterator begin() { return Begin(); } \ iterator end() { return End(); } \ @@ -452,6 +454,7 @@ template inline const T& ntl_max(const T& a, const T& b) { return a > size_type size() { return B::GetCount(); } \ typedef Iterator iterator; \ typedef T& reference; \ + bool empty() const { return B::IsEmpty(); } \ iterator begin() { return B::Begin(); } \ iterator end() { return B::End(); } \ @@ -473,5 +476,7 @@ template inline const T& ntl_max(const T& a, const T& b) { return a > const_reference front() const { return (*this)[0]; } \ reference back() { return Top(); } \ const_reference back() const { return Top(); } \ + bool empty() const { return IsEmpty(); } \ void push_back(const T& x) { Add(x); } \ - void pop_back() { Drop(); } + void pop_back() { Drop(); } \ +