I've been trying to brush up on my C++ knowledge and found this issue I cannot Google for easily.
I've written a function with the following signature:
template <typename Iterator>
Iterator lower_bound(
Iterator left,
Iterator right,
typename Iterator::value_type const& target
) {
//stuff happens here
}
and I'm trying to use it like so:
std::vector<int> odd{1, 2, 3, 4, 5, 6, 7};
int i = 4;
std::cout << std::distance(odd.begin(), lower_bound(odd.begin(), odd.end(), i)) << std::endl;
I'm getting the following compilation error: error: call to 'lower_bound' is ambiguous.
I'm guessing I'm lacking some understanding about how template types are resolved and so would be grateful for any resources that might explain this in a bit more detail.