Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
OpenVolumeMesh
OpenVolumeMesh
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 7
    • Issues 7
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenVolumeMesh
  • OpenVolumeMeshOpenVolumeMesh
  • Merge Requests
  • !43

Closed
Opened Feb 15, 2019 by Martin Heistermann@mheistermannMaintainer
  • Report abuse
Report abuse

Fix lifetime issues for Face::halfedges(), Cell::halffaces().

  • Overview 1
  • Commits 1
  • Pipelines 1
  • Changes 1

Currently, the following API-usage is straight-forward and clean but unfortunately wrong and dangerous:

for (const auto heh: mesh.face(fh).halfedges()) { ... }

This is because the temporary Face returned by face() reaches the end of its lifetime, but halfedges() returned a reference to a vector that lives inside that object. Reference lifetime extension does not apply here.

This change splits behaviour so that in rvalue context (such as temporaries), we move out the vector instead of returning a reference to it.

Assignee
Assign to
Reviewer
Request review from
None
Milestone
None
Assign milestone
Time tracking
Reference: OpenVolumeMesh/OpenVolumeMesh!43
Source branch: fix-lifetime-issue