|
Boost Users : |
Subject: [Boost-users] [range] join() and adaptors::transformed do not play nicely with each other
From: Nathan Ridge (zeratul976_at_[hidden])
Date: 2011-02-25 18:10:54
Hello,
For the following code:
#include <vector>
#include <boost/range/adaptor/transformed.hpp>
#include <boost/range/join.hpp>
using boost::adaptors::transformed;
using boost::join;
int add1(int i) { return i + 1; }
int main()
{
std::vector<int> A, B;
auto joined = join(A | transformed(add1), B);
}
I get the following compiler errors:
In file included from ../shared/test/test.cpp:3:0:
../../lib/boost/boost/range/join.hpp: In instantiation of 'boost::range_detail
::joined_type<
const boost::range_detail::transformed_range<int (*)(int), vector<int>
>, const vector<int>
>':
../../lib/boost/boost/range/join.hpp:40:7: instantiated from 'boost
::joined_range<
const boost::range_detail::transformed_range<int (*)(int), vector<int>
>, const vector<int>
>'
../shared/test/test.cpp:13:48: instantiated from here
../../lib/boost/boost/range/join.hpp:34:7: error: no type named 'type' in
'boost::range_detail::demote_iterator_traversal_tag<
boost::detail::iterator_category_with_traversal<
input_iterator_tag, boost::random_access_traversal_tag
>, boost::random_access_traversal_tag
>'
../../lib/boost/boost/range/join.hpp: In instantiation of 'boost::joined_range<
const boost::range_detail::transformed_range<int (*)(int), vector<int>
>, const vector<int>
>':
../shared/test/test.cpp:13:48: instantiated from here
../../lib/boost/boost/range/join.hpp:47:11: error: no type named 'type' in
'boost::range_detail::demote_iterator_traversal_tag<
boost::detail::iterator_category_with_traversal<
input_iterator_tag, boost::random_access_traversal_tag
>, boost::random_access_traversal_tag
>'
What is going on?
Thanks,
Nate.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net