On 04/02/16 13:44 +0100, Sandro Mani wrote:
On 04.02.2016 13:40, Jakub Jelinek wrote:
>On Thu, Feb 04, 2016 at 01:36:50PM +0100, Sandro Mani wrote:
>>Med builds are failing with
>>medfile_int_wrap.cc:11272:30: error: no matching function for call to
std::vector<double, std::allocator<double> > > >&)'
>> result = (arg1)->erase(arg2);
>>A standalone version which fails to compile (ignoring the fact that arg2 is not
>>GCC 5 compiles the code. GCC6 seems to require an explicit cast, even though
>>std::vector<double>::iterator it = arg2;
>>works. GCC bug?
>GCC 5 fails the same way if you compile with -std=c++11 or -std=c++14,
>the latter is the default for GCC 6.
So in short, an explicit cast is needed?
Yes, with an explicit cast to vector<T>::iterator the code is valid in
C++03 and C++11. For the C++11 case only one implicit conversion will
be needed to get a const_iterator, so it will compile.