Fix compiler error: "a class-key must be used when declaring a friend"