Skip to content

Add a required<T>(para, key) helper to cut per-material parameter boilerplate #74

Description

@petlenz

Each material spends roughly 40 lines declaring parameters:

para.template insert<indices>("indices").template add<is_required>();

and again reading them with base::template get_parameter<T>("k").

A free helper required<T>(para, "k") (and optional<T>(para, "k", default)) was tried during review and works; using base::add_output does not, because of the dependent-name lookup.

Purely additive: existing materials keep compiling, new ones get shorter, and the .template noise disappears from the code a material author has to write. It is also the natural place to attach check_data_type and range<> once, see the parameter-diagnostics issue.

All references are to main at 91bd26f.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions