Skip to content

Add an explicit specialization of container_hash::is_described_class … - #355

Merged
Lastique merged 1 commit into
developfrom
pr/path-not-described
Sep 29, 2026
Merged

Lastique merged 1 commit into
developfrom
pr/path-not-described

Conversation

@pdimov

@pdimov pdimov commented Sep 29, 2026

Copy link
Copy Markdown
Member

…for filesystem::path, because when reflection is available, path becomes a described class and the hash_value call becomes ambiguous

…for filesystem::path, because when reflection is available, path becomes a described class and the hash_value call becomes ambiguous
@Lastique

Copy link
Copy Markdown
Member

is_described_class isn't declared anywhere in Boost.Filesystem, and we don't include Boost.ContainerHash.

But I wonder if this should be necessary. Doesn't this PR indicate potential breakages in the users' code? Can the generic hash_value overload be made less preferable in overload resolution? For example, mark the argument as const volatile reference?

@pdimov

pdimov commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

It's declared in hash_fwd.hpp that's already being included, which is why I didn't include the declaration.

Yes, it does indicate potential breakage in user code. No, I won't add volatile to the reference. :-)

Specializing the ContainerHash classification traits is already the documented method of resolving such ambiguities. That's not a very common problem because user overloads are typically more specialized.

@Lastique
Lastique merged commit fe2461e into develop Sep 29, 2026
63 checks passed
@Lastique
Lastique deleted the pr/path-not-described branch September 29, 2026 19:01
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