diff --git a/include/libtorrent/copy_ptr.hpp b/include/libtorrent/copy_ptr.hpp index 4e2875d62..3d9a96937 100644 --- a/include/libtorrent/copy_ptr.hpp +++ b/include/libtorrent/copy_ptr.hpp @@ -48,14 +48,16 @@ namespace libtorrent m_ptr = p.m_ptr ? new T(*p.m_ptr) : 0; return *this; } + T* operator->() { return m_ptr; } + T const* operator->() const { return m_ptr; } T& operator*() { return *m_ptr; } + T const& operator*() const { return *m_ptr; } void swap(copy_ptr& p) { T* tmp = m_ptr; m_ptr = p.m_ptr; p.m_ptr = tmp; } - T const& operator*() const { return *m_ptr; } operator bool() const { return m_ptr; } ~copy_ptr() { delete m_ptr; } private: diff --git a/src/file_storage.cpp b/src/file_storage.cpp index ef117a97a..78e3f22b7 100644 --- a/src/file_storage.cpp +++ b/src/file_storage.cpp @@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE. namespace libtorrent { file_storage::file_storage() - : m_piece_length(0) - , m_total_size(0) + : m_total_size(0) , m_num_pieces(0) + , m_piece_length(0) {} void file_storage::reserve(int num_files)