8000 Pass GeometryTraits template args through remove_cv by aprokop · Pull Request #1129 · arborx/ArborX · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Pass GeometryTraits template args through remove_cv #1129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 5, 2024
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
7 changes: 4 additions & 3 deletions src/geometry/ArborX_GeometryTraits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct dimension
using not_specialized = void; // tag to detect existence of a specialization
};
template <typename Geometry>
inline constexpr int dimension_v = dimension<Geometry>::value;
inline constexpr int dimension_v = dimension<std::remove_cv_t<Geometry>>::value;

struct not_specialized
{};
Expand All @@ -37,15 +37,16 @@ struct tag
using type = not_specialized;
};
template <typename Geometry>
using tag_t = typename tag<Geometry>::type;
using tag_t = typename tag<std::remove_cv_t<Geometry>>::type;

template <typename Geometry>
struct coordinate_type
{
using type = not_specialized;
};
template <typename Geometry>
using coordinate_type_t = typename coordinate_type<Geometry>::type;
using coordinate_type_t =
typename coordinate_type<std::remove_cv_t<Geometry>>::type;

// clang-format off
#define DEFINE_GEOMETRY(name, name_tag) \
Expand Down
11 changes: 11 additions & 0 deletions test/tstCompileOnlyGeometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,17 @@ void test_geometry_compile_only()
// check_valid_geometry_traits(WrongCoordinateSpecialization{});
}

void test_point_cv_compile_only()
{
using Point = ArborX::Point;
namespace GT = ArborX::GeometryTraits;

static_assert(GT::dimension_v<const Point> == 3);
static_assert(std::is_same_v<GT::coordinate_type_t<const Point>, float>);
static_assert(std::is_same_v<GT::tag_t<const Point>, GT::PointTag>);
static_assert(GT::is_point_v<const Point>);
}

void test_point_ctad()
{
using ArborX::ExperimentalHyperGeometry::Point;
Expand Down
Loading
0