From 55dc98e21a1b9c74ef5cd7e97992abafffdd85a3 Mon Sep 17 00:00:00 2001 From: Zygo Blaxell Date: Tue, 12 Oct 2021 12:27:10 -0400 Subject: [PATCH] fd: finish deprecating vector in IO wrapper functions We can simply remove the template specializations, but if we do that, then existing code might accidentally write out the vector struct. Prevent regressions by deleting the vector specializations, making any code that uses them fail to build. Signed-off-by: Zygo Blaxell --- include/crucible/fd.h | 4 ++-- lib/fd.cc | 14 -------------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/include/crucible/fd.h b/include/crucible/fd.h index 89eec2e..d632bd5 100644 --- a/include/crucible/fd.h +++ b/include/crucible/fd.h @@ -130,8 +130,8 @@ namespace crucible { template<> void pread_or_die(int fd, ByteVector& str, off_t offset); template<> void pwrite_or_die(int fd, const ByteVector& str, off_t offset); // Deprecated - template<> void pread_or_die>(int fd, vector& str, off_t offset); - template<> void pwrite_or_die>(int fd, const vector& str, off_t offset); + template<> void pread_or_die>(int fd, vector& str, off_t offset) = delete; + template<> void pwrite_or_die>(int fd, const vector& str, off_t offset) = delete; template<> void pread_or_die>(int fd, vector& str, off_t offset) = delete; template<> void pwrite_or_die>(int fd, const vector& str, off_t offset) = delete; diff --git a/lib/fd.cc b/lib/fd.cc index bc32485..485939c 100644 --- a/lib/fd.cc +++ b/lib/fd.cc @@ -463,20 +463,6 @@ namespace crucible { return pread_or_die(fd, text.data(), text.size(), offset); } - template<> - void - pread_or_die>(int fd, vector &text, off_t offset) - { - return pread_or_die(fd, text.data(), text.size(), offset); - } - - template<> - void - pwrite_or_die>(int fd, const vector &text, off_t offset) - { - return pwrite_or_die(fd, text.data(), text.size(), offset); - } - template<> void pwrite_or_die(int fd, const ByteVector &text, off_t offset)