mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Fix formatting of CodingConventions.md.
The current page has some issue: https://gitlab.kitware.com/vtk/vtk-m/blob/master/docs/CodingConventions.md
This commit is contained in:
parent
48c31b57a2
commit
024b8a3067
@ -41,22 +41,21 @@ coding and because we expect vtkm to have continual interaction with VTK.
|
||||
directory, with non alphanumeric characters, such as / and . replaced
|
||||
with underscores. The `#endif` part of the guard at the bottom of the
|
||||
file should include the guard name in a comment. For example, the
|
||||
vtkm/cont/ArrayHandle.h header contains the guard
|
||||
|
||||
```cpp
|
||||
#ifndef vtk_m_cont_ArrayHandle_h
|
||||
#define vtk_m_cont_ArrayHandle_h
|
||||
```
|
||||
at the top and
|
||||
```cpp
|
||||
#endif //vtk_m_cont_ArrayHandle_h
|
||||
```
|
||||
at the bottom.
|
||||
vtkm/cont/ArrayHandle.h header contains the guard demostrated below.
|
||||
|
||||
The unique use of vtk_m over vtkm is to allow auto-complete engines the
|
||||
ability to differentiate between the header guards and VTKM_ macros
|
||||
that are used within the code base.
|
||||
|
||||
```cpp
|
||||
#ifndef vtk_m_cont_ArrayHandle_h
|
||||
#define vtk_m_cont_ArrayHandle_h
|
||||
|
||||
// All ArrayHandle code here
|
||||
|
||||
#endif //vtk_m_cont_ArrayHandle_h
|
||||
```
|
||||
|
||||
+ The VTK-m toolkit has several nested namespaces. The declaration of
|
||||
each namespace should be on its own line, and the code inside the
|
||||
namespace bracket should not be indented. The closing brace at the
|
||||
@ -170,7 +169,7 @@ for (auto v : vector)
|
||||
or detail class clearly associated with it, the reference can be
|
||||
shortened to `internal::` or `detail::`.
|
||||
|
||||
+ use `this->` inside of methods when accessing class methods and
|
||||
+ Use `this->` inside of methods when accessing class methods and
|
||||
instance variables to distinguish between local variables and instance
|
||||
variables.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user