Dear C++ #CPP people: how do you actually fucking do this? It seems bad enough that I need to have two overloads just to allow for the "no args" version.
But that template overload fails at link time because of an undefined symbol???
UPDATE: It鈥檚 because I needed to define it in the header file itself, not just declare it
```cpp
#include <format>
#include <print>
template <typename... Args>
void info(std::format_string<Args...> fmt, Args&&... args) {
auto res = std::format(fmt, std::forward<Args&&>(args)...);
std::println("{}", res);
}
int main() {
info("{}", 42);
info("moi");
}
```
Seems to work in compiler explorer. Typos might be present, writing this on phone. Did you need something else?
Failing on link time might happen if you have template in a source code file not visible to an another translation unit (which is why we write template code into headers, or modules if we're in the future).