Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/performance_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:
DEBIAN_FRONTEND: noninteractive
CMAKE_GENERATOR: Ninja
BUILD_TYPE: Release
LLVM_VERSION: 18
LLVM_VERSION: 19

jobs:
performance_test:
Expand Down
19 changes: 15 additions & 4 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ env:
DEBIAN_FRONTEND: noninteractive
CMAKE_GENERATOR: Ninja
DEFAULT_CXX_STANDARD: 20
DEFAULT_LLVM_VERSION: 18
DEFAULT_LLVM_VERSION: 19
DEFAULT_GCC_VERSION: 13

concurrency:
Expand All @@ -27,7 +27,7 @@ jobs:
fail-fast: false
matrix:
compiler: [clang, gcc]
version: [12, 13, 16, 17, 18]
version: [12, 13, 16, 17, 18, 19]
cxx_standard: [20]
stdlib: [libstdc++, libc++]
build_type: [Debug]
Expand All @@ -36,6 +36,15 @@ jobs:
cc: "clang"
cxx: "clang++"
cxx_flags: "-stdlib=libstdc++"
- version: 19
compiler: clang
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19
toolchain_root: "/usr/lib/llvm-19"
- version: 19
compiler: clang
stdlib: libc++
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19 && sudo apt install -y libc++-19-dev libc++abi-19-dev
cxx_flags: "-stdlib=libc++"
- version: 18
compiler: clang
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18
Expand Down Expand Up @@ -78,6 +87,8 @@ jobs:
cxx: "g++-12"
cxx_flags: ""
exclude:
- compiler: gcc
version: 19
- compiler: gcc
version: 18
- compiler: gcc
Expand Down Expand Up @@ -282,8 +293,8 @@ jobs:
- compiler: clang
cc: "clang"
cxx: "clang++"
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 18
toolchain_root: "/usr/lib/llvm-18"
install: wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && sudo ./llvm.sh 19
toolchain_root: "/usr/lib/llvm-19"
- compiler: gcc
cc: "gcc-13"
cxx: "g++-13"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ to implement *cib* and others extend *cib*.
## Compiler/Standard support

The main branch of *cib* currently uses C++20 and is tested with:
- Clang 14 thru 18
- Clang 14 thru 19
- GCC 12 thru 13

An older version of *cib* that uses C++17 is tagged at v1.7.0. It
Expand Down
8 changes: 4 additions & 4 deletions include/cib/detail/exports.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ template <typename ServiceT, typename BuilderT> struct service_entry {
};

