Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

uuid no longer constexpr contructable #161

Open
tobias-loew opened this issue Jul 26, 2024 · 6 comments
Open

uuid no longer constexpr contructable #161

tobias-loew opened this issue Jul 26, 2024 · 6 comments

Comments

@tobias-loew
Copy link

Before version 1.85 uuid was an aggreagate and could be constexpr constructed from a sequence of bytes.
With version 1.85 this is no longer possible.
(I've got user-defined literal which converts uuid string-representation at compile-time into uuids that no longer works with 1.85.)

@pdimov
Copy link
Member

pdimov commented Jul 26, 2024

Indeed, thanks for the report. I'll see if I can fix this between the beta and the release, as it's not as easy as just adding a constexpr to the constructor because std::memcpy isn't always constexpr.

@tobias-loew
Copy link
Author

Another minor regression: before .data returned a reference to the array. Migration would be easier having a data() method returning a reference or a std::span to the byte representation.

@pdimov
Copy link
Member

pdimov commented Jul 29, 2024

For a contiguous container, data() by convention returns a pointer to the first element. It's in principle possible to return a reference to the array which will decay to a pointer but that's a bit too inventive.

Although maybe if the constructor is constexpr, data() should be, too.

@Osyotr
Copy link

Osyotr commented Aug 21, 2024

It's also no longer trivial: https://godbolt.org/z/sb8K6YTz7
Probably because of this line:

data_type data = {};

@pdimov
Copy link
Member

pdimov commented Aug 21, 2024

It's still trivially copyable and standard layout, but no longer trivial (because the default constructor doesn't leave it uninitialized) or POD.

@pdimov
Copy link
Member

pdimov commented Sep 22, 2024

Construction should be constexpr now on develop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants