Opened 11 years ago

Closed 9 years ago

#5967 closed Bugs (fixed)

boost::archive::iterators::remove_whitespace do not work with pointers

Reported by: cdubout@… Owned by: Robert Ramey
Milestone: To Be Determined Component: serialization
Version: Boost 1.47.0 Severity: Problem
Keywords: Cc:

Description

boost::archive::iterators::remove_whitespace seems only able to work with real iterators, not with pointers such as char *.

Change History (6)

comment:1 by Robert Ramey, 11 years ago

Resolution: invalid
Status: newclosed

I'd have to see a small test case. Until that happens, I'm deleting this ticket.

Robert Ramey

in reply to:  1 comment:2 by cdubout@…, 11 years ago

Replying to ramey:

I'd have to see a small test case. Until that happens, I'm deleting this ticket.

Robert Ramey

I could write a test case but it would really be a waste of time. Let me quote the source code of boost 1.47:

template<class Base>
class remove_whitespace : 
    public filter_iterator<
        remove_whitespace_predicate<BOOST_DEDUCED_TYPENAME Base::value_type>,

If base is a pointer as opposed to an iterator class, there will be a compilation error since Base is not a class, and do not contain a value_type. There might be an easy workaround, but so far I did not find how to use remove_whitespace directly on C strings. Regards,

Charles

comment:3 by cdubout@…, 11 years ago

Resolution: invalid
Status: closedreopened

comment:4 by Robert Ramey, 11 years ago

lol - OK - I see your argument. But without a test case, how will I know for sure that I fixed it?

Would you care to submit a test and patch?

I believe that this could be addressed by altering the code to use boost::iterator_traits (see ../libs/iterator/doc/iterator_traits.html). Now that you've pointed this out, it's possible that other members of this group suffer the same deficiency.

Any help you might be able to contribute would be appreciated.

Robert Ramey

comment:5 by Robert Ramey, 11 years ago

try altering remove_whitespace.hpp to include:

#include <boost/iterator/iterator_traits.hpp>

remove_whitespace_predicate<

BOOST_DEDUCED_TYPENAME boost::iterator_value<Base>::type BOOST_DEDUCED_TYPENAME Base::value_type

,

Let me know how this works

Robert Ramey

comment:6 by Robert Ramey, 9 years ago

Resolution: fixed
Status: reopenedclosed

Got no response.

I think I fixed this last april '13 So I'm closing this ticket.

Robert Ramey

Note: See TracTickets for help on using tickets.