diff --git a/CMakeLists.txt b/CMakeLists.txt index 1993e5af..e6782273 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_policy(SET CMP0048 NEW) # enable project VERSION cmake_policy(SET CMP0056 NEW) # honor link flags in try_compile() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") -project(immer VERSION 0.6.1) +project(immer VERSION 0.6.2) if (NOT MSVC) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic -Wno-unused-parameter -Wno-extended-offsetof -Wno-c++17-extensions -Wno-c++1z-extensions -Wno-unknown-warning-option") diff --git a/immer/array.hpp b/immer/array.hpp index 43954bb8..d9e458e3 100644 --- a/immer/array.hpp +++ b/immer/array.hpp @@ -132,7 +132,7 @@ class array * Returns `true` if there are no elements in the container. It * does not allocate memory and its complexity is @f$ O(1) @f$. */ - IMMER_NODISCARD bool empty() const { return impl_.d->empty(); } + IMMER_NODISCARD bool empty() const { return impl_.size == 0; } /*! * Access the raw data. diff --git a/test/vector/generic.ipp b/test/vector/generic.ipp index ee6edde1..c1f94a66 100644 --- a/test/vector/generic.ipp +++ b/test/vector/generic.ipp @@ -55,12 +55,14 @@ TEST_CASE("instantiation") { auto v = VECTOR_T{}; CHECK(v.size() == 0u); + CHECK(v.empty()); } SECTION("initializer list") { auto v = VECTOR_T{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; CHECK_VECTOR_EQUALS(v, boost::irange(0u, 10u)); + CHECK(!v.empty()); } SECTION("big object")