Ambiguous Reference/Value Versions of Functions
Consider the following function prototypes: void Remove(SomeContainer& Vec, const std::size_t Index); SomeContainer Remove(SomeContainer Vec, const std::size_t Index); The second is implemented in terms of the first. That is to say, they are functionally identical in every way except that one is pass-by-reference and the other is pass-by-value. However, GCC says these are ambiguous in cases like this, even though the first form is the only one that does not return a value: Remove(SomeContainer, 123); Is there any workaround to this, or do I have to come up with different names for each form?