Replace 'and' with '&&' in tutorials
Not all C++ compilers support and
instead of &&
(MSVC for example).
Full patch is also here: https://patch-diff.githubusercontent.com/raw/matthiasdiener/gmsh/pull/1.patch
From 79b7ee4610844633d90973a790a100794e40a6ed Mon Sep 17 00:00:00 2001
From: Matthias Diener <mdiener@illinois.edu>
Date: Fri, 30 Apr 2021 09:34:58 -0500
Subject: [PATCH] tutorial: replace 'and' with '&&' in C++
---
tutorial/c++/t13.cpp | 2 +-
tutorial/c++/t21.cpp | 2 +-
tutorial/c++/t3.cpp | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/tutorial/c++/t13.cpp b/tutorial/c++/t13.cpp
index caf9cc1057..5acc8026c3 100644
--- a/tutorial/c++/t13.cpp
+++ b/tutorial/c++/t13.cpp
@@ -123,7 +123,7 @@ int main(int argc, char **argv)
auto checkForEvent = [=]() -> bool {
std::vector<std::string> action;
gmsh::onelab::getString("ONELAB/Action", action);
- if(action.size() and action[0] == "check") {
+ if(action.size() && action[0] == "check") {
gmsh::onelab::setString("ONELAB/Action", {""});
createGeometryAndMesh();
gmsh::graphics::draw();
diff --git a/tutorial/c++/t21.cpp b/tutorial/c++/t21.cpp
index 5891a7ede5..e6fbbf096e 100644
--- a/tutorial/c++/t21.cpp
+++ b/tutorial/c++/t21.cpp
@@ -188,7 +188,7 @@ int main(int argc, char **argv)
auto checkForEvent = [=]() -> bool {
std::vector<std::string> action;
gmsh::onelab::getString("ONELAB/Action", action);
- if(action.size() and action[0] == "check") {
+ if(action.size() && action[0] == "check") {
gmsh::onelab::setString("ONELAB/Action", {""});
partitionMesh();
gmsh::graphics::draw();
diff --git a/tutorial/c++/t3.cpp b/tutorial/c++/t3.cpp
index cc24905571..1b7b30da4a 100644
--- a/tutorial/c++/t3.cpp
+++ b/tutorial/c++/t3.cpp
@@ -125,7 +125,7 @@ int main(int argc, char **argv)
auto checkForEvent = [=]() -> bool {
std::vector<std::string> action;
gmsh::onelab::getString("ONELAB/Action", action);
- if(action.size() and action[0] == "check") {
+ if(action.size() && action[0] == "check") {
gmsh::onelab::setString("ONELAB/Action", {""});
createGeometryAndMesh();
gmsh::graphics::draw();