summaryrefslogtreecommitdiff
path: root/src/context
diff options
context:
space:
mode:
authorAndres Noetzli <andres.noetzli@gmail.com>2018-08-07 17:26:58 -0700
committerGitHub <noreply@github.com>2018-08-07 17:26:58 -0700
commitc831d34205a473cbace8a546704a992ba8220dd6 (patch)
tree0dae0fabc4b96b2a53665bd0c6c965361538517d /src/context
parent82515cbaef14918c7ce825e29a30de01c13d90ac (diff)
Delete functions instead of using CVC4_UNDEFINED (#1794)
C++11 supports explicitly deleting functions that should not be used (explictly or implictly), e.g. copy or assignment constructors. We were previously using the CVC4_UNDEFINED macro that used a compiler-specific attribute. The C++11 feature should be more portable.
Diffstat (limited to 'src/context')
-rw-r--r--src/context/cdhashmap.h6
-rw-r--r--src/context/cdhashset.h4
-rw-r--r--src/context/cdinsert_hashmap.h2
-rw-r--r--src/context/cdlist.h2
-rw-r--r--src/context/cdo.h2
-rw-r--r--src/context/context.h8
6 files changed, 12 insertions, 12 deletions
diff --git a/src/context/cdhashmap.h b/src/context/cdhashmap.h
index 94b507a7e..958c48e22 100644
--- a/src/context/cdhashmap.h
+++ b/src/context/cdhashmap.h
@@ -177,7 +177,7 @@ class CDOhash_map : public ContextObj {
d_next(NULL)
{
}
- CDOhash_map& operator=(const CDOhash_map&) CVC4_UNDEFINED;
+ CDOhash_map& operator=(const CDOhash_map&) = delete;
public:
CDOhash_map(Context* context,
@@ -290,8 +290,8 @@ class CDHashMap : public ContextObj {
void restore(ContextObj* data) override { Unreachable(); }
// no copy or assignment
- CDHashMap(const CDHashMap&) CVC4_UNDEFINED;
- CDHashMap& operator=(const CDHashMap&) CVC4_UNDEFINED;
+ CDHashMap(const CDHashMap&) = delete;
+ CDHashMap& operator=(const CDHashMap&) = delete;
public:
CDHashMap(Context* context)
diff --git a/src/context/cdhashset.h b/src/context/cdhashset.h
index 0dc1f087d..b907d9823 100644
--- a/src/context/cdhashset.h
+++ b/src/context/cdhashset.h
@@ -32,8 +32,8 @@ class CDHashSet : protected CDInsertHashMap<V, bool, HashFcn> {
typedef CDInsertHashMap<V, bool, HashFcn> super;
// no copy or assignment
- CDHashSet(const CDHashSet&) CVC4_UNDEFINED;
- CDHashSet& operator=(const CDHashSet&) CVC4_UNDEFINED;
+ CDHashSet(const CDHashSet&) = delete;
+ CDHashSet& operator=(const CDHashSet&) = delete;
public:
diff --git a/src/context/cdinsert_hashmap.h b/src/context/cdinsert_hashmap.h
index 62268b471..d59bf584d 100644
--- a/src/context/cdinsert_hashmap.h
+++ b/src/context/cdinsert_hashmap.h
@@ -214,7 +214,7 @@ private:
<< " from " << &l
<< " size " << d_size << std::endl;
}
- CDInsertHashMap& operator=(const CDInsertHashMap&) CVC4_UNDEFINED;
+ CDInsertHashMap& operator=(const CDInsertHashMap&) = delete;
/**
* Implementation of mandatory ContextObj method save: simply copies
diff --git a/src/context/cdlist.h b/src/context/cdlist.h
index 8fcc977af..834e363f9 100644
--- a/src/context/cdlist.h
+++ b/src/context/cdlist.h
@@ -113,7 +113,7 @@ protected:
<< " from " << &l
<< " size " << d_size << std::endl;
}
- CDList& operator=(const CDList& l) CVC4_UNDEFINED;
+ CDList& operator=(const CDList& l) = delete;
private:
/**
diff --git a/src/context/cdo.h b/src/context/cdo.h
index 3cb646d6c..da6c8d338 100644
--- a/src/context/cdo.h
+++ b/src/context/cdo.h
@@ -50,7 +50,7 @@ protected:
/**
* operator= for CDO is private to ensure CDO object is not copied.
*/
- CDO<T>& operator=(const CDO<T>& cdo) CVC4_UNDEFINED;
+ CDO<T>& operator=(const CDO<T>& cdo) = delete;
/**
* Implementation of mandatory ContextObj method save: simply copies the
diff --git a/src/context/context.h b/src/context/context.h
index acff2b5c2..04da9c25d 100644
--- a/src/context/context.h
+++ b/src/context/context.h
@@ -94,8 +94,8 @@ class Context {
friend std::ostream& operator<<(std::ostream&, const Context&);
// disable copy, assignment
- Context(const Context&) CVC4_UNDEFINED;
- Context& operator=(const Context&) CVC4_UNDEFINED;
+ Context(const Context&) = delete;
+ Context& operator=(const Context&) = delete;
public:
@@ -208,8 +208,8 @@ public:
class UserContext : public Context {
private:
// disable copy, assignment
- UserContext(const UserContext&) CVC4_UNDEFINED;
- UserContext& operator=(const UserContext&) CVC4_UNDEFINED;
+ UserContext(const UserContext&) = delete;
+ UserContext& operator=(const UserContext&) = delete;
public:
UserContext() {}
};/* class UserContext */
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback