heitzmann / gdstk

Gdstk (GDSII Tool Kit) is a C++/Python library for creation and manipulation of GDSII and OASIS files.
https://heitzmann.github.io/gdstk/
Boost Software License 1.0
324 stars 78 forks source link

Using `std::vector` instead of `Array` #259

Open rocallahan opened 1 week ago

rocallahan commented 1 week ago

The Array class has almost exactly the same functionality and implementation as std::vector, except that it requires manual cleanup via clear() instead of automatic destruction, and lacks various C++ conveniences like constructors and support for (element : array) syntax. Would you be open to PRs that replace Array usage with std::vector?

Pros: shorter, more idiomatic, somewhat safer C++ code Cons: would change the C++ API. Are you committed to preserving compatibility with the current API?

heitzmann commented 1 week ago

I don't really like the whole constructor/destructor machinery, but seeing as I have less and less time to dedicate to the project, this change might make it mora approachable to new contributors.

So, I'm open to "modernizing" the code as long as our benchmarks don't suffer significantly.