Skip to content
Snippets Groups Projects
Forked from Core Modules / dune-common
Source project has a limited visibility.
  • Martin Nolte's avatar
    d8ec10b4
    [bugfix] Prohibit copy constructor of DenseVector · d8ec10b4
    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.
    d8ec10b4
    History
    [bugfix] Prohibit copy constructor of DenseVector
    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.