mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-07-29 20:14:01 +00:00
Add a few suggestions to coding guideline (#1238)
* Add a few suggestions to coding guideline
This commit is contained in:
parent
c96049fe4a
commit
051ee681a3
1 changed files with 3 additions and 0 deletions
|
|
@ -23,6 +23,9 @@ Other
|
|||
* When adding a new class, disable copy/assignment/move until you have a proven need for these capabilities. If a need arises, enable copy/assignment/move selectively, and when doing so validate that the implementation of the class supports what is being enabled.
|
||||
* Use ORT_DISALLOW_COPY_ASSIGNMENT_AND_MOVE initially
|
||||
* See the other ORT_DISALLOW_* macros in https://github.com/microsoft/onnxruntime/blob/master/include/onnxruntime/core/common/common.h
|
||||
* Don't use else after return. see: [https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return](https://llvm.org/docs/CodingStandards.html#don-t-use-else-after-a-return)
|
||||
* Don't overuse std::shared\_ptr. Use std::shared\_ptr only if it's not clear when and where the object will be deallocated. See also: [https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-shared_ptr](https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines#Rf-shared_ptr)
|
||||
* Avoid using the 'long' type, which could be either 32 bits or 64 bits.
|
||||
|
||||
#### Clang-format
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue