Commit 2dc30d9
Fix: Avoid passing
Summary:
Pull Request resolved: facebookincubator#13876
The expression `visited[node]` is of `std::vector<bool, Alloc>::reference` type, and some versions of `fmt` library doesn't handle it well under libc++ (P1850535374), especially when custom allocator is present. Since we are just comparing equality (no need for mutation) here, casting it to bool is the most straightforward fix.
Since `std::vector<bool>::const_reference` is just `bool`, I suspected that using `vector::at() const` will suffice here. However, that's not the case since the vector itself is non-const, causing overload resolution to choose the best overload, which is the non-const one, returning the `reference`, and the conversion becomes unavoidable again.
Reviewed By: vitaut, skrueger
Differential Revision: D77275081
fbshipit-source-id: fe6c5828accbd544e9c46818ca434cafecf09423std::vector<bool, Alloc>::reference to fmt (facebookincubator#13876)1 parent 597fbea commit 2dc30d9
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
741 | 741 | | |
742 | 742 | | |
743 | 743 | | |
744 | | - | |
| 744 | + | |
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
| |||
0 commit comments