Subject: Re: [Boost-bugs] [Boost C++ Libraries] #6793: Support construction from range
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-12-17 17:31:46
#6793: Support construction from range
-------------------------------------------------------+--------------------
Reporter: Olaf van der Spek <olafvdspek@â¦> | Owner: marshall
Type: Feature Requests | Status: assigned
Milestone: To Be Determined | Component: array
Version: Boost 1.49.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------------------------------+--------------------
Comment (by Olaf van der Spek <olafvdspek@â¦>):
That requires temp vars for both input and output.
{{{
string g() { return "Olaf"; }
void f(array<char, 20> const&);
f(make_array(g())); // desired
{
string s = g();
array<char, 20> a;
std::copy(s.begin(), s.end(), a.begin());
f(a);
}
}}}
IMO the one liner looks much better than the 6 liner and the 6 liner can't
even do size checking.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/6793#comment:3> 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:11 UTC