Hi there my compiler doesn't like binding the gil::at_c function. I'm
using MSVC 7.1 SP1. Please correct if I'm wrong but I think you need
to supply a function pointer cast for overloaded function when using
this compiler. But for some reasons I cannot make it happen.
template < typename CHANNEL >
void set_zero( CHANNEL c )
{
c = 0;
}
int main()
{
rgb8_image_t src;
bmp_read_image( ".\\flower.bmp", src );
typedef channel_type::type return_t;
add_reference::type (*AA)( rgb8_pixel_t& ) = &gil::at_c<0>;
for_each( view( src ).begin()
, view( src ).end()
, bind( &set_zero, bind( AA, _1 )));
return 0;
}
compiler error is:
\gil\repos\gil_2\libs\gil\toolbox\test.cpp(74) : error C2440:
'initializing' : cannot convert from 'overloaded-function' to
'boost::add_reference<T>::type (__cdecl *)(boost::gil::rgb8_pixel_t
&)'
with
[
T=boost::gil::bits8
]
None of the functions with this name in scope match the target type
Thanks ahead,
Christian