This past month I am studying a lot of C++, and know I'm trying too practice a little, and for that I cloned the Electron project.
In the file src/electron/atom/browser/api/atom_api_session.cc
there is this code:
379 void Session::OnDownloadCreated(content::DownloadManager* manager,
380 content::DownloadItem* item) {
381 if (item->IsSavePackageDownload())
382 return;
383
384 v8::Locker locker(isolate());
385 v8::HandleScope handle_scope(isolate());
386 bool prevent_default = Emit(
387 "will-download",
388 DownloadItem::Create(isolate(), item),
389 item->GetWebContents());
390 if (prevent_default) {
391 item->Cancel(true);
392 item->Remove();
393 }
394 }
I would like to print what is the manager with stdout::cout << manager;
, so I created a function to overload the <<
as the books told me:
375 void operator << (std::ostream & o, const content::DownloadManager* manager) {
376 o << "manager:" << manager;
377 }
But this isn't working at all.