Re: [Boost-bugs] [Boost C++ Libraries] #7775: Allow algorithm::join to accept a container of char*

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #7775: Allow algorithm::join to accept a container of char*
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-02-12 19:13:07


#7775: Allow algorithm::join to accept a container of char*
---------------------------------------------+------------------------------
  Reporter: Sergey Mitsyn <svm at jinr.ru> | Owner: marshall
      Type: Feature Requests | Status: new
 Milestone: To Be Determined | Component: algorithm
   Version: Boost 1.52.0 | Severity: Problem
Resolution: | Keywords:
---------------------------------------------+------------------------------

Comment (by marshall):

 The problem is not creating from an array of `char *`, but from a
 container of `char *`.

 `boost::algorithm::join` takes a "container (A) of containers (B)" and
 returns a "container (B)".

 When the (B) container is just "char *", it has no facility for creating
 such a container.
 {{{
 std::string arr[] = { "Hi", "Mom" };
 boost::algorithm::join(arr, ", ");
 }}}
 works fine (and returns a `std::string`)
 {{{
 std::vector<char *> strs;
 strs.push_back("Hello");
 strs.push_back("World!");
 joined = boost::algorithm::join(strs, ", ");
 }}}
 does not.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/7775#comment:1>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:12 UTC