[BUG] Consider using inline constexpr
for the large sEdgeGroupTable
table defined in VolumeToMesh.h
#1896
Labels
inline constexpr
for the large sEdgeGroupTable
table defined in VolumeToMesh.h
#1896
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.)
The text was updated successfully, but these errors were encountered: