Skip to content

Do Julia accept template<int n> like CPP? #15445

Closed
@zhujinxuan

Description

@zhujinxuan

Recently I am writing a self-use package for calculating space differiente. The package accept 1-st order differiente and 2-nd order differiente but throw error when calculating higher oders.

I was thinking about something like types like eval(SpaceDiff{1}, arg...) and eval(SpaceDiff{2}...) rather than juist 1/2, as it can throw an error in a separated defination.

But I did not see anything similar in the document. Is there a similar way to specify types or methods by an actual int?

Thank you.

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