View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003377 | OpenFOAM | Patch | public | 2019-10-30 14:51 | 2019-10-31 11:30 |
Reporter | handrake0724 | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | have not tried |
Status | closed | Resolution | no change required | ||
Product Version | dev | ||||
Summary | 0003377: autoPtr::New method | ||||
Description | in OpenFOAM-plus, it provide New static method in autoPtr and tmp container. when I have to use the following statement autoPtr<regExp>(new regExp(iter().keyword())) instead autoPtr::New method make it simple and less verbose as follows: autoPtr::New<regExp>(iter().keyword()) New method is implemented with parameter pack in C++11 spec so it is possible to implement it in OpenFOAM-dev. is there any reason not providing it? | ||||
Tags | No tags attached. | ||||
|
There is no particular reason for not providing it nor a clear reason to provide it, the benefit seems rather small. If you wanted to implement it and provide it for consideration we can do that or if you would like to fund us to work on it we can. |
|
In the philosophy of OpenFOAM platform as I understand, it prevents users from directly using pointers and calling new keyword by wrapping it with autoPtr, or tmp. in that sense, those wrappers can fill the gap by providing New method with the help of c++ 11 spec such that - avoid direct use of new keyword - eliminate duplicates as autoPtr<regExp>(new regExp(iter().keyword())) - improve readability a little It is just a little sugar and I agree with you in that the benefit may be small. patch is attached which is excerpted from OpenFOAM-plus implementation. |
|
> patch is attached which is excerpted from OpenFOAM-plus implementation. ESI choose not to contribute to OpenFOAM see https://openfoam.org/dev/contributors/ While you have signed the contributor agreement and can contribute code that you write it does not give you permission to contribute code written by others; you will need to ask them to sign the contributor agreement and contribute their code directly. |
|
If you think this patch will make dispute since it is taken from OpenFOAM-plus code, it is ok to disregard this patch. I am not sure if this template code can be implemented in the other way though. |
|
You cannot transfer the copyright of code you do not own. |
Date Modified | Username | Field | Change |
---|---|---|---|
2019-10-30 14:51 | handrake0724 | New Issue | |
2019-10-30 15:04 | henry | Note Added: 0010851 | |
2019-10-31 02:06 | handrake0724 | File Added: patch.diff | |
2019-10-31 02:06 | handrake0724 | Note Added: 0010853 | |
2019-10-31 08:28 | henry | Note Added: 0010854 | |
2019-10-31 08:37 | henry | File Deleted: patch.diff | |
2019-10-31 11:21 | handrake0724 | Note Added: 0010855 | |
2019-10-31 11:30 | henry | Assigned To | => henry |
2019-10-31 11:30 | henry | Status | new => closed |
2019-10-31 11:30 | henry | Resolution | open => no change required |
2019-10-31 11:30 | henry | Note Added: 0010856 |