Re: [Vala] Implementing Singleton

I have the following simple singleton implementation:

public class Singleton<T> : Object {

        private static T instance_;

     public static T instance() {
         if (instance_ == null) {
             instance_ = new T();

         return instance_;

and I get the following error during compilation:

error: `Singleton.T' is not a class, struct, or error code

Wat is the point I'm missing?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]