Make it possible to clone const formulae.

* src/ltlast/formula.hh, src/ltlast/formula.cc (clone): Declare
as const.
This commit is contained in:
Alexandre Duret-Lutz 2009-11-08 19:36:35 +01:00
parent b0888257f8
commit e44f1b8997
3 changed files with 11 additions and 4 deletions

View file

@ -1,3 +1,10 @@
2009-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Make it possible to clone const formulae.
* src/ltlast/formula.hh, src/ltlast/formula.cc (clone): Declare
as const.
2009-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr> 2009-11-08 Alexandre Duret-Lutz <adl@lrde.epita.fr>
Rename formula::ref and formula::unref as formula::clone Rename formula::ref and formula::unref as formula::clone

View file

@ -27,10 +27,10 @@ namespace spot
namespace ltl namespace ltl
{ {
formula* formula*
formula::clone() formula::clone() const
{ {
ref_(); const_cast<formula*>(this)->ref_();
return this; return const_cast<formula*>(this);
} }
formula::~formula() formula::~formula()

View file

@ -80,7 +80,7 @@ namespace spot
/// ///
/// This increments the reference counter of this node (if one is /// This increments the reference counter of this node (if one is
/// used). /// used).
formula* clone(); formula* clone() const;
/// \brief release this node /// \brief release this node
/// ///
/// This decrements the reference counter of this node (if one is /// This decrements the reference counter of this node (if one is