Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • OpenVolumeMesh OpenVolumeMesh
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 28
    • Issues 28
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 2
    • Merge requests 2
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • OpenVolumeMeshOpenVolumeMesh
  • OpenVolumeMeshOpenVolumeMesh
  • Merge requests
  • !44

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

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Martin Heistermann requested to merge fix-lifetime-issue into master Feb 15, 2019
  • Overview 0
  • Commits 1
  • Pipelines 2
  • 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
Reviewers
Request review from
Time tracking
Source branch: fix-lifetime-issue