Fix using from_range with std::vector<>::const_iterator#2926
Fix using from_range with std::vector<>::const_iterator#2926horenmar merged 1 commit intocatchorg:develfrom
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## devel #2926 +/- ##
=======================================
Coverage 90.99% 90.99%
=======================================
Files 198 198
Lines 8597 8597
=======================================
Hits 7822 7822
Misses 775 775 |
|
Can you provide a reproducer? |
|
Hm, I see that I encounter this when I used yaml-cpp for parsing test cases. Simplyfied example is: #include <catch2/catch_test_macros.hpp>
#include <catch2/generators/catch_generators_range.hpp>
#include <yaml-cpp/yaml.h>
auto yaml = YAML::LoadFile("test.yaml");
TEST_CASE("test case") {
auto value = GENERATE(from_range(yaml));
} |
|
Hmmmm, I am pretty sure that's yaml-cpp being wrong, I opened up an issue: jbeder/yaml-cpp#1326 I'll have to think about whether I want to merge a workaround for now or not. |
|
Just an FYI, if yaml-cpp upstream doesn't react, I plan to merge this on Friday. |
This pull request addresses a compile error occurring when attempting to instantiate
std::vectorwith a constant value type.The issue arose in
catch_generators_range.hpp, whereResultTypewas defined as avalue_typeofconst_iteratorwithinGeneratorWrapper<ResultType>which is usuallyconst. This caused a conflict withstd::vector, which requires itsvalue_typeto be non-const.