Skip to content

Commit

Permalink
Merge pull request #84 from arximboldi/fix-array-empty
Browse files Browse the repository at this point in the history
Fix array empty
  • Loading branch information
arximboldi authored Jun 5, 2019
2 parents 2e421ee + dad135d commit 609d195
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
2 changes: 1 addition & 1 deletion immer/array.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions test/vector/generic.ipp
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,14 @@ TEST_CASE("instantiation")
{
auto v = VECTOR_T<int>{};
CHECK(v.size() == 0u);
CHECK(v.empty());
}

SECTION("initializer list")
{
auto v = VECTOR_T<unsigned>{0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
CHECK_VECTOR_EQUALS(v, boost::irange(0u, 10u));
CHECK(!v.empty());
}

SECTION("big object")
Expand Down

0 comments on commit 609d195

Please sign in to comment.