Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropertyType Traits Class? #233

Open
ryanmrichard opened this issue Apr 1, 2022 · 0 comments
Open

PropertyType Traits Class? #233

ryanmrichard opened this issue Apr 1, 2022 · 0 comments

Comments

@ryanmrichard
Copy link
Member

Is your feature request related to a problem? Please describe.
Using auto goes a long ways toward not needing to know the exact types of the inputs/results of a property type. For the times when you do need to know the type it would be nice if there was a traits class.

Describe the solution you'd like
I'd like each PT to have a corresponding traits class from which the user can get the types of the
inputs and results. Ideally this class should be auto-generated. I'm thinking something like:

// FTR the API of AOEnergy is double(const AOSpace&, const ChemicalSystem&)

// Example of getting the traits for the AOEnergy PT
using traits_type = PTTraits<AOEnergy>;

// Typedef of const AOSpace&
using input0_t = typename traits_type::input<0>;

// Typedef of const ChemicalSytem&
using input1_t = typename traits_type::input<1>;

// Typedef of double
using result0_t = typename traits_type::result<0>;

Describe alternatives you've considered
I've taken to manually writing such traits classes in some places, but I think it might be possible to auto generate one. IIRC the way the user specifies the inputs/results causes something like this to be generated under the hood already (that's how we know what types to unwrap/wrap for things like unwrap_inputs) so this issue is really just for exposing that in a user-friendly way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant