Skip to content
Snippets Groups Projects
Commit c9c865ff authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[A/U] Store value instead of reference.

Since at least gcc-9.1 the original code didn't compile
any longer with error message:
computeSurfaceNodeIDsInPolygonalRegion.cpp:147:48: error: converting to ‘const GeoLib::Polygon’ from initializer list would use explicit constructor ‘GeoLib::Polygon::Polygon(const GeoLib::Polyline&, bool)’
  147 |         GeoLib::Polygon const& polygon{*plys[j]};
      |                                                ^

From reference_initialization page of cppreference.com:
Lifetime of a temporary:
...
 - a temporary bound to a reference member in a constructor initializer list persists only until the constructor exits, not as long as the object exists. (note: such initialization is ill-formed as of DR 1696).
parent e7b5f198
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment