work-around with pcsc::shared_ptr<T>::t; refs #26

master
Marc Wäckerlin 12 years ago
parent 45c9096c41
commit 9fbc9c0dae
  1. 19
      src/pcsc.hxx

@ -73,13 +73,18 @@
} }
#endif #endif
#ifdef NO_CXX2011 #if __cplusplus > 199711L
namespace pcsc {
template<typename T> struct shared_ptr {
typedef std::shared_ptr<T> t;
};
}
#else
#warning Old compiler (pre 2011): using boost as replacement for std #warning Old compiler (pre 2011): using boost as replacement for std
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
namespace std { namespace pcsc {
template<class T> class shared_ptr: public boost::shared_ptr<T> { template<typename T> struct shared_ptr {
public: typedef boost::shared_ptr<T> t;
shared_ptr(T* p): boost::shared_ptr<T>(p) {}
}; };
} }
#endif #endif
@ -532,7 +537,7 @@ namespace pcsc {
if (_reader.find(name)==_reader.end()) if (_reader.find(name)==_reader.end())
_reader.insert _reader.insert
(std::make_pair (std::make_pair
(name, std::shared_ptr<Reader>(new Reader(name, *this)))); (name, shared_ptr<Reader>::t(new Reader(name, *this))));
return *_reader.find(name)->second; return *_reader.find(name)->second;
} }
@ -841,7 +846,7 @@ namespace pcsc {
bool _exc; bool _exc;
SCARDCONTEXT _id; SCARDCONTEXT _id;
long _state; long _state;
std::map<std::string, std::shared_ptr<Reader> > _reader; std::map<std::string, shared_ptr<Reader>::t > _reader;
}; };

Loading…
Cancel
Save