0

I was on an earlier version of VS2019 (16.2 I believe) and upgraded to 16.6 yesterday and suddenly working code is throwing compiler errors and I can't figure out how to clear them up.

I have the following code:

std::vector<ClusterData> run( const std::vector<PointData>& pointsData, uint32_t K, uint32_t max_iterations )
{
    std::vector<Point> points = ranges::view::transform( pointsData, 
           []( const auto& data ) { return Point{ &data }; } );
    ...
}

This worked just fine in 16.2 but now throws the following error:

no suitable user-defined conversion from 
"ranges::v3::transform_view<ranges::v3::iterator_range<ranges::v3::detail::decay_t<std::_Vector_const_iterator<std::_Vector_val<std::conditional_t<true, 
std::_Simple_types<smp::utils::kmeans::PointData>, 
std::_Vec_iter_types<smp::utils::kmeans::PointData, size_t, ptrdiff_t, 
smp::utils::kmeans::PointData *, const smp::utils::kmeans::PointData *,
 smp::utils::kmeans::PointData &, const smp::utils::kmeans::PointData &>>>>>, ranges::v3::detail::decay_t<std::_Vector_const_iterator<std::_Vector_val<std::conditional_t<true, std::_Simple_types<smp::utils::kmeans::PointData>,
 std::_Vec_iter_types<smp::utils::kmeans::PointData, size_t, ptrdiff_t, smp::utils::kmeans::PointData *, const smp::utils::kmeans::PointData *, 
smp::utils::kmeans::PointData &, const smp::utils::kmeans::PointData &>>>>>>, type>" 
to "std::vector<<unnamed>::Point, std::allocator<<unnamed>::Point>>" exists

I cannot figure out how to do an assignment from ranges::view::transform to a vector<> of any type.

Not sure if typechecking/casting got stricter or if something in the implementation of std::ranges changed. Any help you guys have would be greatly appreciated.

Mordred
  • 3,734
  • 3
  • 36
  • 55
  • Can we get a [mre]? Enough code, including headers, so that we can just copy and paste it? – 1201ProgramAlarm May 29 '20 at 01:04
  • @1201ProgramAlarm While attempting to create a MRE, I realized that the problem is almost assuredly related to using an outdated version of ranges/v3, instead of the experimental ranges enabled by using /std:latest. – Mordred May 29 '20 at 03:58

0 Answers0