Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/GSL.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJuan Carlos Arevalo Baeza <jcab@JCABs-Rumblings.com>2022-04-27 00:41:10 +0300
committerGitHub <noreply@github.com>2022-04-27 00:41:10 +0300
commitf21f29d210939d4025069576e5891665b001f402 (patch)
tree8d8bbb524a590c82a402ffe50b29cb3da2068e4c
parent2bfd4950802a223dde37a08a205812b6dfdfeb61 (diff)
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.
-rw-r--r--include/gsl/narrow5
1 files 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 <exception> // for std::exception
namespace gsl
{
struct narrowing_error : public std::exception