m-tosch / mu

A small, simple c++ math library
MIT License
1 stars 0 forks source link

include MatrixNxN, Matrix2x2, Matrix3x3 in doc #103

Closed m-tosch closed 3 years ago

m-tosch commented 3 years ago

since these 3 are alias templates defined as

template <std::size_t N, typename T>
using MatrixNxN = Matrix<N, N, T>;

template <typename T>
using Matrix2x2 = Matrix<2, 2, T>;

template <typename T>
using Matrix3x3 = Matrix<3, 3, T>;

they won't show as individual classes in the doxygen output. to include a metion of them anyway, add a little text to the Matrix class docstring.

m-tosch commented 3 years ago

added comment in class docstring. support for template aliases was supposingly added in v1.8.2, see https://stackoverflow.com/questions/12534024/doxygen-support-for-c11-template-aliases-the-using-syntax. but they still don't show up in the doc even though they have a doxygen header now.

Template aliases
- MatrixNxN
- Matrix2x2
- Matrix3x3
m-tosch commented 3 years ago

solution

split the namespace regions in matrix.h Changed the following....

namespace mu {
  // ...
  class Matrix {
    // ...
  };
  // ...
  template <std::size_t N, typename T>
  using MatrixNxN = Matrix<N, N, T>;
  template <typename T>
  using Matrix2x2 = Matrix<2, 2, T>;
  template <typename T>
  using Matrix3x3 = Matrix<3, 3, T>;
} // namespace mu

.. to this..

namespace mu {
  // ...
  class Matrix {
    // ...
  };
  // ...
} // namespace mu

namespace mu {
  template <std::size_t N, typename T>
  using MatrixNxN = Matrix<N, N, T>;
  template <typename T>
  using Matrix2x2 = Matrix<2, 2, T>;
  template <typename T>
  using Matrix3x3 = Matrix<3, 3, T>;
} // namespace mu

With this small change, the alias templates now show up in the documentation under Files -> File List -> include -> mu -> matrix.h grafik