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
This commit is contained in:
parent
243eb8e9af
commit
b787f4c593
@ -567,21 +567,18 @@ class scoped_ptr<T[], D> {
|
||||
template <class U> bool operator!=(scoped_ptr<U> const& p2) const;
|
||||
};
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
// Free functions
|
||||
template <class T, class D>
|
||||
void swap(webrtc::scoped_ptr<T, D>& p1, webrtc::scoped_ptr<T, D>& p2) {
|
||||
void swap(scoped_ptr<T, D>& p1, scoped_ptr<T, D>& p2) {
|
||||
p1.swap(p2);
|
||||
}
|
||||
|
||||
template <class T, class D>
|
||||
bool operator==(T* p1, const webrtc::scoped_ptr<T, D>& p2) {
|
||||
bool operator==(T* p1, const scoped_ptr<T, D>& p2) {
|
||||
return p1 == p2.get();
|
||||
}
|
||||
|
||||
template <class T, class D>
|
||||
bool operator!=(T* p1, const webrtc::scoped_ptr<T, D>& p2) {
|
||||
bool operator!=(T* p1, const scoped_ptr<T, D>& p2) {
|
||||
return p1 != p2.get();
|
||||
}
|
||||
|
||||
@ -589,8 +586,10 @@ bool operator!=(T* p1, const webrtc::scoped_ptr<T, D>& p2) {
|
||||
// Doing e.g. make_scoped_ptr(new FooBarBaz<type>(arg)) is a shorter notation
|
||||
// for scoped_ptr<FooBarBaz<type> >(new FooBarBaz<type>(arg))
|
||||
template <typename T>
|
||||
webrtc::scoped_ptr<T> make_scoped_ptr(T* ptr) {
|
||||
return webrtc::scoped_ptr<T>(ptr);
|
||||
scoped_ptr<T> make_scoped_ptr(T* ptr) {
|
||||
return scoped_ptr<T>(ptr);
|
||||
}
|
||||
|
||||
} // namespace webrtc
|
||||
|
||||
#endif // WEBRTC_SYSTEM_WRAPPERS_INTERFACE_SCOPED_PTR_H_
|
||||
|
Loading…
Reference in New Issue
Block a user