Opened 11 years ago

Last modified 11 years ago

#5651 new Patches

Improvements to to_[lower/upper]_copy

Reported by: sairony@… Owned by: Marshall Clow
Milestone: To Be Determined Component: algorithm
Version: Boost 1.46.1 Severity: Optimization
Keywords: Cc:

Description

to_[lower/upper]_copy implicitly deduces the return type from the input type unless you supply the output as a second parameter. This is not always possible, consider for example: const std::string example = to_lower_copy< std::string >("foo") + to_upper_copy< std::string >("bar"); . To achieve the same we currently need to construct an additional unnecessary temporary which only purpose is to inform the algorithm of the return type. The attached case_conv.hpp introduces 1 new overload for each variant which shouldn't break any existing code. Discussion can be found at: http://lists.boost.org/Archives/boost/2011/06/183031.php .

Attachments (1)

case_conv.hpp (6.9 KB ) - added by sairony@… 11 years ago.
Modified for 2 new overloads

Download all attachments as: .zip

Change History (2)

by sairony@…, 11 years ago

Attachment: case_conv.hpp added

Modified for 2 new overloads

comment:1 by Marshall Clow, 11 years ago

Component: string_algoalgorithm
Owner: changed from Pavol Droba to Marshall Clow
Note: See TracTickets for help on using tickets.