Skip to content
GitLab
  • Menu
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • D dune-geometry
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 8
    • Issues 8
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 19
    • Merge requests 19
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Core Modules
  • dune-geometry
  • Merge requests
  • !30

[wip] Use reference qualifiers to avoid reference to temporaries

  • Review changes

  • Download
  • Email patches
  • Plain diff
Open Carsten Gräser requested to merge feature/use-ref-qualifiers into master Oct 11, 2016
  • Overview 5
  • Commits 1
  • Pipelines 1
  • Changes 1

Until now one could write code like

auto&& jt = AffineGeometry<...>(...).jacobianTransposed(...);

This compiles and (depending on the surrounding code) may even lead to the expected results. However, since AffineGeometry hands out a reference to the stored matrix jt is a reference to a temporary that may be overwritten by other stack variables.

By explicitly deleting the overload for r-values the compiler rejects the above code and only allows to call jacobianTransposed() on l-values.

Assignee
Assign to
Reviewer
Request review from
Time tracking
Source branch: feature/use-ref-qualifiers