At least this compiles and works:
#include <iostream>
#include <memory>
#include <string>
template <class T>
std::shared_ptr<T> make_instance();
template <class T> requires std::is_default_constructible_v<T>
std::shared_ptr<T> make_instance()
{
return std::make_shared<T>();
}