template <typename... Services> struct exports : public detail::config_item {
[[nodiscard]] constexpr auto
extends_tuple() const -> stdx::tuple<extend<Services>...> {
[[nodiscard]] constexpr auto extends_tuple() const
-> stdx::tuple<extend<Services>...> {
return {extend<Services>{}...};
}

[[nodiscard]] constexpr auto
exports_tuple() const -> stdx::tuple<Services...> {
[[nodiscard]] constexpr auto exports_tuple() const
-> stdx::tuple<Services...> {
return {};
}
};
Expand Down
8 changes: 4 additions & 4 deletions include/flow/graph_builder.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ concept is_output_compatible = requires(CTNode n) {

template <typename T> using name_for = typename T::name_t;

[[nodiscard]] constexpr auto edge_size(auto const &nodes,
auto const &edges) -> std::size_t {
[[nodiscard]] constexpr auto edge_size(auto const &nodes, auto const &edges)
-> std::size_t {
auto const edge_capacities = transform(
[&]<typename N>(N const &) {
return edges.fold_left(
Expand Down Expand Up @@ -134,8 +134,8 @@ struct graph_builder {
}

template <typename Output, typename Graph>
[[nodiscard]] constexpr static auto
topo_sort(Graph &g) -> std::optional<Output> {
[[nodiscard]] constexpr static auto topo_sort(Graph &g)
-> std::optional<Output> {
stdx::cx_vector<typename Graph::key_type, Graph::capacity()>
ordered_list{};

Expand Down
2 changes: 1 addition & 1 deletion include/log/env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ template <std::size_t... Is> struct for_each_pair<std::index_sequence<Is...>> {
prop<boost::mp11::mp_at_c<boost::mp11::mp_list<wrap<Args>...>,
2 * Is>::value.value,
stdx::ct<boost::mp11::mp_at_c<boost::mp11::mp_list<wrap<Args>...>,
2 * Is + 1>::value.value>()>...>;
(2 * Is) + 1>::value.value>()>...>;
};
} // namespace detail

Expand Down
8 changes: 4 additions & 4 deletions include/lookup/detail/select.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ constexpr inline auto fallback_select_lt(K lhs, K rhs, T first, T second) -> T {
#if defined(__arc__) or defined(_ARC) or defined(_ARCOMPACT)
template <typename K, typename T>
requires(sizeof(T) <= 4) and (sizeof(K) <= 4)
static inline auto optimized_select(K raw_lhs, K raw_rhs, T first,
T second) -> T {
static inline auto optimized_select(K raw_lhs, K raw_rhs, T first, T second)
-> T {
T result = second;
auto const lhs = static_cast<std::uint32_t>(raw_lhs);
auto const rhs = static_cast<std::uint32_t>(raw_rhs);
Expand All @@ -45,8 +45,8 @@ static inline auto optimized_select(K raw_lhs, K raw_rhs, T first,

template <typename K, typename T>
requires(sizeof(T) <= 4) and (sizeof(K) <= 4)
static inline auto optimized_select_lt(K raw_lhs, K raw_rhs, T first,
T second) -> T {
static inline auto optimized_select_lt(K raw_lhs, K raw_rhs, T first, T second)
-> T {
T result = second;
auto const lhs = static_cast<std::uint32_t>(raw_lhs);
auto const rhs = static_cast<std::uint32_t>(raw_rhs);
Expand Down
4 changes: 2 additions & 2 deletions include/lookup/linear_search_lookup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ template <std::size_t MaxSize> struct linear_search_lookup {
using key_type = typename Input::key_type;
using value_type = typename Input::value_type;

[[nodiscard]] constexpr auto
operator[](key_type key) const -> value_type {
[[nodiscard]] constexpr auto operator[](key_type key) const
-> value_type {
value_type result = this->default_value;
for (auto [k, v] : this->entries) {
result = detail::select(key, k, v, result);
Expand Down
18 changes: 9 additions & 9 deletions include/lookup/pseudo_pext_lookup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,8 @@ constexpr auto keys_are_unique(std::array<T, S> const &keys) -> bool {
}

template <typename T, std::size_t S>
constexpr auto with_mask(T const mask,
std::array<T, S> const &keys) -> std::array<T, S> {
constexpr auto with_mask(T const mask, std::array<T, S> const &keys)
-> std::array<T, S> {
std::array<T, S> new_keys{};

std::transform(keys.begin(), keys.end(), new_keys.begin(),
Expand All @@ -182,9 +182,9 @@ constexpr auto get_keys(std::array<entry<T, V>, S> const &entries) {
}

template <typename T, std::size_t S>
constexpr auto
remove_cheapest_bit(detail::raw_integral_t<T> mask,
std::array<T, S> keys) -> detail::raw_integral_t<T> {
constexpr auto remove_cheapest_bit(detail::raw_integral_t<T> mask,
std::array<T, S> keys)
-> detail::raw_integral_t<T> {
using raw_t = detail::raw_integral_t<T>;

auto const t_digits = std::numeric_limits<raw_t>::digits;
Expand Down Expand Up @@ -287,8 +287,8 @@ struct pseudo_pext_lookup {
constexpr static Value default_value = Default::value;
Storage storage;

[[nodiscard]] constexpr auto
operator[](key_type key) const -> value_type {
[[nodiscard]] constexpr auto operator[](key_type key) const
-> value_type {
auto const raw_key = detail::as_raw_integral(key);
auto const e = storage[pext_func(raw_key)];

Expand Down Expand Up @@ -326,8 +326,8 @@ struct pseudo_pext_lookup {
LookupTable lookup_table;
Storage storage;

[[nodiscard]] constexpr auto
operator[](key_type key) const -> value_type {
[[nodiscard]] constexpr auto operator[](key_type key) const
-> value_type {
auto const raw_key = detail::as_raw_integral(key);
auto i = lookup_table[pext_func(raw_key)];

Expand Down
4 changes: 2 additions & 2 deletions include/lookup/strategies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ namespace lookup {
template <typename...> struct strategies;

template <> struct strategies<> {
[[nodiscard]] CONSTEVAL static auto
make(compile_time auto) -> strategy_failed_t {
[[nodiscard]] CONSTEVAL static auto make(compile_time auto)
-> strategy_failed_t {
return {};
}
};
Expand Down
9 changes: 5 additions & 4 deletions include/match/and.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,9 @@ template <matcher L, matcher R> struct and_t : bin_op_t<and_t, " and ", L, R> {
}
}

[[nodiscard]] friend constexpr auto
tag_invoke(cost_t, std::type_identity<and_t>) -> std::size_t {
[[nodiscard]] friend constexpr auto tag_invoke(cost_t,
std::type_identity<and_t>)
-> std::size_t {
return cost(std::type_identity<L>{}) + cost(std::type_identity<R>{}) +
1u;
}
Expand Down Expand Up @@ -72,8 +73,8 @@ template <matcher L, matcher R> struct and_t : bin_op_t<and_t, " and ", L, R> {
template <matcher L, matcher R> and_t(L, R) -> and_t<L, R>;

template <match::matcher L, match::matcher R>
[[nodiscard]] constexpr auto operator&(L const &lhs,
R const &rhs) -> match::and_t<L, R> {
[[nodiscard]] constexpr auto operator&(L const &lhs, R const &rhs)
-> match::and_t<L, R> {
return {lhs, rhs};
}

Expand Down
12 changes: 6 additions & 6 deletions include/match/constant.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ struct always_t {
}

private:
[[nodiscard]] friend constexpr auto tag_invoke(implies_t, auto &&,
always_t) -> bool {
[[nodiscard]] friend constexpr auto tag_invoke(implies_t, auto &&, always_t)
-> bool {
return true;
}
};
Expand All @@ -41,13 +41,13 @@ struct never_t {
}

private:
[[nodiscard]] friend constexpr auto tag_invoke(negate_t,
never_t) -> always_t {
[[nodiscard]] friend constexpr auto tag_invoke(negate_t, never_t)
-> always_t {
return {};
}

[[nodiscard]] friend constexpr auto tag_invoke(implies_t, never_t,
auto &&) -> bool {
[[nodiscard]] friend constexpr auto tag_invoke(implies_t, never_t, auto &&)
-> bool {
return true;
}
};
Expand Down
4 changes: 2 additions & 2 deletions include/match/cost.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

namespace match {
constexpr inline class cost_t {
[[nodiscard]] friend constexpr auto
tag_invoke(cost_t, auto const &) -> std::size_t {
[[nodiscard]] friend constexpr auto tag_invoke(cost_t, auto const &)
-> std::size_t {
return 1u;
}

Expand Down
4 changes: 2 additions & 2 deletions include/match/negate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ template <matcher> struct not_t;

constexpr inline class negate_t {
template <matcher M>
[[nodiscard]] friend constexpr auto tag_invoke(negate_t,
M const &m) -> not_t<M> {
[[nodiscard]] friend constexpr auto tag_invoke(negate_t, M const &m)
-> not_t<M> {
return {m};
}

Expand Down
9 changes: 5 additions & 4 deletions include/match/not.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,14 @@ template <matcher M> struct not_t {
}
}

[[nodiscard]] friend constexpr auto
tag_invoke(cost_t, std::type_identity<not_t>) -> std::size_t {
[[nodiscard]] friend constexpr auto tag_invoke(cost_t,
std::type_identity<not_t>)
-> std::size_t {
return cost(std::type_identity<M>{}) + 1u;
}

[[nodiscard]] friend constexpr auto tag_invoke(negate_t,
not_t const &n) -> M {
[[nodiscard]] friend constexpr auto tag_invoke(negate_t, not_t const &n)
-> M {
return n.m;
}

Expand Down
4 changes: 2 additions & 2 deletions include/match/ops.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ template <match::matcher M>
}

template <match::matcher L, match::matcher R>
[[nodiscard]] constexpr auto
operator<=>(L const &lhs, R const &rhs) -> std::partial_ordering {
[[nodiscard]] constexpr auto operator<=>(L const &lhs, R const &rhs)
-> std::partial_ordering {
auto const l = match::simplify(lhs);
auto const r = match::simplify(rhs);
auto const x = match::implies(l, r);
Expand Down
9 changes: 5 additions & 4 deletions include/match/or.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ template <matcher L, matcher R> struct or_t : bin_op_t<or_t, " or ", L, R> {
}
}

[[nodiscard]] friend constexpr auto
tag_invoke(cost_t, std::type_identity<or_t>) -> std::size_t {
[[nodiscard]] friend constexpr auto tag_invoke(cost_t,
std::type_identity<or_t>)
-> std::size_t {
return cost(std::type_identity<L>{}) + cost(std::type_identity<R>{}) +
1u;
}
Expand All @@ -59,8 +60,8 @@ template <matcher L, matcher R> struct or_t : bin_op_t<or_t, " or ", L, R> {
template <matcher L, matcher R> or_t(L, R) -> or_t<L, R>;

template <match::matcher L, match::matcher R>
[[nodiscard]] constexpr auto operator|(L const &lhs,
R const &rhs) -> match::or_t<L, R> {
[[nodiscard]] constexpr auto operator|(L const &lhs, R const &rhs)
-> match::or_t<L, R> {
return {lhs, rhs};
}

Expand Down
4 changes: 2 additions & 2 deletions include/match/predicate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ template <stdx::ct_string Name, stdx::callable P> struct predicate_t {
constexpr predicate_t() = default;
constexpr explicit(true) predicate_t(P) {}

[[nodiscard]] constexpr auto
operator()(auto const &event) const -> decltype(pred(event)) {
[[nodiscard]] constexpr auto operator()(auto const &event) const
-> decltype(pred(event)) {
return pred(event);
}

Expand Down
4 changes: 2 additions & 2 deletions include/match/simplify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
namespace match {
constexpr inline class simplify_t {
template <matcher M>
[[nodiscard]] friend constexpr auto tag_invoke(simplify_t,
M const &m) -> M {
[[nodiscard]] friend constexpr auto tag_invoke(simplify_t, M const &m)
-> M {
return m;
}

Expand Down
4 changes: 2 additions & 2 deletions include/msg/detail/indexed_builder_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ struct indexed_builder_base {
ExtraCallbackArgs...>{new_callbacks};
}

using callback_func_t = auto (*)(MsgBase const &,
ExtraCallbackArgs... args) -> bool;
using callback_func_t = auto (*)(MsgBase const &, ExtraCallbackArgs... args)
-> bool;

template <typename BuilderValue, std::size_t I>
constexpr static auto invoke_callback(MsgBase const &data,
Expand Down
5 changes: 3 additions & 2 deletions include/msg/detail/indexed_handler_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ struct indexed_handler : handler_interface<MsgBase, ExtraCallbackArgs...> {
return not index(msg).none();
}

__attribute__((flatten)) auto
handle(MsgBase const &msg, ExtraCallbackArgs... args) const -> bool final {
__attribute__((flatten)) auto handle(MsgBase const &msg,
ExtraCallbackArgs... args) const
-> bool final {
auto const callback_candidates = index(msg);

bool const handled = transform_reduce(
Expand Down
Loading
Loading