Skip to content

Commit 2784f30

Browse files
authored
Merge pull request #1252 from aprokop/add_missing_deduction_guides
2 parents 954e511 + 892b8a3 commit 2784f30

File tree

2 files changed

+29
-2
lines changed

2 files changed

+29
-2
lines changed

src/geometry/ArborX_Tetrahedron.hpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,14 @@ struct Tetrahedron
3030
};
3131

3232
template <class Coordinate>
33-
Tetrahedron(Point<3, Coordinate>, Point<3, Coordinate>, Point<3, Coordinate>,
34-
Point<3, Coordinate>) -> Tetrahedron<Coordinate>;
33+
KOKKOS_DEDUCTION_GUIDE Tetrahedron(Point<3, Coordinate>, Point<3, Coordinate>,
34+
Point<3, Coordinate>, Point<3, Coordinate>)
35+
-> Tetrahedron<Coordinate>;
36+
37+
template <typename T>
38+
KOKKOS_DEDUCTION_GUIDE Tetrahedron(T const (&)[3], T const (&)[3],
39+
T const (&)[3], T const (&)[3])
40+
-> Tetrahedron<T>;
3541

3642
} // namespace ArborX::ExperimentalHyperGeometry
3743

test/tstCompileOnlyGeometry.cpp

+21
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <ArborX_Point.hpp>
1515
#include <ArborX_Segment.hpp>
1616
#include <ArborX_Sphere.hpp>
17+
#include <ArborX_Tetrahedron.hpp>
1718
#include <ArborX_Triangle.hpp>
1819

1920
namespace ArborX::GeometryTraits
@@ -302,4 +303,24 @@ void test_triangle_ctad()
302303
Triangle<3, double>>);
303304
}
304305

306+
void test_tetrahedron_ctad()
307+
{
308+
using ArborX::Point;
309+
using ArborX::ExperimentalHyperGeometry::Tetrahedron;
310+
311+
static_assert(
312+
std::is_same_v<decltype(Tetrahedron{
313+
{0, 2, 4}, {3, 1, 2}, {2, 5, 3}, {1, -1, 2}}),
314+
Tetrahedron<int>>);
315+
static_assert(std::is_same_v<decltype(Tetrahedron{{0.f, 2.f, 3.f},
316+
{3.f, 1.f, 2.3f},
317+
{2.f, 5.f, 1.f},
318+
{1.f, -1.f, 2.f}}),
319+
Tetrahedron<float>>);
320+
static_assert(std::is_same_v<decltype(Tetrahedron{
321+
Point{3., 4., 2.}, Point{2., 2., 2.},
322+
Point{6., 3., 5.}, Point{3., 1., 6.}}),
323+
Tetrahedron<double>>);
324+
}
325+
305326
} // namespace ArborX::GeometryTraits

0 commit comments

Comments
 (0)