Opened 11 years ago

Closed 5 years ago

#6553 closed Patches (wontfix)

Boost.Format - format object implicitly converts to string

Reported by: mpbecey7gu@… Owned by: James E. King, III
Milestone: To Be Determined Component: format
Version: Boost 1.47.0 Severity: Not Applicable
Keywords: Cc:

Description

As discussed on boost-users, it is desirable to have formatter objects implicitly convert to string. This is trivial to enable, and I have attached the modified file. I would hope that this gets accepted into the development branch.

Attachments (1)

format_class.hpp (7.2 KB ) - added by mpbecey7gu@… 11 years ago.

Download all attachments as: .zip

Change History (5)

by mpbecey7gu@…, 11 years ago

Attachment: format_class.hpp added

comment:1 by Daryle Walker, 11 years ago

Converting a format object to a string object can be highly convenient, but the two object types aren't conceptually and/or functionally equivalent (or even nearly so). Consider the potential consequences before adding this change. Maybe the conversion operator could use the C++11 "explicit" marker, but I haven't considered if that solution would satisfy anyone.

comment:2 by James E. King, III, 5 years ago

Can you describe the use case for this? Would it put the format string into a string?

comment:3 by James E. King, III, 5 years ago

Owner: changed from Samuel Krempp to James E. King, III
Status: newassigned

comment:4 by James E. King, III, 5 years ago

Resolution: wontfix
Status: assignedclosed

Closing as wontfix, as the request is not specific enough and untouched for 6 years. The existing mechanism has been around for a while and works. If folks want to revive this is can be done on the mailing list and/or github issues.

Note: See TracTickets for help on using tickets.