[gil] Compilation errors with MSVC10
Hi there, there seems to be some problems with the new MSVC10 compiler
and bit_aligned images in gil. The following was compiling fine before
I started using MSVC10. Here is some sample code:
#include <vector>
#include <algorithm>
#include
Hi there again, a bit more information.
MSVC10 is complaining about that it cannot find the correct copy
algorithm implementation since for some reason the iterator categories
are messed up in its opinion. I doubt that. Here is why:
Copy takes an input and output interator type. My input type is:
bit_aligned_pixel_iterator< const pixel_t >.
The output is:
bit_aligned_pixel_iterator< pixel_t >.
Obviously the iterator category for both types is the same and when
asked for it results into:
boost::detail::iterator_category_with_traversalstd::input_iterator_tag,boost::random_access_traversal_tag.
Now when calling copy the compiler eventually has to decide what copy
implementation to use based on the iterator categories. For reasons I
don't understand right now it cannot choose between:
_OutIt std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::input_iterator_tag,std::output_iterator_tag)
_OutIt std::_Copy_impl<_InIt,_OutIt>(_InIt,_InIt,_OutIt,std::random_access_iterator_tag,std::random_access_iterator_tag)
I would think the second one is the one to go with. I'm pretty sure
this behavior is new with MSVC10 and I cannot recall this problem with
older MSVCs. Unfortunately I don't have access to older versions right
now.
Anyone can help me out here?
Here some simple test code:
#include <vector>
#include <algorithm>
#include
Hi there, it seems I'm not the only having issues. I found a thread online and it helped me overcome the problem by setting #define _HAS_ITERATOR_DEBUGGING 0 in front of my code. As it turns out release configuration works fine but debug is failing. It could be a general problem with boost::iterator_facade from my standpoint. Now this is not a workaround I would like to add to my boost submission of the new gil::io. Anyone having more insight? Thanks, Christian PS: Here the link to the thread explaining a similar problem to mine: http://old.nabble.com/-repost--multiarray--Bug-with-boost::detail::multi_arr...
2010/5/30 Christian Henning
Hi there, it seems I'm not the only having issues. I found a thread online and it helped me overcome the problem by setting
#define _HAS_ITERATOR_DEBUGGING 0
in front of my code. As it turns out release configuration works fine but debug is failing. It could be a general problem with boost::iterator_facade from my standpoint.
Now this is not a workaround I would like to add to my boost submission of the new gil::io. Anyone having more insight?
Thanks, Christian
PS: Here the link to the thread explaining a similar problem to mine:
http://old.nabble.com/-repost--multiarray--Bug-with-boost::detail::multi_arr... _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Hi Christian, unfortunately not more insight, but I just tested your code sample with MSVC8 (aka VS2005) and MSVC9 (aka VS2008) and it compiles in both cases with no errors. However, I get the following warning: warning C4996: 'std::copy': Function call with parameters that may be unsafe - this call relies on the caller to check that the passed values are correct. To disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to use Visual C++ 'Checked Iterators' 1> c:\program files\microsoft visual studio 9.0\vc\include\xutility(2550) : see declaration of 'std::copy' Hope that helps Peter
participants (2)
-
Christian Henning
-
Peter Goetz