
I don't think this "operator|" - which lives in the boost::range_detail namespace (note the "detail") - is meant to be specialized by users.
On the contrary. It's not specialized, but overloaded, and the instructions say to do exactly that. In particular, http://www.boost.org/doc/libs/1_46_1/libs/range/doc/html/range/reference/ext... "Implement a Rage Adaptor without arguments".
I'm sorry, I misread your code. I saw the return type was transformed_range and so I thought you are somehow trying to specialize the "transformed" adaptor's operator| to behave differently when you do "my_range | transformed(ASCII_lower())". Looking at it again, it seems what you are really trying to do is write your own adaptor "ASCII_lowered" or something similar that would be used as "my_range | ASCII_lowered" (which is precisely what I was suggesting). Now, regarding your problem (which I now understand):
template< class Range > inline transformed_range
operator|( const Range& r, const ASCII_lower_forwarder ) { return transformed_range ( ASCII_lower(), // The underlying transform iterators wants this internal::src_prep(typename std::tr1::is_pointer<Range>::type() ,r) // "source" style argument processing ); }
As you discovered, returning transformed_range