Modify

Ticket #7421 (closed Bugs: fixed)

Opened 19 months ago

Last modified 13 months ago

previous way of coupling lexical_cast with std::transform is not working

Reported by: tokiloki7@… Owned by: apolukhin
Milestone: Boost 1.54.0 Component: lexical_cast
Version: Boost 1.53.0 Severity: Regression
Keywords: Cc:

Description

After change

SVN changelist 80291 (git commit 5ce9c1e41909537371a526bd2e951ff1466eeb9a)

coupling lexical_cast with std::transform in the way

std::transform(vector.begin(), vector.end(), str_list.begin(), boost::lexical_cast<string, double>);

is not working because lexical_cast is overloaded. Compilation error is

base_helper.cpp:25:5: error: no matching function for call to 'transform'

std::transform(vector.begin(), vector.end(), str_list.begin(), boost::lexical_cast<string, double>); ~

/usr/lib/gcc/i686-redhat-linux/4.7.0/include/c++/4.7.0/bits/stl_algo.h:4940:5: note: candidate template ignored: couldn't infer template argument '_UnaryOperation'

transform(_InputIterator first, _InputIterator last,

/usr/lib/gcc/i686-redhat-linux/4.7.0/include/c++/4.7.0/bits/stl_algo.h:4977:5: note: candidate function template not viable: requires 5 arguments, but 4 were provided

transform(_InputIterator1 first1, _InputIterator1 last1,

Attachments

Change History

comment:1 Changed 19 months ago by apolukhin

(In [80715]) Do not overload lexical_cast<To, From>(const From&), instead add lexical_cast<To>(character_type,size_type) templates (refs #7421). Added tests for getting &boost::lexical_cast<To,from> functions pointers

comment:2 Changed 19 months ago by apolukhin

(In [80731]) Remove bad test (refs #7421)

comment:3 Changed 19 months ago by apolukhin

(In [80739]) Tiny documentation update (refs #7421)

comment:4 Changed 19 months ago by apolukhin

  • Status changed from new to closed
  • Resolution set to fixed
  • Milestone changed from To Be Determined to Boost 1.52.0

comment:5 Changed 13 months ago by apolukhin

  • Status changed from closed to reopened
  • Version changed from Boost 1.52.0 to Boost 1.53.0
  • Resolution fixed deleted
  • Milestone changed from Boost 1.52.0 to Boost 1.54.0

In [81278] this fix was somehow removed.

comment:6 Changed 13 months ago by apolukhin

(In [83457]) Fix ambiguity while using lexical_cast with std::transform or other functions that may take a pointer to lexical_cast (refs #7421)

comment:7 Changed 13 months ago by apolukhin

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [83542]) Merge from trunk:

  • Fixed incorrect usage of Boost.Math when it does not support long double (fixes #8162)
  • Fixed ambiguity of boost::lexical_cast functions (fixes #7421)
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.