Commits


Kouhei Sutou authored and Wes McKinney committed a098fd04fe2
ARROW-486: [C++] Use virtual inheritance for diamond inheritance arrow::io::ReadWriteFileInterface inheritances arrow::io::FileInterface as diamond style via: * ReadableFileInterface -> InputStream -> FileInterface * WriteableFileInterface -> OutputStream -> FileInterface If we have diamond inheritance, we can't cast subclasses of arrow::io::ReadWriteFileInterface such as arrow::io::MemoryMappedFile to arrow::io::FileInterface. C++: #include <arrow/io/file.h> int main(void) { std::shared_ptr<arrow::io::MemoryMappedFile> memory_mapped_file; std::shared_ptr<arrow::io::FileInterface> file = memory_mapped_file; return 0; } Build result: a.cc: In function 'int main()': a.cc:8:52: error: conversion from 'std::shared_ptr<arrow::io::MemoryMappedFile>' to non-scalar type 'std::shared_ptr<arrow::io::FileInterface>' requested std::shared_ptr<arrow::io::FileInterface> file = memory_mapped_file; ^~~~~~~~~~~~~~~~~~ We can resolve it by using virtual inheritance. Author: Kouhei Sutou <kou@clear-code.com> Closes #282 from kou/use-virtual-inheritance-for-diamond-inheritance and squashes the following commits: e9d3a0b [Kouhei Sutou] ARROW-486: [C++] Use virtual inheritance for diamond inheritance