以下は、Visual Studio 2010 でコンパイルされません。
std::vector<int> v;
for (int i = 0; i < 10; ++i) v.push_back (i);
struct TrivialTrafo {
typedef int result_type;
int operator () (int i) const { return 1; }
};
auto x = v | boost::adaptors::transformed (TrivialTrafo ())
| boost::adaptors::strided (2);
コンパイラは不平を言います(エラーメッセージはもともとドイツ語で、私の翻訳です):
error C2664:
'boost::range_detail::strided_iterator<BaseIterator,Category>::strided_iterator
(const boost::range_detail::strided_iterator<BaseIterator,Category> &)':
Conversion of parameter 1 from
'boost::range_detail::strided_iterator<BaseIterator,Category>' into
'const boost::range_detail::strided_iterator<BaseIterator,Category> &'
not possible
with
[
BaseIterator=boost::iterators::transform_iterator<
TEST_rectnew_getRows::TrivialTrafo,std::_Vector_iterator<
std::_Vector_val<int,std::allocator<int>>>>,
Category=boost::iterators::detail::iterator_category_with_traversal<
std::input_iterator_tag,boost::iterators::random_access_traversal_tag>
]
and
[
BaseIterator=boost::iterators::transform_iterator<
TEST_rectnew_getRows::TrivialTrafo,std::_Vector_iterator<
std::_Vector_val<int,std::allocator<int>>>>,
Category=boost::iterators::random_access_traversal_tag
]
and
[
BaseIterator=boost::iterators::transform_iterator<
TEST_rectnew_getRows::TrivialTrafo,
std::_Vector_iterator<std::_Vector_val<int,std::allocator<int>>>
>,
Category=boost::iterators::detail::iterator_category_with_traversal<
std::input_iterator_tag,boost::iterators::random_access_traversal_tag>
]
Boost 1.57 を使用しています。
明らかに間違ったテンプレート パラメータ値でoperator |
を構築しようとしていますか?strided_range
Category
これはバグですか、それとも何か間違っていますか?