This question is based on Understanding this highly templated C++ function binder
There's this declaration:
template<typename Container, typename Ret, typename ...Args>
BindImpl<Container, Ret, Args...> DeduceImpl (Ret (Container::*)(Args...));
which isn't defined anywhere.
Then it's used like this:
(typename decltype(::AIpStack::BindPrivate::DeduceImpl(&EthIpIface::driverSendIp4Packet)) ::template Callable<&EthIpIface::driverSendIp4Packet>((this)).toFunction())
As you can see, DeduceImpl
is called without being defined. I guess that, since decltype
is just for knowing the type, there's no call, so the program never calls the definition.
Because of this I started to wonder: when can I declare but not define?