diff --git a/src/OpenFOAM/db/IOstreams/memory/ISpanStream.H b/src/OpenFOAM/db/IOstreams/memory/ISpanStream.H index 9b03bf7bbd..d1d259b193 100644 --- a/src/OpenFOAM/db/IOstreams/memory/ISpanStream.H +++ b/src/OpenFOAM/db/IOstreams/memory/ISpanStream.H @@ -119,10 +119,10 @@ public: #if __cplusplus >= 201703L //- Construct (shallow copy) from std::string_view content explicit ispanstream(std::string_view s) - { + : buffer_type(const_cast(s.data()), s.size()), - stream_type(static_cast(this)); - } + stream_type(static_cast(this)) + {} #endif //- Construct (shallow copy) from span character content