Skip to content

Commit

Permalink
Replace std::span with ttg::span
Browse files Browse the repository at this point in the history
Signed-off-by: Joseph Schuchart <[email protected]>
  • Loading branch information
devreal committed Jun 4, 2024
1 parent be7ff9b commit 5d02164
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
1 change: 1 addition & 0 deletions ttg/ttg.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include "ttg/util/print.h"
#include "ttg/world.h"

#include "ttg/constraint.h"
#include "ttg/edge.h"

#include "ttg/ptr.h"
Expand Down
10 changes: 6 additions & 4 deletions ttg/ttg/constraint.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
#include <mutex>
#include <map>

#include "ttg/util/span.h"

#ifdef TTG_USE_BUNDLED_BOOST_CALLABLE_TRAITS
#include <ttg/external/boost/callable_traits.hpp>
#else
Expand All @@ -18,7 +20,7 @@ namespace ttg {
template<typename Key>
struct ConstraintBase {
using key_type = Key;
using listener_t = std::function<void(const std::span<key_type>&)>;
using listener_t = std::function<void(const ttg::span<key_type>&)>;

ConstraintBase()
{ }
Expand All @@ -45,7 +47,7 @@ namespace ttg {
m_listeners.insert_or_assign(tt, std::move(l));
}

void notify_listener(const std::span<key_type>& keys, ttg::TTBase* tt) {
void notify_listener(const ttg::span<key_type>& keys, ttg::TTBase* tt) {
auto& release = m_listeners[tt];
release(keys);
}
Expand Down Expand Up @@ -162,7 +164,7 @@ namespace ttg {
for (auto& seq : elem.m_keys) {
// account for the newly active keys
this->m_active.fetch_add(seq.second.size(), std::memory_order_relaxed);
this->notify_listener(std::span<key_type>(seq.second.data(), seq.second.size()), seq.first);
this->notify_listener(ttg::span<key_type>(seq.second.data(), seq.second.size()), seq.first);
}
}

Expand Down Expand Up @@ -195,7 +197,7 @@ namespace ttg {
for (auto& elem : seqs) {
for (auto& e : elem.m_keys) {
// account for the newly active keys
this->notify_listener(std::span<key_type>(e.second.data(), e.second.size()), e.first);
this->notify_listener(ttg::span<key_type>(e.second.data(), e.second.size()), e.first);
}
}
}
Expand Down

0 comments on commit 5d02164

Please sign in to comment.