--- src/libraw_datastream.cpp.dist 2018-03-23 00:49:40.000000000 -0700 +++ src/libraw_datastream.cpp 2018-03-24 14:30:38.000000000 -0700 @@ -82,11 +82,11 @@ _fsize = st.st_size; #endif - std::auto_ptr buf(new std::filebuf()); + std::unique_ptr buf(new std::filebuf()); buf->open(filename.c_str(), std::ios_base::in | std::ios_base::binary); if (buf->is_open()) { - f = buf; + f = std::move(buf); } } } @@ -99,11 +99,11 @@ struct _stati64 st; if (!_wstati64(wfilename.c_str(), &st)) _fsize = st.st_size; - std::auto_ptr buf(new std::filebuf()); + std::unique_ptr buf(new std::filebuf()); buf->open(wfilename.c_str(), std::ios_base::in | std::ios_base::binary); if (buf->is_open()) { - f = buf; + f = std::move(buf); } } } @@ -222,18 +222,18 @@ LR_STREAM_CHK(); if (saved_f.get()) return EBUSY; - saved_f = f; - std::auto_ptr buf(new std::filebuf()); + saved_f = std::move(f); + std::unique_ptr buf(new std::filebuf()); buf->open(fn, std::ios_base::in | std::ios_base::binary); if (!buf->is_open()) { - f = saved_f; + f = std::move(saved_f); return ENOENT; } else { - f = buf; + f = std::move(buf); } return 0; @@ -245,18 +245,18 @@ LR_STREAM_CHK(); if (saved_f.get()) return EBUSY; - saved_f = f; - std::auto_ptr buf(new std::filebuf()); + saved_f = std::move(f); + std::unique_ptr buf(new std::filebuf()); buf->open(fn, std::ios_base::in | std::ios_base::binary); if (!buf->is_open()) { - f = saved_f; + f = std::move(saved_f); return ENOENT; } else { - f = buf; + f = std::move(buf); } return 0; @@ -267,7 +267,7 @@ { if (!saved_f.get()) return; - f = saved_f; + f = std::move(saved_f); } #undef LR_STREAM_CHK --- libraw/libraw_datastream.h.dist 2018-03-23 00:49:40.000000000 -0700 +++ libraw/libraw_datastream.h 2018-03-24 14:33:54.000000000 -0700 @@ -112,14 +112,14 @@ }; #ifdef WIN32 -template class DllDef std::auto_ptr; +template class DllDef std::unique_ptr; #endif class DllDef LibRaw_file_datastream : public LibRaw_abstract_datastream { protected: - std::auto_ptr f; /* will close() automatically through dtor */ - std::auto_ptr saved_f; /* when *f is a subfile, *saved_f is the master file */ + std::unique_ptr f; /* will close() automatically through dtor */ + std::unique_ptr saved_f; /* when *f is a subfile, *saved_f is the master file */ std::string filename; INT64 _fsize; #ifdef WIN32