24 lines
910 B
Diff
24 lines
910 B
Diff
From f02d273ee39ae047222e362c37213d29135dc661 Mon Sep 17 00:00:00 2001
|
|
From: Jonathan Wakely <github@kayari.org>
|
|
Date: Tue, 2 Feb 2016 23:39:11 +0000
|
|
Subject: [PATCH] Convert stream to bool explicitly
|
|
|
|
In C++11 there is no implicit conversion from iostream classes to `void*`, just an explicit conversion to bool.
|
|
---
|
|
src/util/debug.cpp | 2 +-
|
|
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
|
|
diff --git a/src/util/debug.cpp b/src/util/debug.cpp
|
|
index 54c67fe..66676c6 100644
|
|
--- a/src/util/debug.cpp
|
|
+++ b/src/util/debug.cpp
|
|
@@ -76,7 +76,7 @@ void invoke_gdb() {
|
|
for (;;) {
|
|
std::cerr << "(C)ontinue, (A)bort, (S)top, (T)hrow exception, Invoke (G)DB\n";
|
|
char result;
|
|
- bool ok = (std::cin >> result);
|
|
+ bool ok = bool(std::cin >> result);
|
|
if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
|
|
switch(result) {
|
|
case 'C':
|