[geos-commits] [SCM] GEOS branch main updated. feb4459969212ced293e4ead339dc95457631bcc

git at osgeo.org git at osgeo.org
Fri Nov 8 14:56:32 PST 2024


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GEOS".

The branch, main has been updated
       via  feb4459969212ced293e4ead339dc95457631bcc (commit)
      from  52f36cb2819010b43deb182e2aa3a7bb3e0a6bbc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit feb4459969212ced293e4ead339dc95457631bcc
Author: Martin Davis <mtnclimb at gmail.com>
Date:   Fri Nov 8 14:56:11 2024 -0800

    Update developer notes

diff --git a/DEVELOPER-NOTES.md b/DEVELOPER-NOTES.md
index b81594b60..bfa94f66f 100644
--- a/DEVELOPER-NOTES.md
+++ b/DEVELOPER-NOTES.md
@@ -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;
+```
\ No newline at end of file

-----------------------------------------------------------------------

Summary of changes:
 DEVELOPER-NOTES.md | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)


hooks/post-receive
-- 
GEOS


More information about the geos-commits mailing list