Original Post
Has anyone here used the SmartPtr class from Loki? I started experimenting with it and I have found a serious problem with it. Consider this: #include template class TSmartPtr : public Loki::SmartPtr < TYPE, Loki::RefCounted, // Our pointers will have reference counting Loki::AllowConversion, // Implicit conversion to contained pointer okay Loki::AssertCheck, // Assert checks requires Loki::DefaultSPStorage // Normal pointer-style storage > { }; int main() { TSmartPtr pInteger; pInteger = new int; return 0; } The above code will not compile. It gives an error that there is no binary operator that takes a right-hand 'int*' for the line 'pInteger = new int'. Is it just me, or does that seem really dumb. How are you supposed to initialize a smart pointer if you can't assign it a raw pointer? And don't tell me to use the constructor because it has the exact same problem. How the heck are you supposed to initialize this thing? Thanks