kwiver icon indicating copy to clipboard operation
kwiver copied to clipboard

Unable to use basic for_each over image_set on windows

Open mattdawkins opened this issue 6 years ago • 3 comments

When image_set was just a basic vector< images > the below code was fine but now there's an ambigious resolution on operators== and !=:

for( auto query_image : *d->query_images )

C:\workspace\VIAME-Seal-GPU\packages\kwiver\sprokit\processes\core\perform_query_process.cxx(535): error C2666: 'std::operator !=': 3 overloads have similar conversions [C:\tmp\kv3\sprokit\processes\core\kwiver_processes.vcxproj] [C:\workspace\VIAME-Seal-GPU\build\kwiver.vcxproj]

I can resolve via ugly code:

for( vital::const_iterator< vital::image_container_sptr > query_image = d->query_images->begin(); query_image == d->query_images->end(); query_image++ )

changing const_iterator to iterator in above leads to first error, it probably needs operator overloads on the iterator class instead of base_iterator would be my guess of the best way to fix this despite some code duplication

mattdawkins avatar Nov 24 '19 01:11 mattdawkins

Is there an available branch that produces this error?

Purg avatar Dec 04 '19 19:12 Purg

Some of these ambiguity issues have been solved by removing some methods from the iterators, so this may have been fixed by now.

linus-sherrill avatar May 18 '20 20:05 linus-sherrill

Agreed that the expanded iterator code is not ideal but to address "changing const_iterator to iterator in above leads to first error" .. const_iterator should use cbegin and cend to be explicit.

You did mention in our extensive conversation about this issue yesterday that you are seeing it on kwiver master even though no one else is. Can you confirm the version of Visual Studio you are using to duplicate the error? Again, VS 2017 does not exhibit this behaviour on today's master.

dstoup avatar May 20 '20 16:05 dstoup