ossia: handle std::vector<bool> in to_ossia_value - #178
Merged
Conversation
std::vector<bool> satisfies avnd::vector_ish, so the generic container overload is selected and calls to_ossia_value_impl on f[i]. On libstdc++ vector<bool>::const_reference is plainly bool, so that resolves to the bool overload and works by accident. On libc++ it is the proxy class std::__bit_const_reference, which is neither integral, nor bool, nor a container: it matches none of the constrained overloads and binds to the deleted catch-all operator()(const auto&) by identity, so the build fails with 'call to deleted function call operator'. Add a dedicated std::vector<bool> overload that materializes each element to bool. Being a non-template exact match it is preferred over the vector_ish template, and nothing else changes. Found building ossia/score on macOS (Apple clang / libc++), where Avnd_ossia_value_Test failed to compile. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
jcelerier
force-pushed
the
fix/vector-bool-libcxx
branch
from
July 22, 2026 15:23
8082936 to
a1f9cb4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
std::vector satisfies
avnd::vector_ish, so the generic container overload at to_value.hpp:182 is selected and callsto_ossia_value_implonf[i].vector<bool>::const_referenceis plainlybool, so that resolves to thebooloverload and works by accident.std::__bit_const_reference<std::vector<bool>>, which is neither integral, norbool, nor a container. It matches none of the constrained overloads and binds to the deleted catch-alloperator()(const auto&)by identity (exact match beats the user-defined conversion tobool), so the build fails withcall to deleted function call operator.This adds a dedicated
std::vector<bool>overload that materializes each element tobool. Being a non-template exact match it is preferred over thevector_ishtemplate with no ambiguity, and nothing changes for any other type. (Astatic_cast<value_type>inside the generic loop would also work but would force a copy of every element for all container types.)Found while building ossia/score on macOS (Apple clang / libc++), where
Avnd_ossia_value_Testfailed to compile — the round-trip test atfrom_ossia_value_Test.cpp:300exercises astd::vector<bool>parameter.Verified: compiles and links cleanly on Linux/libstdc++ (no regression); the fix removes the proxy from the call entirely so it resolves identically on both standard libraries.
🤖 Generated with Claude Code