Skip to content

Commit

Permalink
Bugfix: Remove explicit default destructor from core classes (#413)
Browse files Browse the repository at this point in the history
Fixes #329 so C++20 aggregate initialization can be used.

---------

Co-authored-by: David Gardner <gardner48@llnl.gov>
  • Loading branch information
balos1 and gardner48 authored Feb 7, 2024
1 parent 99cf619 commit 0def400
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 25 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ sundials_dense.h
sundials_band.h
```

### Minor Changes

Fixed [#329](https://github.com/LLNL/sundials/issues/329) so that C++20 aggregate initialization can be used.

## Changes to SUNDIALS in release 6.7.0

Added the `SUNAdaptController` base class, ported ARKODE's internal
Expand Down
5 changes: 5 additions & 0 deletions doc/arkode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,11 @@ rely on these are recommended to transition to the corresponding :c:type:`SUNMat
sundials_dense.h
sundials_band.h
**Minor changes**

Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Changes in v5.7.0
-----------------

Expand Down
5 changes: 5 additions & 0 deletions doc/cvode/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
sundials_dense.h
sundials_band.h
**Minor changes**

Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Changes in v6.7.0
-----------------

Expand Down
5 changes: 5 additions & 0 deletions doc/cvodes/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,11 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
sundials_dense.h
sundials_band.h
**Minor changes**

Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Changes in v6.7.0
-----------------

Expand Down
5 changes: 5 additions & 0 deletions doc/ida/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
sundials_dense.h
sundials_band.h
**Minor changes**

Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Changes in v6.7.0
-----------------

Expand Down
5 changes: 5 additions & 0 deletions doc/idas/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,11 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
sundials_dense.h
sundials_band.h
**Minor changes**

Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Changes in v5.7.0
-----------------

Expand Down
5 changes: 5 additions & 0 deletions doc/kinsol/guide/source/Introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,11 @@ corresponding :c:type:`SUNMatrix` and :c:type:`SUNLinearSolver` modules:
sundials_dense.h
sundials_band.h
**Minor changes**

Fixed `GitHub Issue #329 <https://github.com/LLNL/sundials/issues/329>`_ so
that C++20 aggregate initialization can be used.

Changes in v6.7.0
-----------------

Expand Down
6 changes: 0 additions & 6 deletions include/sundials/sundials_linearsolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ struct _generic_SUNLinearSolver_Ops
SUNErrCode (*space)(SUNLinearSolver, long int*, long int*);
N_Vector (*resid)(SUNLinearSolver);
SUNErrCode (*free)(SUNLinearSolver);
#ifdef __cplusplus
_generic_SUNLinearSolver_Ops() = default;
#endif
};

/* A linear solver is a structure with an implementation-dependent
Expand All @@ -141,9 +138,6 @@ struct _generic_SUNLinearSolver
void* content;
SUNLinearSolver_Ops ops;
SUNContext sunctx;
#ifdef __cplusplus
_generic_SUNLinearSolver() = default;
#endif
};

/* -----------------------------------------------------------------
Expand Down
6 changes: 0 additions & 6 deletions include/sundials/sundials_matrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ struct _generic_SUNMatrix_Ops
SUNErrCode (*matvecsetup)(SUNMatrix);
SUNErrCode (*matvec)(SUNMatrix, N_Vector, N_Vector);
SUNErrCode (*space)(SUNMatrix, long int*, long int*);
#ifdef __cplusplus
_generic_SUNMatrix_Ops() = default;
#endif
};

/* A matrix is a structure with an implementation-dependent
Expand All @@ -107,9 +104,6 @@ struct _generic_SUNMatrix
void* content;
SUNMatrix_Ops ops;
SUNContext sunctx;
#ifdef __cplusplus
_generic_SUNMatrix() = default;
#endif
};

/* -----------------------------------------------------------------
Expand Down
6 changes: 0 additions & 6 deletions include/sundials/sundials_nonlinearsolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,6 @@ struct _generic_SUNNonlinearSolver_Ops
SUNErrCode (*getnumiters)(SUNNonlinearSolver, long int*);
SUNErrCode (*getcuriter)(SUNNonlinearSolver, int*);
SUNErrCode (*getnumconvfails)(SUNNonlinearSolver, long int*);
#ifdef __cplusplus
_generic_SUNNonlinearSolver_Ops() = default;
#endif
};

/* A nonlinear solver is a structure with an implementation-dependent 'content'
Expand All @@ -126,9 +123,6 @@ struct _generic_SUNNonlinearSolver
void* content;
SUNNonlinearSolver_Ops ops;
SUNContext sunctx;
#ifdef __cplusplus
_generic_SUNNonlinearSolver() = default;
#endif
};

/* -----------------------------------------------------------------------------
Expand Down
7 changes: 0 additions & 7 deletions include/sundials/sundials_nvector.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,6 @@ struct _generic_N_Vector_Ops
/* Debugging functions (called when SUNDIALS_DEBUG_PRINTVEC is defined). */
void (*nvprint)(N_Vector);
void (*nvprintfile)(N_Vector, FILE*);

#ifdef __cplusplus
_generic_N_Vector_Ops() = default;
#endif
};

/* A vector is a structure with an implementation-dependent
Expand All @@ -203,9 +199,6 @@ struct _generic_N_Vector
void* content;
N_Vector_Ops ops;
SUNContext sunctx;
#ifdef __cplusplus
_generic_N_Vector() = default;
#endif
};

/* -----------------------------------------------------------------
Expand Down

0 comments on commit 0def400

Please sign in to comment.