gbranden pushed a commit to branch master
in repository groff.

commit 2341eb4ad0e8e1306a73ac488e9ead2804145aa6
Author: G. Branden Robinson <[email protected]>
AuthorDate: Mon Aug 7 11:16:46 2023 -0500

    src/roff/troff/env.cpp: Improve comment style.
    
    Better illustrate the code economy of C++11 for this sort of logic.
---
 src/roff/troff/env.cpp | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/src/roff/troff/env.cpp b/src/roff/troff/env.cpp
index e0b1b2892..d3f9b4a8f 100644
--- a/src/roff/troff/env.cpp
+++ b/src/roff/troff/env.cpp
@@ -1258,13 +1258,16 @@ void font_change()
 
 bool is_family_valid(const char *fam)
 {
-  // std::vector<const char *> styles{"R", "I", "B", "BI"}; // C++11
+#if 0 // C++11, some day
+  std::vector<const char *> styles{"R", "I", "B", "BI"}; // C++11
+  for (auto style : styles) // C++11
+#else
   const size_t nstyles = 4;
   const char *st[nstyles] = { "R", "I", "B", "BI" };
   std::vector<const char *> styles(st, (st + nstyles));
-  // for (auto style : styles) // C++11
   std::vector<const char *>::iterator style;
   for (style = styles.begin(); style != styles.end(); style++)
+#endif
     if (!check_font(fam, *style))
       return false;
   return true;

_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit

Reply via email to