Forked from
Core Modules / dune-common
Source project has a limited visibility.
-
Martin Nolte authored
DenseVector is the base class of a CRTP. This is kind of an abstract class that works only if it can be casted into a derived type. Copying the base class is pointless. This patch marks the copy constructor of DenseVector private (not even implementing it), so that it cannot be called anymore. Once we have a DUNE_DELETE macro, we should use it, here. At the same time, the default constructor is marked protected, so that only derived classes can instantiate a DenseVector. Notice that this does not prevent the user from building a derivced class which does not pass itself as implementation to DenseVector. It is (to my knowledge) not possible to make CRTPs completely fail-safe.
Martin Nolte authoredDenseVector is the base class of a CRTP. This is kind of an abstract class that works only if it can be casted into a derived type. Copying the base class is pointless. This patch marks the copy constructor of DenseVector private (not even implementing it), so that it cannot be called anymore. Once we have a DUNE_DELETE macro, we should use it, here. At the same time, the default constructor is marked protected, so that only derived classes can instantiate a DenseVector. Notice that this does not prevent the user from building a derivced class which does not pass itself as implementation to DenseVector. It is (to my knowledge) not possible to make CRTPs completely fail-safe.