feat(kernel/definition): default constructor for definitions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
984ac03ac7
commit
234abb1238
2 changed files with 12 additions and 0 deletions
|
@ -59,6 +59,9 @@ struct definition::cell {
|
|||
}
|
||||
};
|
||||
|
||||
definition g_dummy = mk_axiom(name(), param_names(), level_cnstrs(), expr());
|
||||
|
||||
definition::definition():definition(g_dummy) {}
|
||||
definition::definition(cell * ptr):m_ptr(ptr) {}
|
||||
definition::definition(definition const & s):m_ptr(s.m_ptr) { if (m_ptr) m_ptr->inc_ref(); }
|
||||
definition::definition(definition && s):m_ptr(s.m_ptr) { s.m_ptr = nullptr; }
|
||||
|
|
|
@ -20,6 +20,15 @@ class definition {
|
|||
explicit definition(cell * ptr);
|
||||
friend class cell;
|
||||
public:
|
||||
/**
|
||||
\brief The default constructor creates a reference to a "dummy"
|
||||
definition. The actual "dummy" definition is not relevant, and
|
||||
no procedure should rely on the kind of definition used.
|
||||
|
||||
We have a default constructor because some collections only work
|
||||
with types that have a default constructor.
|
||||
*/
|
||||
definition();
|
||||
definition(definition const & s);
|
||||
definition(definition && s);
|
||||
~definition();
|
||||
|
|
Loading…
Reference in a new issue