Skip to content

Commit 84ba4b5

Browse files
committed
Fix MacOS compilation
1 parent 1f33ecf commit 84ba4b5

File tree

2 files changed

+9
-10
lines changed

2 files changed

+9
-10
lines changed

src/include/sndx/collision/volume.hpp

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ namespace sndx {
77
template <class T>
88
concept Vector = requires(const T& vector) {
99
{ T::length() } -> std::convertible_to<size_t>;
10-
T::length() > 0;
11-
1210
{ vector[0] } -> std::convertible_to<float>;
13-
};
11+
} && T::length() > 0;
1412

1513
template <class T, size_t n>
1614
concept VectorN = Vector<T> && requires() {
@@ -20,17 +18,14 @@ namespace sndx {
2018
template <class T>
2119
concept Volume = requires(const T& t) {
2220
{ T::dimensionality() } -> std::convertible_to<size_t>;
23-
T::dimensionality() > 0;
24-
2521
{ t.getSize() } -> VectorN<T::dimensionality()>;
2622
{ t.getCenter() } -> VectorN<T::dimensionality()>;
2723
{ t.getArea() } -> std::convertible_to<float>;
2824
{ t.contains(t.getCenter()) } -> std::convertible_to<bool>;
2925
{ t.distance(t.getCenter()) } -> std::convertible_to<float>;
30-
};
26+
} && T::dimensionality() > 0;
3127

3228
template <class T, size_t n>
33-
concept VolumeN = Volume<T> && requires() {
34-
T::dimensionality() == n;
35-
};
29+
concept VolumeN = Volume<T> &&
30+
(T::dimensionality() == n);
3631
}

src/include/sndx/container/weighted_vector.hpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ namespace sndx::container {
1919

2020
DataT data;
2121

22+
template<class... Ts>
23+
Entry(index_type to, Ts&&... data) :
24+
to(to), data(std::forward<Ts>(data)...) {}
25+
2226
static bool comp(const IndexT& index, const Entry& entry) {
2327
return index < entry.to;
2428
}
@@ -38,7 +42,7 @@ namespace sndx::container {
3842
}
3943

4044
last += weight;
41-
return entries.emplace_back(last, std::forward<Ts...>(data...));
45+
return entries.emplace_back(last, std::forward<Ts>(data)...);
4246
}
4347

4448
decltype(auto) push_back(const IndexT& weight, const DataT& data) {

0 commit comments

Comments
 (0)