From: Mikko Rasa Date: Wed, 6 Sep 2023 22:02:15 +0000 (+0300) Subject: Hide the delegating constructor of ZlibCompressed in the .cpp file X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=aa7a86068134a983da7adae5dc77422ce08a9254;p=libs%2Fcore.git Hide the delegating constructor of ZlibCompressed in the .cpp file MSVC has trouble with exporting the vftable if the main constructor is in a .cpp file but the delegating one is not. --- diff --git a/source/io/zlibcompressed.cpp b/source/io/zlibcompressed.cpp index 8896f14..23922e6 100644 --- a/source/io/zlibcompressed.cpp +++ b/source/io/zlibcompressed.cpp @@ -38,6 +38,10 @@ ZlibCompressed::Private::Private() } +ZlibCompressed::ZlibCompressed(Base &b, unsigned level): + ZlibCompressed(b, b.get_mode()&M_RDWR, level) +{ } + ZlibCompressed::ZlibCompressed(Base &b, Mode m, unsigned level): below(b) { diff --git a/source/io/zlibcompressed.h b/source/io/zlibcompressed.h index 1dc1569..a36be54 100644 --- a/source/io/zlibcompressed.h +++ b/source/io/zlibcompressed.h @@ -44,7 +44,7 @@ public: /** Creates a zlib de/compression object. The underlying object must be open for reading or writing, not both. The level parameter determines compression quality, ranging from 1 (fastest) to 9 (best compression). */ - ZlibCompressed(Base &b, unsigned level = 9): ZlibCompressed(b, b.get_mode()&M_RDWR, level) { } + ZlibCompressed(Base &, unsigned level = 9); /** Creates a zlib de/compression object. Mode must be either read or write, and compatible with the underlying object. */