NeoN
WIP Prototype of a modern OpenFOAM core
Loading...
Searching...
No Matches
Classes | Namespaces | Macros
exceptions.hpp File Reference
#include "NeoN/core/primitives/label.hpp"

Go to the source code of this file.

Classes

class  NeoN::Error
 Base class for consistent error representation. More...
 
class  NeoN::DimensionMismatch
 Error for handling two containers of incompatible lengths. More...
 

Namespaces

namespace  NeoN
 

Macros

#define NeoN_ASSERT_EQUAL_LENGTH(_op1, _op2)
 

Macro Definition Documentation

◆ NeoN_ASSERT_EQUAL_LENGTH

#define NeoN_ASSERT_EQUAL_LENGTH (   _op1,
  _op2 
)
Value:
auto s1 = static_cast<localIdx>(_op1.size()); \
auto s2 = static_cast<localIdx>(_op2.size()); \
if (s1 != s2) \
{ \
throw ::NeoN::DimensionMismatch( \
__FILE__, __LINE__, __func__, s1, s2, "expected equal dimensions" \
); \
}

Asserts that _op1 and _op2 have the same length.

Exceptions
DimensionMismatchif _op1 and _op2 differ in the number of rows or columns

Definition at line 98 of file exceptions.hpp.