MATRIX: Define virtual destructor in .cpp file

This fixes compiler warnings from clang:

src/ccstruct/matrix.h:575:7: warning:
 'MATRIX' has no out-of-line virtual method definitions;
 its vtable will be emitted in every translation unit [-Wweak-vtables]

Signed-off-by: Stefan Weil <sw@weilnetz.de>
This commit is contained in:
Stefan Weil 2018-09-04 07:43:17 +02:00
parent bde8f08003
commit 14c23c9f13
2 changed files with 7 additions and 0 deletions

View File

@ -32,6 +32,11 @@
#include "tprintf.h"
#include "unicharset.h"
// Destructor.
// It is defined here, so the compiler can create a single vtable
// instead of weak vtables in every compilation unit.
MATRIX::~MATRIX() = default;
// Returns true if there are any real classification results.
bool MATRIX::Classified(int col, int row, int wildcard_id) const {
if (get(col, row) == NOT_CLASSIFIED) return false;

View File

@ -577,6 +577,8 @@ class MATRIX : public BandTriMatrix<BLOB_CHOICE_LIST *> {
MATRIX(int dimension, int bandwidth)
: BandTriMatrix<BLOB_CHOICE_LIST *>(dimension, bandwidth, NOT_CLASSIFIED) {}
virtual ~MATRIX();
// Returns true if there are any real classification results.
bool Classified(int col, int row, int wildcard_id) const;