以下是失败的:
#include <range/v3/view.hpp>
#include <range/v3/view/zip.hpp>
#include <range/v3/utility/iterator.hpp>
// ...
std::vector< std::tuple<int, std::string> > const data{
{1,"a"},
{2,"b"},
{3,"c"}
};
std::vector<int> vi(data.size());
std::vector<std::string> vs(data.size());
using namespace ranges;
copy(data, view::zip(vi,vs) ); // error
铛说
No matching function for call to object of type 'const
ranges::v3::with_braced_init_args<ranges::v3::copy_fn>'
假设这是由设计,为什么呢?
而且,我该怎么做这个范围内显而易见的事情?