ulfben icon

Modern C++ Singleton

ulfben | PRO | 12/13/17 11:19:36 AM UTC | 0 ⭐ | 1369 👁️ | Never ⏰ | []
C++ |

340 B

|

None

|

0 👍

/

0 👎

#pragma once
template<class T>
class SingletonBase{
protected:
    SingletonBase(){};
public:
    SingletonBase(const SingletonBase&) = delete;
    SingletonBase operator=(const SingletonBase&) = delete; 
    static T& instance(){
        static T single; //no need for DCLP since C++11 (paragraph 6.7.4, static initialization)
        return single;
    }
};

Comments

  • Gyqizv icon
    04/02/26 06:17:13 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best t33n active cpx link daily updates!
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.@xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400
     Remove the @ 
  • Yuizcko icon
    05/18/26 01:13:18 PM UTC
    text |

    0 B

    |

    0 👍

    /

    0 👎

    Best Pastebin.com alternatives paste sites list
     Copy and paste the link in a new browser tab and then hit enter!
     https://crazyporn.xxx/members/157354/?asgtbndr=1&play=true&spon=adworld&zone=400