Your << operator is a private function because class default specifier is private by default.