Skip to content

strategy for usable const& Mesh objects #391

@jacobmerson

Description

@jacobmerson

@ibaned Hoping to get your perspective on the following as a much more experienced developer.

I did a little bit of work trying to fix up the const correctness of some of the ask_ functions in the mesh class but hit a bit of a roadblocks because some of the intermediate data is cached in the mesh tags or other arrays in the mesh class. I was thinking about doing the following if/when I have time to allow a const reference to mesh to be useable.

  1. Create a Cache struct internal to the Mesh class that holds all of the data/tags that is cached.
  2. Make the stored instance of Cache mutable so it can be updated in a const reference to Mesh
  3. In the get_tag functions if the tag name doesn't exist check it against the list of names that were used as internal cache variables and give an error message saying "you are relying on deprecated tags use ask_... instead".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions