Opened 10 years ago

Closed 10 years ago

#7421 closed Bugs (fixed)

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

Reported by: tokiloki7@… Owned by: Antony Polukhin
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,

Change History (7)

comment:1 by Antony Polukhin, 10 years ago

(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 by Antony Polukhin, 10 years ago

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

comment:3 by Antony Polukhin, 10 years ago

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

comment:4 by Antony Polukhin, 10 years ago

Milestone: To Be DeterminedBoost 1.52.0
Resolution: fixed
Status: newclosed

comment:5 by Antony Polukhin, 10 years ago

Milestone: Boost 1.52.0Boost 1.54.0
Resolution: fixed
Status: closedreopened
Version: Boost 1.52.0Boost 1.53.0

In [81278] this fix was somehow removed.

comment:6 by Antony Polukhin, 10 years ago

(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 by Antony Polukhin, 10 years ago

Resolution: fixed
Status: reopenedclosed

(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)
Note: See TracTickets for help on using tickets.