File: MAdSingleton.h

package info (click to toggle)
madlib 1.3.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 8,196 kB
  • sloc: cpp: 39,851; sh: 10,041; makefile: 473
file content (20 lines) | stat: -rw-r--r-- 303 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// -*- C++ -*-

#ifndef MAD_H_MADSINGLETON
#define MAD_H_MADSINGLETON

template<typename T> class MAdSingleton
{
 public:

  static T& instance()
    {
      static T theSingleInstance; // suppose T has a default constructor
      return theSingleInstance;
    }

 private:
  MAdSingleton();
};

#endif