From 4be93760d15266d80c0a3f21b8a26e0e9f585d5b Mon Sep 17 00:00:00 2001 From: Laurent Rineau Date: Tue, 26 Sep 2023 12:42:33 +0200 Subject: [PATCH] try to workaround MSVC2022 error ``` 2>C:\Program Files\Microsoft Visual Studio\2022\Professional\VC\Tools\MSVC\14.35.32215\include\type_traits(143,19): error C2338: static_assert failed: 'Calling declval is ill-formed, see N4917 22.2.6 [declval]/2.' 2>C:\GitHub\cgal\Triangulation_3\test\Triangulation_3\cdt_3_from_off.cpp(311): message : see reference to function template instantiation 'Segment &&std::declval(void) noexcept' being compiled 2>C:\GitHub\cgal\Triangulation_3\test\Triangulation_3\cdt_3_from_off.cpp(311,57): message : see reference to function template instantiation 'std::vector>,std::allocator>>> segment_soup_to_polylines<_Ty&>(Range_of_segments)' being compiled ``` --- Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp b/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp index 9b788e9656b..c257f714f55 100644 --- a/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp +++ b/Triangulation_3/test/Triangulation_3/cdt_3_from_off.cpp @@ -157,8 +157,8 @@ int main(int argc, char* argv[]) template auto segment_soup_to_polylines(Range_of_segments&& segment_soup) { - using Segment = typename std::ranges::range_value_t; - using Point = std::decay_t(); return a; } ())>; + using Point = decltype([&](){ using std::begin; auto [a, b] = *begin(segment_soup); return a; } ()); + std::vector> polylines; using Graph = boost::adjacency_list;