
Hi Dan, dan marsden wrote:
The following code allows references to pass through, as I believe you want. It just uses a slight modification to your function object to allow it to cope with references correctly.
<snip modified code> My problem is that in pass_through::operator () I need to know the actual type stored in the vector. With your modified code I would not necessarily get that, e.g. for vector<int, int&> where I would not have any way of distinguishing whether T is a reference or not. That's what I need actually. My example might have been a bit contrived. To give more context: For each type T in a vector I want to conditionally transform the type T to another type to get a new vector where some of the types and values have been changed and some have simply been passed through. Thanks, Martin