Is there some cases where ConstraintFunction here is templated by multiple classes. There are no such case in Tasks and I could find one in client code either.
Getting rid of the variadic template gives a much simpler code:
template<typename Fun>
class ConstraintFunction : public Constraint, public Fun
{
public:
virtual ~ConstraintFunction() {}
void addToSolver(QPSolver& sol)
{
sol.addConstraint(this);
static_cast<Fun*>(this)->addToSolver(sol);
}
void addToSolver(const std::vector<rbd::MultiBody>& mbs, QPSolver& sol)
{
sol.addConstraint(mbs, this);
static_cast<Fun*>(this)->addToSolver(sol);
}
void removeFromSolver(QPSolver& sol)
{
sol.removeConstraint(this);
static_cast<Fun*>(this)->removeFromSolver(sol);
}
};
The impact on client code is minimal to non-existent. At worse, it is a matter of removing a few ...
Is there some cases where ConstraintFunction here is templated by multiple classes. There are no such case in Tasks and I could find one in client code either.
Getting rid of the variadic template gives a much simpler code:
The impact on client code is minimal to non-existent. At worse, it is a matter of removing a few ...