Skip to content

Commit

Permalink
Merge pull request #8 from beman-project/PT/further-build-fixes
Browse files Browse the repository at this point in the history
Fix more build issues
  • Loading branch information
camio authored Sep 26, 2024
2 parents ccb04f0 + 191b452 commit babcb18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
BasedOnStyle: LLVM
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

cmake_minimum_required(VERSION 3.23)

option(BUILD_TESTING "Build tests" ON)

project(
beman.inplace_vector
VERSION 1.0.0
Expand Down
6 changes: 4 additions & 2 deletions include/beman/inplace_vector/inplace_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
#include <cassert>
#include <compare>
#include <concepts>
#include <exception>
#include <iterator>
#include <limits>
#include <memory>
#include <new>
#include <ranges>
#include <stdexcept>
#include <type_traits>

namespace beman::inplace_vector {
Expand Down Expand Up @@ -239,7 +241,6 @@ class inplace_vector : public inplace_vector_base<T, Capacity> {

constexpr inplace_vector(const std::size_t size, const T &value)
: base(size) {

base::uninitialized_fill(this->begin(), this->end(), value);
}

Expand Down Expand Up @@ -341,7 +342,8 @@ class inplace_vector : public inplace_vector_base<T, Capacity> {
}; // freestanding-deleted
constexpr void assign(size_type n, const T &u) {
if (Capacity == 0) {
assert(size() == 0 && "Cannot assign to inplace_vector with zero capacity");
assert(size() == 0 &&
"Cannot assign to inplace_vector with zero capacity");
return;
}
const auto diff = static_cast<std::ptrdiff_t>(n - this->size());
Expand Down

0 comments on commit babcb18

Please sign in to comment.