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<Segment>(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::vector<Point,std::allocator<Point>>,std::allocator<std::vector<Point,std::allocator<Point>>>> segment_soup_to_polylines<_Ty&>(Range_of_segments)' being compiled
```
This commit is contained in:
Laurent Rineau 2023-09-26 12:42:33 +02:00
parent 49836e1485
commit 4be93760d1
1 changed files with 2 additions and 2 deletions

View File

@ -157,8 +157,8 @@ int main(int argc, char* argv[])
template <typename Range_of_segments>
auto segment_soup_to_polylines(Range_of_segments&& segment_soup) {
using Segment = typename std::ranges::range_value_t<Range_of_segments>;
using Point = std::decay_t<decltype([](){ auto [a, b] = std::declval<Segment>(); return a; } ())>;
using Point = decltype([&](){ using std::begin; auto [a, b] = *begin(segment_soup); return a; } ());
std::vector<std::vector<Point>> polylines;
using Graph = boost::adjacency_list<boost::listS, boost::vecS, boost::undirectedS, Point>;