Skip to content

Commit

Permalink
Fixed unused variable warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamshapiro0 committed May 7, 2021
1 parent 216907a commit dcc4a7c
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions include/frozen/bits/basic_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -163,12 +163,15 @@ class cvector<T, 0> {
constexpr cvector(size_type count, const T& value)
{
// static_assert(count == 0, "Cannot initialize empty cvector");
(void)count;
(void)value;
}

template <std::size_t M>
constexpr cvector(T const (&init)[M])
{
static_assert(M == 0, "Cannot initialize empty cvector");
(void)init;
}

constexpr cvector(std::initializer_list<T> init)
Expand Down Expand Up @@ -209,13 +212,13 @@ class cvector<T, 0> {
constexpr const value_type* data() const noexcept { return nullptr; }

// Modifiers
constexpr void push_back(const T & a) {}
constexpr void push_back(T && a) {}
constexpr void push_back(const T & a) { (void)a; }
constexpr void push_back(T && a) { (void)a; }
constexpr void pop_back() {}

constexpr void clear() {}

constexpr void fill(const value_type& val) {}
constexpr void fill(const value_type& val) { (void)val; }
};

template <class T, std::size_t N>
Expand Down Expand Up @@ -338,18 +341,22 @@ class carray<T, 0> {
constexpr carray(size_type count, const T& value)
{
// static_assert(count == 0, "Cannot initialize empty carray");
(void)count;
(void)value;
}

template <std::size_t M>
constexpr carray(T const (&init)[M])
{
static_assert(M == 0, "Cannot initialize empty carray");
(void)init;
}

template <std::size_t M>
constexpr carray(std::array<T, M> const &init)
{
static_assert(M == 0, "Cannot initialize empty carray");
(void)init;
}

constexpr carray(std::initializer_list<T> init)
Expand Down Expand Up @@ -389,7 +396,7 @@ class carray<T, 0> {
constexpr const value_type* data() const noexcept { return nullptr; }

// Modifiers
constexpr void fill(const value_type& val) {}
constexpr void fill(const value_type& val) { (void)val; }

};

Expand Down

0 comments on commit dcc4a7c

Please sign in to comment.