From 487abe18478cd231e879039e0797dc82759f8e5e Mon Sep 17 00:00:00 2001 From: helly Date: Sat, 28 Jan 2006 16:33:22 +0000 Subject: [PATCH] - Fix warnings on selective compilers # The problem with new(this) is exception specification. Some compilers # neither allow to declare a placement delete operator nor do they take # no-throw declarations of the cinstructors into account. --- stream_lc.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/stream_lc.h b/stream_lc.h index c84e598a..85f7778f 100755 --- a/stream_lc.h +++ b/stream_lc.h @@ -222,13 +222,13 @@ protected: virtual pos_type seekoff(off_type off, std::ios_base::seekdir whence, std::ios_base::openmode = (std::ios_base::openmode)(std::ios_base::in | std::ios_base::out)) { - return fseek(fp, off, whence); + return fseek(fp, (long)off, whence); } virtual pos_type seekpos(pos_type fpos, std::ios_base::openmode = (std::ios_base::openmode)(std::ios_base::in | std::ios_base::out)) { - return fseek(fp, fpos, SEEK_SET); + return fseek(fp, (long)fpos, SEEK_SET); } virtual _Mybase * setbuf(_E *, std::streamsize) @@ -383,7 +383,8 @@ public: file_info& operator = (const file_info& oth) { - new (this) file_info(oth.fname, oth.ln, false); + *(const_cast(&this->fname)) = oth.fname; + ln = oth.ln; return *this; } -- 2.40.0