From b787f4c5932cba4c9970b41fcaee48bc5b3d6b53 Mon Sep 17 00:00:00 2001 From: "andrew@webrtc.org" Date: Mon, 27 Oct 2014 17:42:22 +0000 Subject: [PATCH] Move scoped_ptr "free" functions into the webrtc namespace. Resolves a conflict with Chromium's scoped_ptr on the recently added make_scoped_ptr(). TEST=local Chromium Linux build passes. R=henrike@webrtc.org Review URL: https://webrtc-codereview.appspot.com/26969004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@7535 4adac7df-926f-26a2-2b94-8c16560cd09d --- webrtc/system_wrappers/interface/scoped_ptr.h | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/webrtc/system_wrappers/interface/scoped_ptr.h b/webrtc/system_wrappers/interface/scoped_ptr.h index a9ddc5c11..3ca755c07 100644 --- a/webrtc/system_wrappers/interface/scoped_ptr.h +++ b/webrtc/system_wrappers/interface/scoped_ptr.h @@ -567,21 +567,18 @@ class scoped_ptr { template bool operator!=(scoped_ptr const& p2) const; }; -} // namespace webrtc - -// Free functions template -void swap(webrtc::scoped_ptr& p1, webrtc::scoped_ptr& p2) { +void swap(scoped_ptr& p1, scoped_ptr& p2) { p1.swap(p2); } template -bool operator==(T* p1, const webrtc::scoped_ptr& p2) { +bool operator==(T* p1, const scoped_ptr& p2) { return p1 == p2.get(); } template -bool operator!=(T* p1, const webrtc::scoped_ptr& p2) { +bool operator!=(T* p1, const scoped_ptr& p2) { return p1 != p2.get(); } @@ -589,8 +586,10 @@ bool operator!=(T* p1, const webrtc::scoped_ptr& p2) { // Doing e.g. make_scoped_ptr(new FooBarBaz(arg)) is a shorter notation // for scoped_ptr >(new FooBarBaz(arg)) template -webrtc::scoped_ptr make_scoped_ptr(T* ptr) { - return webrtc::scoped_ptr(ptr); +scoped_ptr make_scoped_ptr(T* ptr) { + return scoped_ptr(ptr); } +} // namespace webrtc + #endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_PTR_H_