mirror of
https://github.com/tfussell/xlnt.git
synced 2024-03-22 13:11:17 +08:00
use unique_ptr constructor instead of make_unique (C++14+ only)
This commit is contained in:
parent
498f3a6f71
commit
9f95894372
|
@ -482,7 +482,9 @@ std::unique_ptr<std::streambuf> ozstream::open(const path &filename)
|
|||
zheader header;
|
||||
header.filename = filename.string();
|
||||
file_headers_.push_back(header);
|
||||
return std::make_unique<zip_streambuf_compress>(&file_headers_.back(), destination_stream_);
|
||||
auto buffer = new zip_streambuf_compress(&file_headers_.back(), destination_stream_);
|
||||
|
||||
return std::unique_ptr<zip_streambuf_compress>(buffer);
|
||||
}
|
||||
|
||||
izstream::izstream(std::istream &stream)
|
||||
|
@ -595,7 +597,9 @@ std::unique_ptr<std::streambuf> izstream::open(const path &filename) const
|
|||
|
||||
auto header = file_headers_.at(filename.string());
|
||||
source_stream_.seekg(header.header_offset);
|
||||
return std::make_unique<zip_streambuf_decompress>(source_stream_, header);
|
||||
auto buffer = new zip_streambuf_decompress(source_stream_, header);
|
||||
|
||||
return std::unique_ptr<zip_streambuf_decompress>(buffer);
|
||||
}
|
||||
|
||||
std::string izstream::read(const path &filename) const
|
||||
|
|
Loading…
Reference in New Issue
Block a user