Skip to content

Commit

Permalink
Complete cppcoreguidelines adherence (#391)
Browse files Browse the repository at this point in the history
  • Loading branch information
WillAyd authored Nov 15, 2024
1 parent 7919c88 commit 626c117
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/unit-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
ln -s build/compile_commands.json
- name: Run clang-tidy
run: |
clang-tidy src/pantab/writer.cpp
clang-tidy src/pantab/*.*pp --warnings-as-errors='*'
build_wheels:
name: Build wheels on ${{ matrix.os }}
Expand Down
4 changes: 3 additions & 1 deletion src/pantab/numeric_gen.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#pragma once

#include <array>
#include <cstddef>
#include <utility>
#include <variant>
Expand All @@ -10,7 +11,8 @@
template <std::size_t N> constexpr auto to_integral_variant(std::size_t n) {
return [&]<std::size_t... Is>(std::index_sequence<Is...>) {
using ResType = std::variant<std::integral_constant<std::size_t, Is>...>;
ResType all[] = {ResType{std::integral_constant<std::size_t, Is>{}}...};
std::array<ResType, N> all{
ResType{std::integral_constant<std::size_t, Is>{}}...};
return all[n];
}(std::make_index_sequence<N>());
}
Loading

0 comments on commit 626c117

Please sign in to comment.