summaryrefslogtreecommitdiffstats
path: root/src/lib/cc/data.cc
diff options
context:
space:
mode:
authorKean Johnston <kean@isc.org>2013-10-10 14:59:55 +0200
committerKean Johnston <kean@isc.org>2013-10-10 14:59:55 +0200
commit2d83a3a525c255b565aa57e3bd5efce5ca38a269 (patch)
treec28df1f47fa53920ecf387330e5f954377834713 /src/lib/cc/data.cc
parent[master] Merge branch 'trac3152': PD support in solicit/request (diff)
downloadkea-2d83a3a525c255b565aa57e3bd5efce5ca38a269.tar.xz
kea-2d83a3a525c255b565aa57e3bd5efce5ca38a269.zip
[3073] Add empty() member function to Element for element lists.
It has been asserted that using empty() is more efficient than using size() > 0 due to the possible extra work size() has to do. So provide an empty() function, which matches the underlying Boost implementation.
Diffstat (limited to 'src/lib/cc/data.cc')
-rw-r--r--src/lib/cc/data.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lib/cc/data.cc b/src/lib/cc/data.cc
index 35189392ea..5f87d7c478 100644
--- a/src/lib/cc/data.cc
+++ b/src/lib/cc/data.cc
@@ -145,6 +145,11 @@ Element::size() const {
isc_throw(TypeError, "size() called on a non-list Element");
}
+bool
+Element::empty() const {
+ isc_throw(TypeError, "empty() called on a non-list Element");
+}
+
ConstElementPtr
Element::get(const std::string&) const {
isc_throw(TypeError, "get(string) called on a non-map Element");