This is not valid C++ and not even a documented GCC extension. It is
probabably an oversight that GCC appears to be able to interpret this
in some manner.
Also creates a custom copy constructor for Dimension_cache for the
sole purpose of being able to initialize a Dimension_cache array
element-wise from a Dimension_cache array in the copy constructor of
Grob. C++ clearly is lacking in some departments.
extent_ = d.extent_ ? new Interval (*d.extent_) : 0;
}
+Dimension_cache &
+Dimension_cache::operator = (Dimension_cache const &d)
+{
+ clear ();
+ offset_ = d.offset_ ? new Real (*d.offset_) : 0;
+ parent_ = d.parent_;
+ extent_ = d.extent_ ? new Interval (*d.extent_) : 0;
+ return *this;
+}
+
Dimension_cache::Dimension_cache ()
{
init ();
}
Grob::Grob (Grob const &s)
- : dim_cache_ (s.dim_cache_)
{
original_ = (Grob *) & s;
self_scm_ = SCM_EOL;
immutable_property_alist_ = s.immutable_property_alist_;
mutable_property_alist_ = SCM_EOL;
+
+ for (Axis a = X_AXIS; a < NO_AXES; incr (a))
+ dim_cache_ [a] = s.dim_cache_ [a];
+
interfaces_ = s.interfaces_;
object_alist_ = SCM_EOL;
friend class Grob;
Dimension_cache (Dimension_cache const &);
+ Dimension_cache & operator = (Dimension_cache const &d);
~Dimension_cache ();
Dimension_cache ();
};