Skip to content

Merge ResultValue with specializations#2499

Merged
asuessenbach merged 1 commit intoKhronosGroup:mainfrom
YaaZ:result-value
Feb 24, 2026
Merged

Merge ResultValue with specializations#2499
asuessenbach merged 1 commit intoKhronosGroup:mainfrom
YaaZ:result-value

Conversation

@YaaZ
Copy link
Copy Markdown
Contributor

@YaaZ YaaZ commented Feb 21, 2026

Implementation of ResultValue diverged with its specializations for unique handles: base class has std::expected-like functions and specializations have asTuple() function. The specializations are mostly boilerplate, as they are identical, with exception of the specialized type, meaning that they can easily be merged with the base class.

So I brought rvalue variant of asTuple() into the base class and dropped the specializations.
This means that I have also dropped lvalue asTuple() variant, which was deprecated for a few years already: #1605
This should hopefully simplify the maintenance without needing to keep the base class and specializations in sync.

And it also helps with other use cases, like ResultValue<std::pair<...>> variant (YaaZ/VulkanMemoryAllocator-Hpp#78), which would otherwise require one more specialization.

Note that I did not run the generator - clang-format gave me a crazy diff for some reason, so I patched vulkan.hpp by hand.

@asuessenbach
Copy link
Copy Markdown
Contributor

That's a nice little simplification.
I like it, when there's more code removed than added ;)

Thanks for your contribution.

@asuessenbach asuessenbach merged commit 249794f into KhronosGroup:main Feb 24, 2026
25 checks passed
@YaaZ YaaZ deleted the result-value branch February 24, 2026 08:07
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

Successfully merging this pull request may close these issues.

2 participants