-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Fix SFINAE usage in insert and do_intersect functions on Ubuntu 24.04 #8770
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: ViNN280801 <[email protected]>
Thanks for the PR! Do you have an example that we could compile and that is showing the error? |
I don't know why, but it occurs in yours code when I am compiling my code But when I making minimal example with main.cpp #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/intersections.h>
using Kernel = CGAL::Exact_predicates_inexact_constructions_kernel;
using Point = Kernel::Point_3;
using Segment = Kernel::Segment_3;
using Triangle = Kernel::Triangle_3;
int main()
{
Segment segment(Point(0, 0, 0), Point(1, 1, 1));
Triangle triangel(Point(0, 0, 0), Point(1, 0, 0), Point(0, 1, 0));
bool intersects = CGAL::do_intersect(segment, triangel);
return 0;
} main.cpp cmake_minimum_required(VERSION 3.10)
project(example)
# GMP Setup
find_path(GMP_INCLUDE_DIR gmp.h HINTS /usr/include/x86_64-linux-gnu
/usr/include/CGAL)
find_library(
GMP_LIBRARY
NAMES gmp libgmp
HINTS /usr/lib/x86_64-linux-gnu)
if(NOT GMP_INCLUDE_DIR OR NOT GMP_LIBRARY)
message(FATAL_ERROR "GMP not found. Please ensure GMP is installed.")
endif()
include_directories(${GMP_INCLUDE_DIR})
link_libraries(${GMP_LIBRARY})
# CGAL Setup
find_package(CGAL REQUIRED)
# Compile
add_executable(example main.cpp) of course it compiles successfully: If you need to get error like me, you can compile my repo Start or I can try to make minimal example, but I need time😬 |
and I really don't understand why I have errors in CGAL header file
template <typename GeometryTraits_2, typename TopologyTraits,
typename PointLocation, typename ZoneVisitor>
void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
const typename GeometryTraits_2::X_monotone_curve_2& c,
const PointLocation& pl, ZoneVisitor &visitor,
std::is_same<int, int>::type) to template <typename GeometryTraits_2, typename TopologyTraits,
typename PointLocation, typename ZoneVisitor,
typename = std::enable_if_t<std::is_same<PointLocation, int>::value>>
void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
const typename GeometryTraits_2::X_monotone_curve_2& c,
const PointLocation& pl, ZoneVisitor &visitor)
template <typename GeometryTraits_2, typename TopologyTraits,
typename InputIterator>
void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
InputIterator begin, InputIterator end,
std::is_same<int, int>::type) to template <typename GeometryTraits_2, typename TopologyTraits,
typename InputIterator,
typename = std::enable_if_t<std::is_same<InputIterator, int>::value>>
void insert(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
InputIterator begin, InputIterator end)
template <typename GeometryTraits_2, typename TopologyTraits,
typename PointLocation>
bool
do_intersect(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
const typename GeometryTraits_2::X_monotone_curve_2& c,
const PointLocation& pl, std::is_same<int, int>::type) to template <typename GeometryTraits_2, typename TopologyTraits,
typename PointLocation,
typename = std::enable_if_t<std::is_same<PointLocation, int>::value>>
bool
do_intersect(Arrangement_on_surface_2<GeometryTraits_2, TopologyTraits>& arr,
const typename GeometryTraits_2::X_monotone_curve_2& c,
const PointLocation& pl) And only after I changed this file, everything compiled successfully for me. Maybe my case is single or maybe I configured smth wrong, don't know exactly. |
I would also like to have a look at the fix. I'll do it next week.
BW, perhaps you mentioned it and I missed it: which version of compiler are
you using?
…On Wed, Mar 5, 2025, 11:23 Vladislav Semykin ***@***.***> wrote:
btw, tests are successfull
image.png (view on web)
<https://github.com/user-attachments/assets/baaced65-7d5c-4487-97df-30db764ebd34>
—
Reply to this email directly, view it on GitHub
<#8770 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVBNOEI6XTFKZ7Q53BYBGD2S3GDHAVCNFSM6AAAAABYLMLOG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBQGQ4TAMBQGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
[image: ViNN280801]*ViNN280801* left a comment (CGAL/cgal#8770)
<#8770 (comment)>
btw, tests are successfull
image.png (view on web)
<https://github.com/user-attachments/assets/baaced65-7d5c-4487-97df-30db764ebd34>
—
Reply to this email directly, view it on GitHub
<#8770 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABVBNOEI6XTFKZ7Q53BYBGD2S3GDHAVCNFSM6AAAAABYLMLOG2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDOMBQGQ4TAMBQGE>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
my project uses CUDA, so, I used |
Summary of Changes
I fixed an error in the code related to the incorrect use of std::is_same. In the source code, there was an attempt to use std::is_some<int, int>::type as a function parameter, which caused a compilation error. I removed this unnecessary parameter and added type checking using SFINAE (std::enable_if).
I have Ubuntu 24.04:
I used the CGAL in my project for intersections with AABB and when I compiling my code, I faced with these kind of errors:
Release Management