Opened 6 years ago

Closed 5 years ago

#12698 closed Bugs (fixed)

base64 iterators can't be used with iterator_advance

Reported by: Johel Ernesto Guerrero Peña <johelegp@…> Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: serialization
Version: Boost 1.62.0 Severity: Problem
Keywords: Cc:

Description

#include <boost/container/string.hpp>
#include <boost/archive/iterators/binary_from_base64.hpp>

int main()
{
    using String = boost::container::string;
    using Iterator = boost::archive::iterators::binary_from_base64<String::iterator>;

    String s;
    s.assign(Iterator{s.begin()},Iterator{s.end()});
}

This code causes a compilation error because all overloads of iterator_advance in boost/intrusive/detail/iterator.hpp are disabled.

I tried changing the 54th line in boost/intrusive/detail/iterator.hpp from

      < ::boost::move_detail::is_same

to

      < ::boost::move_detail::is_convertible

because the transform_iterator synopsis mentions that it should be convertible, and it worked.

However, I'm not sure about the correctness of this solution, nor if the problem really lies in the serialization component and not elsewhere.

Change History (2)

comment:1 by Robert Ramey, 5 years ago

Owner: changed from Robert Ramey to Ion Gaztañaga

forwarding this to the maintainer of boost::intrusive

Robert Ramey

comment:2 by Ion Gaztañaga, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.