Skip to content

Commit a66ef33

Browse files
authored
[python] make BlkMatrixPythonVisitor an incomplete type when template argument is wrong (#304)
1 parent 6937c09 commit a66ef33

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

bindings/python/include/aligator/python/blk-matrix.hpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ namespace aligator {
55
namespace python {
66
namespace bp = boost::python;
77

8-
template <typename BlockMatrixType>
9-
struct BlkMatrixPythonVisitor
10-
: bp::def_visitor<BlkMatrixPythonVisitor<BlockMatrixType>> {
8+
template <typename BlockMatrixType> struct BlkMatrixPythonVisitor;
119

12-
enum { N = BlockMatrixType::N, M = BlockMatrixType::M };
13-
using MatrixType = typename BlockMatrixType::MatrixType;
10+
template <typename MatrixType, int N, int M>
11+
struct BlkMatrixPythonVisitor<BlkMatrix<MatrixType, N, M>>
12+
: bp::def_visitor<BlkMatrixPythonVisitor<BlkMatrix<MatrixType, N, M>>> {
13+
using BlockMatrixType = BlkMatrix<MatrixType, N, M>;
1414
using RefType = Eigen::Ref<MatrixType>;
1515

1616
using Self = BlkMatrixPythonVisitor<BlockMatrixType>;

0 commit comments

Comments
 (0)