I don't know if that works but could you write 
```return MathLib::GaussLegendreTri<order>::NPoints;```
and ditch the switch-case?