mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
gsl/narrow should include <exception> (#1044)
This file uses std::exception, so it should include the appropriate header. Normally it gets the STL's <exception> header included via the gsl/assert file, but this is skipped with _HAS_EXCEPTIONS=0. I understand _HAS_EXCEPTIONS is undocumented and unsupported, but regardless, the appropriate header should be included here. Alternatively, gsl/narrow should be modified to support _HAS_EXCEPTIONS=0, like gsl/assert was. But I'm not proposing that change. <exception> does define std::exception even with _HAS_EXCEPTIONS=0.
This commit is contained in:
parent
2bfd495080
commit
f21f29d210
@ -18,6 +18,7 @@
|
||||
#define GSL_NARROW_H
|
||||
#include "assert" // for Expects
|
||||
#include "util" // for narrow_cast
|
||||
#include <exception> // for std::exception
|
||||
namespace gsl
|
||||
{
|
||||
struct narrowing_error : public std::exception
|
||||
|
Loading…
Reference in New Issue
Block a user