You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cpp11::preserved relies on the list_ data member having a well-defined value at the time preserved is accessed. Since the order of construction of globals is not guaranteed in c++, that can lead to undefined behavior if you're constructing (for example) a global cpp11::strings since that appends to preserved in the constructor.
namespace {
// the value of `cpp11::preserved.list_` is not guaranteed here!
cpp11::strings kColorStrings = cpp11::writable::strings({
"red",
"green",
"blue",
});
} // namespace
The text was updated successfully, but these errors were encountered:
cpp11::preserved
relies on thelist_
data member having a well-defined value at the timepreserved
is accessed. Since the order of construction of globals is not guaranteed in c++, that can lead to undefined behavior if you're constructing (for example) a globalcpp11::strings
since that appends topreserved
in the constructor.The text was updated successfully, but these errors were encountered: