gnzlbg / static_vector

A dynamically-resizable vector with fixed capacity and embedded storage
https://gnzlbg.github.io/static_vector
167 stars 21 forks source link

Cannot be used in constexpr function because of missing constexpr destructor #46

Open thmxv opened 4 years ago

thmxv commented 4 years ago

When trying to use fixed_capacity_vector in a constexpr function in C++20. The compilation failed because fixed_capacity_vector is not a literal type because it is missing a constexpr destructor.

After marking the existing destructors constexpr and adding copnstexpr ~type_name() = default; to several types, the issue was solved.

Is there any chances to get those changes in the main branch?

thmxv commented 4 years ago

Apparently this was a compiler issue with early C++20 support. It looks like it is working fine now.