@@ -51,13 +51,13 @@ namespace gs {
5151// from std::exception.
5252*/
5353 template <class Item , class Stream >
54- inline CPP11_auto_ptr <Item> read_item (Stream &is, const bool readClassId = true ) {
54+ inline std::unique_ptr <Item> read_item (Stream &is, const bool readClassId = true ) {
5555 typedef std::vector<ClassId> State;
5656 Item *item = nullptr ;
5757 State state;
5858 const bool status = GenericReader<Stream, State, Item *, Int2Type<IOTraits<int >::ISNULLPOINTER>>::process (
5959 item, is, &state, readClassId);
60- CPP11_auto_ptr <Item> ptr (item);
60+ std::unique_ptr <Item> ptr (item);
6161 if (is.fail ())
6262 throw IOReadFailure (" In gs::read_item: input stream failure" );
6363 if (!status || item == nullptr )
@@ -150,9 +150,9 @@ namespace gs {
150150 template <class Stream , class State , class T >
151151 struct GenericReader <Stream, State, T, Int2Type<IOTraits<int >::ISPOD>> {
152152 inline static bool readIntoPtr (T *&ptr, Stream &str, State *, const bool processClassId) {
153- CPP11_auto_ptr <T> myptr;
153+ std::unique_ptr <T> myptr;
154154 if (ptr == nullptr )
155- myptr = CPP11_auto_ptr <T>(new T ());
155+ myptr = std::unique_ptr <T>(new T ());
156156 if (processClassId) {
157157 static const ClassId current (ClassId::makeId<T>());
158158 ClassId id (str, 1 );
@@ -441,9 +441,9 @@ namespace gs {
441441 template <class Stream , class State , class T >
442442 struct GenericReader <Stream, State, T, Int2Type<IOTraits<int >::ISPAIR>> {
443443 inline static bool readIntoPtr (T *&ptr, Stream &str, State *s, const bool processClassId) {
444- CPP11_auto_ptr <T> myptr;
444+ std::unique_ptr <T> myptr;
445445 if (ptr == 0 ) {
446- myptr = CPP11_auto_ptr <T>(new T ());
446+ myptr = std::unique_ptr <T>(new T ());
447447 clearIfPointer (myptr.get ()->first );
448448 clearIfPointer (myptr.get ()->second );
449449 }
@@ -499,9 +499,9 @@ namespace gs {
499499 template <class Stream , class State >
500500 struct GenericReader <Stream, State, std::string, Int2Type<IOTraits<int >::ISSTRING>> {
501501 inline static bool readIntoPtr (std::string *&ptr, Stream &is, State *, const bool processClassId) {
502- CPP11_auto_ptr <std::string> myptr;
502+ std::unique_ptr <std::string> myptr;
503503 if (ptr == nullptr )
504- myptr = CPP11_auto_ptr <std::string>(new std::string ());
504+ myptr = std::unique_ptr <std::string>(new std::string ());
505505 if (processClassId) {
506506 static const ClassId current (ClassId::makeId<std::string>());
507507 ClassId id (is, 1 );
@@ -613,7 +613,7 @@ namespace gs {
613613 if (ptr)
614614 return process_item<GenericReader2>(*ptr, str, s, processClassId);
615615 else {
616- CPP11_auto_ptr <T> myptr (new T ());
616+ std::unique_ptr <T> myptr (new T ());
617617 if (!process_item<GenericReader2>(*myptr, str, s, processClassId))
618618 return false ;
619619 ptr = myptr.release ();
@@ -673,9 +673,9 @@ namespace gs {
673673 template <class Stream , class State , class T >
674674 struct GenericReader <Stream, State, T, Int2Type<IOTraits<int >::ISPLACEREADABLE>> {
675675 inline static bool readIntoPtr (T *&ptr, Stream &str, State *s, const bool processClassId) {
676- CPP11_auto_ptr <T> myptr;
676+ std::unique_ptr <T> myptr;
677677 if (ptr == 0 )
678- myptr = CPP11_auto_ptr <T>(new T ());
678+ myptr = std::unique_ptr <T>(new T ());
679679 if (processClassId) {
680680 ClassId id (str, 1 );
681681 T::restore (id, str, ptr ? ptr : myptr.get ());
0 commit comments