[geos-commits] [SCM] GEOS branch main updated. 8d2e1bd90d17f8f9fe01fd1976087c2ad02faa80
git at osgeo.org
git at osgeo.org
Tue Feb 4 22:21:13 PST 2025
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 8d2e1bd90d17f8f9fe01fd1976087c2ad02faa80 (commit)
from b77f7fa6fb4161f3587eba1b6e7f00197ce46bc5 (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 8d2e1bd90d17f8f9fe01fd1976087c2ad02faa80
Author: Martin Davis <mtnclimb at gmail.com>
Date: Tue Feb 4 22:20:49 2025 -0800
Refine doc for pass-by-reference
diff --git a/DEVELOPER-NOTES.md b/DEVELOPER-NOTES.md
index 516dc2cb1..a718b815f 100644
--- a/DEVELOPER-NOTES.md
+++ b/DEVELOPER-NOTES.md
@@ -72,9 +72,12 @@ public:
### Function Parameter calling conventions
-* Prefer passing values by reference (`Geometry&`) instead of pointer (`Geometry*`),
- particularly for API (public) functions
- * Note: many GEOS API functions use pass-by-pointer, but this is just historical baggage
+* Objects which are passed as read-only with no transfer of ownership
+ should be passed as `const` references (`const Geometry&`).
+ * in particular, this applies to Geometry objects passed to API operations
+ (in static functions, class constructors, or initialization methods)
+ * NOTE: many GEOS API functions use pass-by-pointer (`Geometry*`), but this is historical baggage
+ * for the common case of passing a `std::unique_ptr<Geometry> foo` the argument will be `*foo`
* Pass-by-pointer can be used if the argument may be NULL (this is rare for API functions)
### Avoid Many Small Heap Allocations
-----------------------------------------------------------------------
Summary of changes:
DEVELOPER-NOTES.md | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
hooks/post-receive
--
GEOS
More information about the geos-commits
mailing list