Commit b33e7b96 authored by Brad King's avatar Brad King
Browse files

FStream: Fix exception spec on our standard stream replacements

The MS standard library basic_istream and basic_ostream destructors
have an exception specification macro _NOEXCEPT.  Use it when we
define our basic_ifstream and basic_ofstream destructors to match
their parent class.

Change-Id: I35e944f50fbea8c5a0c2a1a9b9389f59b63ac455
parent 57c3ef1d
......@@ -18,6 +18,11 @@
namespace @KWSYS_NAMESPACE@
{
#if defined(_MSC_VER) && _MSC_VER >= 1400
# if defined(_NOEXCEPT)
# define @KWSYS_NAMESPACE@_FStream_NOEXCEPT _NOEXCEPT
# else
# define @KWSYS_NAMESPACE@_FStream_NOEXCEPT
# endif
template<typename CharType,typename Traits>
class basic_filebuf : public std::basic_filebuf<CharType,Traits>
{
......@@ -85,7 +90,7 @@ namespace @KWSYS_NAMESPACE@
return buf_;
}
~basic_ifstream()
~basic_ifstream() @KWSYS_NAMESPACE@_FStream_NOEXCEPT
{
buf_->close();
delete buf_;
......@@ -147,7 +152,7 @@ class basic_ofstream : public std::basic_ostream<CharType,Traits>
{
return buf_.get();
}
~basic_ofstream()
~basic_ofstream() @KWSYS_NAMESPACE@_FStream_NOEXCEPT
{
buf_->close();
delete buf_;
......@@ -160,6 +165,7 @@ class basic_ofstream : public std::basic_ostream<CharType,Traits>
typedef basic_ifstream<char> ifstream;
typedef basic_ofstream<char> ofstream;
# undef @KWSYS_NAMESPACE@_FStream_NOEXCEPT
#else
using @KWSYS_NAMESPACE@_ios_namespace::ofstream;
using @KWSYS_NAMESPACE@_ios_namespace::ifstream;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment