| ... | @@ -15,8 +15,51 @@ |
... | @@ -15,8 +15,51 @@ |
|
|
|
|
|
|
|
## Changes in definition
|
|
## Changes in definition
|
|
|
|
|
|
|
|
|
- Replaced previous use of `contiguous<T>()` as a global function with
|
|
|
|
`is_contiguous<T>' as a traits class. For some advanced user code,
|
|
|
|
this can be a breaking change, but greatly improves the ability to
|
|
|
|
define general traits and to inherit from them.
|
|
|
|
|
|
|
|
Previously something like the following was required:
|
|
|
|
```
|
|
|
|
template<>
|
|
|
|
bool contiguous<FixedList<bool, 2>>() { return true; }
|
|
|
|
|
|
|
|
template<>
|
|
|
|
bool contiguous<FixedList<int_8, 2>>() { return true; }
|
|
|
|
...
|
|
|
|
```
|
|
|
|
This repetitious and error-prone definition is now replaced with a
|
|
|
|
more direct and succinct form:
|
|
|
|
```
|
|
|
|
template<class T, unsigned N>
|
|
|
|
struct is_contiguous<FixedList<T, N>> : struct is_contiguous<T> {};
|
|
|
|
```
|
|
|
|
|
|
|
|
An future benefit of the new structure is that it provides a static
|
|
|
|
constexpr `value`, which allows its use in template expressions.
|
|
|
|
|
|
|
|
The change in definition is accompanied by a slight name change from
|
|
|
|
`contiguous` to `is_contiguous`, which should assist in identifying
|
|
|
|
upgraded code.
|
|
|
|
|
|
|
|
When defining the contiguous characteristics, the `is_contiguous_label`
|
|
|
|
and the `is_contiguous_scalar` forms may also be relevant.
|
|
|
|
These are special traits for handling data of homogeneous components
|
|
|
|
of the respective types.
|
|
|
|
|
|
|
|
|
|
|
## Changes in behaviour
|
|
## Changes in behaviour
|
|
|
|
|
|
|
|
|
- The addition of an optional match type (LITERAL vs REGEX) for
|
|
|
|
dictionary::subOrEmptyDict()
|
|
|
|
- old: `subOrEmptyDict(key, bool=false)`
|
|
|
|
- new: `subOrEmptyDict(key, keyType::option=keyType::REGEX, bool=false)`
|
|
|
|
|
|
|
|
This presents a minor breaking change for code that used the bool parameter
|
|
|
|
to specify mandatory vs. non-mandatory existence.
|
|
|
|
|
|
|
|
|
|
|
## Namespace changes
|
|
## Namespace changes
|
|
|
|
|
|
|
|
[v1912-notes]: https://www.openfoam.com/releases/openfoam-v1912/ |
|
[v1912-notes]: https://www.openfoam.com/releases/openfoam-v1912/ |