google / google/s2geometry

S2 library not namespaced

Open
#68 0 comments 6 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
2.7k
Forks
357
Avg merge
11h 4m
Merged PRs (30d)
1

Description

First off, thanks for the great library! It has been a joy to use!

My issue is that it was difficult getting S2 to work with my project due to it not being namespaced. Most primitive classes, typedefs, and structs in the S2 library (e.g. `S2Polygon`, `S2CellId`, `S2Point`), as well as some classes with common names in `//utils` (e.g. `Varint`, `Vector3_d`) are declared in the global namespace. These can lead to conflicts, or even if they don't, should generally not be in a global namespace. Similarly for many of the macros and functions in `//base` (especially `//base/port.h`), or for `//base/mutex.h` which appears to collide with any target including its own `absl/synchronization/mutex.h`.

It would be nice if all code was wrapped in `namespace s2` or similar, and all global macros had an `S2_` prefix.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.