3

Does c++ or the STL support the function valueOf within java.lang.Enum<e> such that it enables

elements = Syntax.valueOf(temp);

switch(elements) {}

and whereby elements is of type enum and temp is of type String?

Mushy
  • 2,535
  • 10
  • 33
  • 54
  • Since this question has already gotten 3 upvotes and no 100k+rep C++ people answered it, I suppose the answer is "no" within a 95% level of certainty. –  Apr 04 '13 at 18:38
  • Perhaps I should ask how [valueOf](http://docs.oracle.com/javase/6/docs/api/java/lang/Enum.html) could be implemented in c++ so as to enable such functionality? – Mushy Apr 04 '13 at 18:48
  • The problem with this is that during semantic analysis, the names of the enum members are discareded. Only the parser could tell you about a certain value what its name was. –  Apr 04 '13 at 18:49

0 Answers0