During the work on PR #469 we realize that we do not cover all cases of assignment of DataStorages to DataStorages with different inner and outer const typs. We also not clarified which should be allowed and what not. This is the current state what is allowed, disallowed and unclear:
assignment: to = from
total 16 cases
4 cases:
| to |
from |
allowed |
comment |
DataStorage<int> |
DataStorage<int> |
Y |
|
DataStorage<int const> |
DataStorage<int> |
Y |
const view of mutable source -> hidden modification possible |
DataStorage<int> |
DataStorage<int const> |
X |
Allows to modify inner const source |
DataStorage<int const> |
DataStorage<int const> |
Y |
|
8 cases:
| to |
from |
allowed |
comment |
DataStorage<*> const |
* |
X |
general not allowed to reassign a const object (C++ rule) |
4 cases:
| to |
from |
allowed |
comment |
DataStorage<int> |
DataStorage<int> const |
X |
|
DataStorage<int const> |
DataStorage<int> const |
Y |
|
DataStorage<int> |
DataStorage<int const> const |
X |
|
DataStorage<int const> |
DataStorage<int const> const |
Y |
|
During the work on PR #469 we realize that we do not cover all cases of assignment of DataStorages to DataStorages with different inner and outer const typs. We also not clarified which should be allowed and what not. This is the current state what is allowed, disallowed and unclear:
assignment:
to = fromtotal 16 cases
4 cases:
DataStorage<int>DataStorage<int>DataStorage<int const>DataStorage<int>DataStorage<int>DataStorage<int const>DataStorage<int const>DataStorage<int const>8 cases:
DataStorage<*> const*4 cases:
DataStorage<int>DataStorage<int> constDataStorage<int const>DataStorage<int> constDataStorage<int>DataStorage<int const> constDataStorage<int const>DataStorage<int const> const