mirror of
https://github.com/NGSolve/netgen.git
synced 2024-12-24 04:50:34 +05:00
use get_if for variant<>
compiles for Mac <10.13, also more readable
This commit is contained in:
parent
e2768981f1
commit
c4f2146519
@ -1328,14 +1328,10 @@ Solid2d :: Solid2d(const Array<std::variant<Point<2>, EdgeInfo>> & points, strin
|
||||
Loop l;
|
||||
for (auto & v : points)
|
||||
{
|
||||
if(std::holds_alternative<Point<2>>(v))
|
||||
{
|
||||
l.Append(std::get<0>(v), true);
|
||||
}
|
||||
if(std::holds_alternative<EdgeInfo>(v))
|
||||
{
|
||||
l.first->prev->info.Assign( std::get<1>(v) );
|
||||
}
|
||||
if(auto point = std::get_if<Point<2>>(&v))
|
||||
l.Append(*point, true);
|
||||
if(auto edge_info = std::get_if<EdgeInfo>(&v))
|
||||
l.first->prev->info.Assign( *edge_info );
|
||||
}
|
||||
|
||||
for(auto v : l.Vertices(ALL))
|
||||
|
Loading…
Reference in New Issue
Block a user