]> https://gitweb.dealii.org/ - code-gallery.git/commitdiff
Add some virtual dtors.
authorDavid Wells <drwells@email.unc.edu>
Mon, 18 May 2020 17:25:59 +0000 (13:25 -0400)
committerDavid Wells <drwells@email.unc.edu>
Mon, 18 May 2020 17:25:59 +0000 (13:25 -0400)
GCC warns about this since the class has a virtual function.

MCMC-Laplace/mcmc-laplace.cc

index bda3c2d36a5dfa20f32bb7caa3258ce5fd311185..ef84546e29871d5ea0c9cf2588809a9319fbd871 100644 (file)
@@ -72,6 +72,8 @@ namespace ForwardSimulator
   {
   public:
     virtual Vector<double> evaluate(const Vector<double> &coefficients) = 0;
+
+    virtual ~Interface() = default;
   };
 
 
@@ -406,6 +408,8 @@ namespace LogLikelihood
   {
   public:
     virtual double log_likelihood(const Vector<double> &x) const = 0;
+
+    virtual ~Interface() = default;
   };
 
 
@@ -454,6 +458,8 @@ namespace LogPrior
   {
   public:
     virtual double log_prior(const Vector<double> &x) const = 0;
+
+    virtual ~Interface() = default;
   };
 
 
@@ -522,6 +528,8 @@ namespace ProposalGenerator
     virtual
     std::pair<Vector<double>,double>
     perturb(const Vector<double> &current_sample) const = 0;
+
+    virtual ~Interface() = default;
   };
 
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.