OpenVDB - Sparse volume data structure and tools
Mozilla Public License 2.0
2.62k
stars
647
forks
source link
[BUG] Consider using `inline constexpr` for the large `sEdgeGroupTable` table defined in VolumeToMesh.h #1896
Open
jessey-git opened 2 weeks ago
Environment
Operating System: Windows or Linux Version / Commit SHA: OpenVDB 11 Other: MSVC C++17 or g++
Describe the bug
There is a large 3.2kb table defined in VolumeToMesh.h that will be included in each translation unit that includes this header and the table will remain duplicated in the final executable. There's a few other smaller tables as well. https://github.com/AcademySoftwareFoundation/openvdb/blob/master/openvdb/openvdb/tools/VolumeToMesh.h#L441
The proper, ODR-safe, way to define such tables inside headers is to use
inline constexpr
with C++17 onwards.To Reproduce
Using the
const
table:Expected behavior
Using the
inline constexpr
table:Additional context
(Add any other context about the problem here.)