Why declaration of friend to nested templates member fuction work in class, but not in template I have this code, successfully compiled with g++ 13.3.0.