summaryrefslogtreecommitdiffstats
path: root/base/memory/singleton.h
diff options
context:
space:
mode:
authortfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-31 00:53:06 +0000
committertfarina@chromium.org <tfarina@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-07-31 00:53:06 +0000
commitae5537fe08524112642fb8e1f677c1100688f0df (patch)
treefe7df2218df2ec6b9c7f8338f025dc9d78acaedc /base/memory/singleton.h
parent8991f2b1c40ca1e45dc1eb1a8c4bc4d600c3d892 (diff)
downloadchromium_src-ae5537fe08524112642fb8e1f677c1100688f0df.zip
chromium_src-ae5537fe08524112642fb8e1f677c1100688f0df.tar.gz
chromium_src-ae5537fe08524112642fb8e1f677c1100688f0df.tar.bz2
base: Suggest forward declare DefaultSingletonTraits in header files.
Instead of including singleton.h in header files we can forward declare it, and include only in the source file. There is also a presubmit check for this, I didn't know ;) R=willchan@chromium.org Review URL: https://chromiumcodereview.appspot.com/10835029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@149095 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/memory/singleton.h')
-rw-r--r--base/memory/singleton.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/memory/singleton.h b/base/memory/singleton.h
index 4564790..0d4fc89 100644
--- a/base/memory/singleton.h
+++ b/base/memory/singleton.h
@@ -149,7 +149,7 @@ template <typename Type> base::subtle::Atomic32
// Example usage:
//
// In your header:
-// #include "base/memory/singleton.h"
+// template <typename T> struct DefaultSingletonTraits;
// class FooClass {
// public:
// static FooClass* GetInstance(); <-- See comment below on this.
@@ -162,6 +162,7 @@ template <typename Type> base::subtle::Atomic32
// };
//
// In your source file:
+// #include "base/memory/singleton.h"
// FooClass* FooClass::GetInstance() {
// return Singleton<FooClass>::get();
// }