trilinos / Trilinos

Primary repository for the Trilinos Project
https://trilinos.org/
Other
1.2k stars 563 forks source link

Teuchos: Move semantics for `Teuchos::any` and `Teuchos::ParameterEntry`. #11481

Open romintomasetti opened 1 year ago

romintomasetti commented 1 year ago

Enhancement

teuchos @bartlettroscoe

It seems that some Teuchos classes like any and ParameterEntry miss move semantics (constructor and assignment).

This might potentially be related to:

Here is a patch: teuchos-fix-add-missing-move-constructors.patch.txt

The patch has been fully tested (we run Teuchos, Tpetra, Stokhos tests on OpenMP, Cuda and HIP).

@maartenarnst

rppawlo commented 1 year ago

Teuchos::any should probably be deprecated in favor of std::any now that trilinos requires C++17.

romintomasetti commented 1 year ago

@rppawlo That would be even better! But it would require more effort (maybe) :smile:

bartlettroscoe commented 1 year ago

@romintomasetti, would you be open to posting a PR for these changes? (The move to std::any can come as a follow-on PR.)

romintomasetti commented 1 year ago

@bartlettroscoe Here you are: https://github.com/trilinos/Trilinos/pull/11484 :smile:

github-actions[bot] commented 9 months ago

This issue has had no activity for 365 days and is marked for closure. It will be closed after an additional 30 days of inactivity. If you would like to keep this issue open please add a comment and/or remove the MARKED_FOR_CLOSURE label. If this issue should be kept open even with no activity beyond the time limits you can add the label DO_NOT_AUTOCLOSE. If it is ok for this issue to be closed, feel free to go ahead and close it. Please do not add any comments or change any labels or otherwise touch this issue unless your intention is to reset the inactivity counter for an additional year.

romintomasetti commented 8 months ago

@rppawlo @bartlettroscoe Any plan to deprecate (or remove) Teuchos::any ?

rppawlo commented 8 months ago

@romintomasetti - we definitely should remove Teuchos::any now that we require c++17. No one is working on it as far as I know. If you wanted to remove it, feel free. Otherwise, we can bring it up at the weekly trilinos meeting.

romintomasetti commented 8 months ago

I think it would be nice to raise this as soon as possible in a Teuchos meeting.

I personally don't have enough time resources to do it, but I quickly looked at the feasibility.

It seems the only thing that is really far from std::any is https://github.com/trilinos/Trilinos/blob/f1aef01a78957e9a04965949c0d5a97fe182e93b/packages/teuchos/core/src/Teuchos_any.hpp#L316

Otherwise I don't see any major blocker.