From f21f29d210939d4025069576e5891665b001f402 Mon Sep 17 00:00:00 2001 From: Juan Carlos Arevalo Baeza Date: Tue, 26 Apr 2022 14:41:10 -0700 Subject: [PATCH] gsl/narrow should include (#1044) This file uses std::exception, so it should include the appropriate header. Normally it gets the STL's 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. does define std::exception even with _HAS_EXCEPTIONS=0. --- include/gsl/narrow | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/gsl/narrow b/include/gsl/narrow index 2c3c518..6cb1781 100644 --- a/include/gsl/narrow +++ b/include/gsl/narrow @@ -16,8 +16,9 @@ #ifndef GSL_NARROW_H #define GSL_NARROW_H -#include "assert" // for Expects -#include "util" // for narrow_cast +#include "assert" // for Expects +#include "util" // for narrow_cast +#include // for std::exception namespace gsl { struct narrowing_error : public std::exception