mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: StaticAssert to avoid invalid sizing in DynamicField, DynamicList
This commit is contained in:
@ -44,6 +44,7 @@ SourceFiles
|
||||
#define DynamicList_H
|
||||
|
||||
#include "List.H"
|
||||
#include "StaticAssert.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -78,6 +79,9 @@ class DynamicList
|
||||
:
|
||||
public List<T>
|
||||
{
|
||||
//- Avoid invalid sizing parameters
|
||||
StaticAssert((SizeInc || SizeMult) && SizeDiv);
|
||||
|
||||
// Private data
|
||||
|
||||
//- The capacity (allocated size) of the underlying list.
|
||||
|
||||
@ -37,6 +37,7 @@ SourceFiles
|
||||
#define DynamicField_H
|
||||
|
||||
#include "Field.H"
|
||||
#include "StaticAssert.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -71,6 +72,9 @@ class DynamicField
|
||||
:
|
||||
public Field<T>
|
||||
{
|
||||
//- Avoid invalid sizing parameters
|
||||
StaticAssert((SizeInc || SizeMult) && SizeDiv);
|
||||
|
||||
// Private data
|
||||
|
||||
//- The capacity (allocated size) of the underlying field.
|
||||
|
||||
Reference in New Issue
Block a user