When you have multiple overloaded functions with the same name, absl::bind_front can't automatically determine which overload you want to bind to. You need to explicitly specify which function signature you're targeting.
Here are the main approaches:
1. Function Pointer Cast
Cast to the specific function pointer type:
cpp
#include "absl/functional/bind_front.h"
void foo(int x) { /* ... */ }
void foo(int x, double y) { /* ... */ }
void foo(const std::string& s) { /* ... */ }
// Specify which overload by casting to function pointer
auto bound1 = absl::bind_front(static_cast<void(*)(int)>(foo), 42);
auto bound2 = absl::bind_front(static_cast<void(*)(int, double)>(foo), 42);
auto bound3 = absl::bind_front(static_cast<void(*)(const std::string&)>(foo), "hello");
The function pointer cast approach is usually the most straightforward, while the lambda wrapper gives you more flexibility if you need to do additional processing before the function call.