mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 04:23:48 -06:00
Declare operator?() as 'const'.
None of operator+(), operator-(), operator*() or operator/() modify their object. These methods are thus naturally declared as 'const'.
This commit is contained in:
parent
0a43fe68dd
commit
bd240a31cb
@ -76,7 +76,7 @@ namespace AutoDiff
|
||||
}
|
||||
|
||||
/// Operator +
|
||||
ForwardBlock operator+(const ForwardBlock& rhs)
|
||||
ForwardBlock operator+(const ForwardBlock& rhs) const
|
||||
{
|
||||
std::vector<M> jac = jac_;
|
||||
assert(numBlocks() == rhs.numBlocks());
|
||||
@ -90,7 +90,7 @@ namespace AutoDiff
|
||||
}
|
||||
|
||||
/// Operator -
|
||||
ForwardBlock operator-(const ForwardBlock& rhs)
|
||||
ForwardBlock operator-(const ForwardBlock& rhs) const
|
||||
{
|
||||
std::vector<M> jac = jac_;
|
||||
assert(numBlocks() == rhs.numBlocks());
|
||||
@ -104,7 +104,7 @@ namespace AutoDiff
|
||||
}
|
||||
|
||||
/// Operator *
|
||||
ForwardBlock operator*(const ForwardBlock& rhs)
|
||||
ForwardBlock operator*(const ForwardBlock& rhs) const
|
||||
{
|
||||
int num_blocks = numBlocks();
|
||||
std::vector<M> jac(num_blocks);
|
||||
@ -121,7 +121,7 @@ namespace AutoDiff
|
||||
}
|
||||
|
||||
/// Operator /
|
||||
ForwardBlock operator/(const ForwardBlock& rhs)
|
||||
ForwardBlock operator/(const ForwardBlock& rhs) const
|
||||
{
|
||||
int num_blocks = numBlocks();
|
||||
std::vector<M> jac(num_blocks);
|
||||
|
Loading…
Reference in New Issue
Block a user