QMCPACK / QMCPACK/qmcpack

Propagation of type aliases through class hierarchies

Open
#913 6 comments 0 reactions 5 assignees Claimed by @jtkrogel View on GitHub
discussion
Dominant language
C++
Stars
403
Forks
154
Avg merge
1d 12h
Merged PRs (30d)
82

Description

Getting your type aliases through a base class like QMCTraits becomes problematic when you have a templated base class.
```c++
template
class OneBodyJastrowOrbitalBsplineSoA :
public J1OrbitalSoA
{
// The following is so we can refer to type aliases(defs) below the
// templated base class in the object hierarchy
// Mostly QMCTraits here
using JBase = J1OrbitalSoA;
using RealType = typename JBase::RealType;
using ValueType = typename JBase::ValueType;
using GradType = typename JBase::GradType;
using PosType = typename JBase::PosType;
...
}
```
In fact getting these type aliases from J1OrbitalSoA has nothing to do with it being a OneBody..'s base class at all. Suggestions? I don't really think QMCTraits belongs in the class hierarchy at all, but sometimes getting a type from your inheritance tree seems more useful.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.