Commits

Anonymous committed 91f55c5

added NULL_SP to smart pointer utils

Comments (0)

Files changed (1)

src/utils/smart_ptr_utils.h

 
 
 #include <boost/shared_ptr.hpp>
-
+#include "jml/compiler/compiler.h"
 
 namespace ML {
 
     return boost::shared_ptr<T>(&val, Dont_Delete());
 }
 
+extern const struct Null_SP {
+    template<typename T>
+    JML_ALWAYS_INLINE operator boost::shared_ptr<T>()
+    {
+        return boost::shared_ptr<T>();
+    }
+
+} NULL_SP;
+
 } // namespace ML
 
 #endif /* __utils__smart_ptr_utils_h__ */