id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc
8896,image_view compile error under clang 3.1,Shaun Marko ,Stefan Seefeld,"The definition of template typename axis::iterator image_view::axis_iterator(const point& p) (image_view.hpp, line 139) confuses clang++ 3.8. The following program fails to compile.
'''Example program'''
{{{
#include
#include
using namespace boost;
using namespace gil;
int main(int argc, char **argv)
{
gray8_image_t img(2,2);
gray8_view_t vw(view(img));
gray8_view_t::point_t p(0,0);
gray8_view_t::axis<0>::iterator iter = vw.axis_iterator<0>(p);
std::cout << (*iter)[0] << std::endl;
return 0;
}
}}}
'''clang++ error:'''
{{{
clang++ -Wall -I/usr/local/include/ -c img.cpp
In file included from img.cpp:2:
In file included from /usr/local/include/boost/gil/gil_all.hpp:27:
In file included from /usr/local/include/boost/gil/algorithm.hpp:27:
/usr/local/include/boost/gil/image_view.hpp:139:104: error: reference to non-static member function must be called
template typename axis::iterator axis_iterator(const point_t& p) const { return _pixels.axis_iterator(p); }
^~~~~~~~~~~~~~~~~~~~~
img.cpp:12:47: note: in instantiation of function template specialization 'boost::gil::image_view, boost::mpl::range_c > > *> > >::axis_iterator<0>' requested here
gray8_view_t::axis<0>::iterator iter = vw.axis_iterator<0>(p);
^
In file included from img.cpp:2:
In file included from /usr/local/include/boost/gil/gil_all.hpp:27:
In file included from /usr/local/include/boost/gil/algorithm.hpp:27:
/usr/local/include/boost/gil/image_view.hpp:139:125: error: invalid operands to binary expression ('' and 'unsigned long')
template typename axis::iterator axis_iterator(const point_t& p) const { return _pixels.axis_iterator(p); }
~~~~~~~~~~~~~~~~~~~~~^~
2 errors generated.
*** [img.o] Error code 1
}}}
A patch is attached which works against clang 3.8 and gcc 4.2.1.
",Bugs,closed,Boost 1.69,gil USE GITHUB,Boost 1.54.0,Problem,fixed,image_view clang,smarko@… mateusz@…