[mathicgb] 234/393: Work-around for issue GCC 4.7 seems to have with properly resolving private copy constructors versus public move constructors.
Doug Torrance
dtorrance-guest at moszumanska.debian.org
Fri Apr 3 15:59:09 UTC 2015
This is an automated email from the git hooks/post-receive script.
dtorrance-guest pushed a commit to branch upstream
in repository mathicgb.
commit 26784b959e58ac2c17535adabd30f1097d7ddfda
Author: Bjarke Hammersholt Roune <bjarkehr.code at gmail.com>
Date: Thu Apr 11 14:49:45 2013 -0400
Work-around for issue GCC 4.7 seems to have with properly resolving private copy constructors versus public move constructors.
---
src/mathicgb/MonoMonoid.hpp | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/mathicgb/MonoMonoid.hpp b/src/mathicgb/MonoMonoid.hpp
index 8212f17..5f5613e 100755
--- a/src/mathicgb/MonoMonoid.hpp
+++ b/src/mathicgb/MonoMonoid.hpp
@@ -11,6 +11,20 @@
#include <cstring>
#include <mathic.h>
+/// Temporary class. Should be moved to its own place eventually.
+/// Derive from this class to disable the compiler-generated
+/// copy constructor and assignment. The purpose of the template
+/// parameter is to avoid any chance of getting a diamond-graph
+/// inheritance graph.
+template<class T>
+class NonCopyable {
+public:
+ NonCopyable() {}
+private:
+ NonCopyable(const NonCopyable&); // unavailable
+ void operator=(const NonCopyable&); // unavailable
+};
+
/// Implements the monoid of (monic) monomials with integer
/// non-negative exponents. Exponent must be an unsigned integer type that is
/// used to store each exponent of a monomial.
@@ -838,7 +852,7 @@ public:
Exponent* mMono;
};
- class Mono {
+ class Mono : public NonCopyable<Mono> {
public:
Mono(): mMono(), mPool(0) {}
@@ -870,8 +884,6 @@ public:
}
private:
- Mono(const Mono&); // not available
- void operator=(const Mono&); // not available
friend class MonoMonoid;
Mono(const MonoPtr mono, MonoPool& pool):
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/mathicgb.git
More information about the debian-science-commits
mailing list