mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-07 12:21:27 +01:00
Summary: Pull Request resolved: https://github.com/pytorch/pytorch/pull/64016 In order to increase the strictness of the compilation for some target depending on caffe2 we need to fix some errors uncovered when rising such flags. This change introduces the required override tokens for virtual destructors Test Plan: CI. Moreover targets depending on caffe2 using clang strict warnings now compile Reviewed By: kalman5 Differential Revision: D30541714 fbshipit-source-id: 564af31b4a9df3536d7d6f43ad29e1d0c7040551
28 lines
669 B
C++
28 lines
669 B
C++
#pragma once
|
|
|
|
#include <istream>
|
|
|
|
#include "c10/macros/Macros.h"
|
|
#include "caffe2/serialize/read_adapter_interface.h"
|
|
|
|
namespace caffe2 {
|
|
namespace serialize {
|
|
|
|
// this is a reader implemented by std::istream
|
|
class TORCH_API IStreamAdapter final : public ReadAdapterInterface {
|
|
public:
|
|
C10_DISABLE_COPY_AND_ASSIGN(IStreamAdapter);
|
|
explicit IStreamAdapter(std::istream* istream);
|
|
size_t size() const override;
|
|
size_t read(uint64_t pos, void* buf, size_t n, const char* what = "")
|
|
const override;
|
|
~IStreamAdapter() override;
|
|
|
|
private:
|
|
std::istream* istream_;
|
|
void validate(const char* what) const;
|
|
};
|
|
|
|
} // namespace serialize
|
|
} // namespace caffe2
|