Skip to content

Commit

Permalink
[messaging] remove concept requirement for emplace_back as it was cau…
Browse files Browse the repository at this point in the history
…sing an annoying clang compiler crash. i dont highly value the concept anyway.
  • Loading branch information
harrand committed Mar 22, 2024
1 parent 6f79a5d commit 5558e28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions src/tz/core/data/free_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,8 +176,7 @@ namespace tz
* θ(1)
*/
template<typename... Ts>
handle emplace_back(Ts&&... ts) requires
requires(C con) {{con.emplace_back(std::forward<Ts>(ts)...)} -> std::same_as<T&>;};
handle emplace_back(Ts&&... ts);

/**
* Erase an existing element from the list using its handle.
Expand Down
4 changes: 1 addition & 3 deletions src/tz/core/data/free_list.inl
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,7 @@ namespace tz

template<tz::nullable T, tz::random_access_container C>
template<typename... Ts>
free_list<T, C>::handle free_list<T, C>::emplace_back(Ts&&... ts) requires
requires(C con) {{con.emplace_back(std::forward<Ts>(ts)...)} -> std::same_as<T&>;}
// implementation note: i dont think the `requires` clause needs to be here. i am only re-defining it coz of a clang bug. https://github.com/llvm/llvm-project/issues/56482
free_list<T, C>::handle free_list<T, C>::emplace_back(Ts&&... ts)
{
handle ret;
if(this->frees.size())
Expand Down
1 change: 1 addition & 0 deletions src/tz/core/messaging.inl
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "tz/core/debug.hpp"
namespace tz
{
template<tz::message M, bool thread_safe>
Expand Down

0 comments on commit 5558e28

Please sign in to comment.