lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 66c2d25 2/4: Recast a confusingly unused enum


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 66c2d25 2/4: Recast a confusingly unused enumerative type
Date: Fri, 29 Jun 2018 19:39:42 -0400 (EDT)

branch: master
commit 66c2d2543d40f78a2c3765a78615a93934d5f67a
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Recast a confusingly unused enumerative type
    
    This was never anything but an illustrative example, but it looked like
    something that might actually be used. Reworked it to refer to an
    obviously alien problem domain.
---
 mc_enum_type_enums.hpp |  8 ++++----
 mc_enum_types.cpp      | 26 +++++++++++++-------------
 mc_enum_types.hpp      |  2 +-
 3 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/mc_enum_type_enums.hpp b/mc_enum_type_enums.hpp
index fc613d1..aab25ff 100644
--- a/mc_enum_type_enums.hpp
+++ b/mc_enum_type_enums.hpp
@@ -27,10 +27,10 @@
 // Here write illustrative examples and anything that doesn't follow
 // the macro paradigm, such as enumerators with nonsuccessive values.
 
-enum enum_option
-    {mce_option_A
-    ,mce_option_B
-    ,mce_option_C
+enum enum_tragic
+    {mce_aeschylus
+    ,mce_euripides
+    ,mce_sophocles
     };
 
 /// Output target for illustration generation.
diff --git a/mc_enum_types.cpp b/mc_enum_types.cpp
index ff1dfc3..b7e1cf5 100644
--- a/mc_enum_types.cpp
+++ b/mc_enum_types.cpp
@@ -34,23 +34,23 @@
 // calculated bounds are checked at compile time.
 
 // These lines would engender diagnostics
-//   extern enum_option const option_enums[] = {mce_option_A, mce_option_B};
-//   extern char const*const option_strings[] = {"A", "B", "C", "X"};
+//   extern enum_tragic const tragic_enums[] = {mce_aeschylus, mce_euripides};
+//   extern char const*const tragic_strings[] = {"Aeschylus", "Euripides", 
"Sophocles", "X"};
 // at compile time when the template is explicitly instantiated.
 
-extern enum_option const option_enums[] =
-    {mce_option_A
-    ,mce_option_B
-    ,mce_option_C
+extern enum_tragic const tragic_enums[] =
+    {mce_aeschylus
+    ,mce_euripides
+    ,mce_sophocles
     };
-extern char const*const option_strings[] =
-    {"A"
-    ,"B"
-    ,"C"
+extern char const*const tragic_strings[] =
+    {"Aeschylus"
+    ,"Euripides"
+    ,"Sophocles"
     };
-template<> struct mc_enum_key<enum_option>
-  :public mc_enum_data<enum_option, 3, option_enums, option_strings> {};
-template class mc_enum<enum_option>;
+template<> struct mc_enum_key<enum_tragic>
+  :public mc_enum_data<enum_tragic, 3, tragic_enums, tragic_strings> {};
+template class mc_enum<enum_tragic>;
 
 extern mcenum_emission const emission_enums[] =
     {mce_emit_nothing
diff --git a/mc_enum_types.hpp b/mc_enum_types.hpp
index e420d7d..babc40a 100644
--- a/mc_enum_types.hpp
+++ b/mc_enum_types.hpp
@@ -31,7 +31,7 @@
 // the macro paradigm, such as enumerators with nonsuccessive values,
 // for parallelism with the corresponding TU.
 
-typedef mc_enum<enum_option    > e_option          ;
+typedef mc_enum<enum_tragic    > e_tragic          ;
 typedef mc_enum<mcenum_emission> e_emission        ;
 typedef mc_enum<rounding_style > mce_rounding_style;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]