Dawg: Define virtual destructor in .cpp file

This fixes compiler warnings from clang:

src/dict/dawg.h:119:7: warning:
 'Dawg' 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:47:29 +02:00
parent ac8afc57bb
commit 0d211f9ed5
2 changed files with 6 additions and 1 deletions

View File

@ -42,6 +42,11 @@
----------------------------------------------------------------------*/
namespace tesseract {
// Destructor.
// It is defined here, so the compiler can create a single vtable
// instead of weak vtables in every compilation unit.
Dawg::~Dawg() = default;
bool Dawg::prefix_in_dawg(const WERD_CHOICE &word,
bool requires_complete) const {
if (word.length() == 0) return !requires_complete;

View File

@ -129,7 +129,7 @@ class Dawg {
inline const STRING &lang() const { return lang_; }
inline PermuterType permuter() const { return perm_; }
virtual ~Dawg() = default;
virtual ~Dawg();
/// Returns true if the given word is in the Dawg.
bool word_in_dawg(const WERD_CHOICE &word) const;