Skip to content

Commit

Permalink
Update developer notes
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-jts committed Nov 8, 2024
1 parent 52f36cb commit feb4459
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions DEVELOPER-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,25 @@ rather than:
### Use `pragma once` to limit header inclusion
Use `#pragma once` to limit header inclusion. It is simpler and faster.
### Use `using` to reduce namespace qualifiers
GEOS is organized into many nested namespaces to reflect the JTS package structure.
Namespace qualification of class references can be shortened
with the `using` keyword in two different ways:
In **header files**, `using` [type aliases](https://en.cppreference.com/w/cpp/language/type_alias) can be defined **inside class definitions**:
```
class OffsetCurve {
using Geometry = geom::Geometry;
...
}
```
In **implementation files**, `using` [declarations](https://en.cppreference.com/w/cpp/language/using_declaration) can be defined for classes or entire namespaces:
```
using geos::algorithm::Distance;
using namespace geos::geom;
```

0 comments on commit feb4459

Please sign in to comment.