Opened 10 years ago
Last modified 4 years ago
#7189 closed Bugs
[gil] conflict between boost range and boost gil — at Initial Version
Reported by: | Owned by: | Hailin Jin | |
---|---|---|---|
Milestone: | To Be Determined | Component: | gil USE GITHUB |
Version: | Boost 1.51.0 | Severity: | Problem |
Keywords: | Cc: | mateusz@… |
Description
The following does not compile because it cannot be resolved whether a call to boost::range::fill_n or std::fill_n is correct
#include <boost/array.hpp> #include <boost/gil/image_view.hpp> #include <boost/gil/image.hpp> #include <boost/gil/typedefs.hpp>
#include <boost/range/algorithm/fill_n.hpp>
namespace gil = boost::gil;
int main( int argc, char argv) {
gil::image<boost::array<float,2> > img;
std::fill( gil::view(img).begin(), gil::view(img).end(), boost::array<float,2>() );
}
Error:
[100%] Building CXX object CMakeFiles/test_misc.dir/test_misc.cpp.o In file included from /usr/include/boost/gil/image.hpp:29:0,
from /media/data2TB/data_win/Code/weavepattern/ActiveGrid/tests/test_misc.cpp:3:
/usr/include/boost/gil/algorithm.hpp: In function ‘void std::fill(boost::gil::iterator_from_2d<IL>, boost::gil::iterator_from_2d<IL>, const V&) [with IL = boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::array<float, 2ul>*> >, V = boost::array<float, 2ul>]’: /media/data2TB/data_win/Code/weavepattern/ActiveGrid/tests/test_misc.cpp:14:86: instantiated from here /usr/include/boost/gil/algorithm.hpp:382:13: error: call of overloaded ‘fill_n(boost::array<float, 2ul>*&, std::ptrdiff_t&, const boost::array<float, 2ul>&)’ is ambiguous /usr/include/boost/gil/algorithm.hpp:382:13: note: candidates are: /usr/include/c++/4.6/bits/stl_algobase.h:775:5: note: _OI std::fill_n(_OI, _Size, const _Tp&) [with _OI = boost::array<float, 2ul>*, _Size = long int, _Tp = boost::array<float, 2ul>] /usr/include/boost/range/algorithm/fill_n.hpp:31:22: note: ForwardRange& boost::range::fill_n(ForwardRange&, Size, const Value&) [with ForwardRange = boost::array<float, 2ul>*, Size = long int, Value = boost::array<float, 2ul>] /usr/include/boost/range/algorithm/fill_n.hpp:41:28: note: const ForwardRange& boost::range::fill_n(const ForwardRange&, Size, const Value&) [with ForwardRange = boost::array<float, 2ul>*, Size = long int, Value = boost::array<float, 2ul>] make[3]: * [CMakeFiles/test_misc.dir/test_misc.cpp.o] Error 1