NWChemEx / Utilities

Generic, helpful C++ classes
https://nwchemex.github.io/Utilities/
Apache License 2.0
0 stars 1 forks source link

Parameter Pack Traits #96

Closed wavefunction91 closed 3 years ago

wavefunction91 commented 3 years ago

Status

Brief Description

Add some TMP functionality revolving around parameter packs as suggested in https://github.com/NWChemEx-Project/LibChemist/pull/189

Detailed Description

Adds functions to

  1. Determine if a (derived) type appears in a parameter pack
  2. Count number of times a (derived) type appears in a parameter pack

Also refactors utilities::type_traits::tuple::has_type to leverage these new type traits

Just to state it outright - parameter_pack_contains_type could delegate to parameter_pack_count_type, but since std::disjunction is early exit with even minor compiler optimizations, its use is preferable for large parameter packs.

TODO

wavefunction91 commented 3 years ago

@ryanmrichard OK, cleaned up - it will merge with an approving review