Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#6305 closed Bugs (duplicate)

range_detail::make_range() copies containers needlessly

Reported by: Michael Burr <michael.burr@…> Owned by: Neil Groves
Milestone: To Be Determined Component: range
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

When manufacturing a range for the passed in containers, range_detail::make_range() calls range_detail::is_char_ptr() which will takes its (unused) parameter by value just so 0L can be returned.

This means make_range() can't be used with non-copyable classes.

See http://stackoverflow.com/questions/8571608/why-does-boostequals-require-ranges-to-be-copyable for the original report of this problem by Mozza314.

Attachments (3)

test.cpp (325 bytes ) - added by Michael Burr <michael.burr@…> 11 years ago.
small repro case
test.2.cpp (325 bytes ) - added by Michael Burr <michael.burr@…> 11 years ago.
small repro case
as_literal.hpp.patch (375 bytes ) - added by Michael Burr <michael.burr@…> 11 years ago.
patch for fix

Download all attachments as: .zip

Change History (5)

by Michael Burr <michael.burr@…>, 11 years ago

Attachment: test.cpp added

small repro case

by Michael Burr <michael.burr@…>, 11 years ago

Attachment: test.2.cpp added

small repro case

by Michael Burr <michael.burr@…>, 11 years ago

Attachment: as_literal.hpp.patch added

patch for fix

comment:1 by Michael Burr <michael.burr@…>, 11 years ago

Resolution: duplicate
Status: newclosed

comment:2 by Michael Burr <michael.burr@…>, 11 years ago

Dup of bug #6149

Note: See TracTickets for help on using tickets.