Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!usc!merlin.usc.edu!nunki.usc.edu!jeenglis From: jeenglis@nunki.usc.edu (Joe English) Newsgroups: comp.lang.c++ Subject: Re: Extension to switch statement. Message-ID: <6844@merlin.usc.edu> Date: 4 Dec 89 22:19:36 GMT References: <492@contex.UUCP> Sender: news@merlin.usc.edu Reply-To: jeenglis@nunki.usc.edu (Joe English) Organization: University of Southern California, Los Angeles, CA Lines: 19 ed@contex.UUCP (Edward Bagdonas) writes: > I am curious if any discussion or thought has been given to > extending the "switch" statment in C++ to handle non constant > expressions. That got hashed out in comp.lang.c++ a while ago; I think the main reason for not allowing non-constant and non-integer (class) expressions in case labels is that it's impossible to verify at compile time that each of the cases will have distinct values. That would significantly change the semantics of switch(). (Changing the semantics of switch() has been discussed as well, but most of the alternate proposals so far would violate the tenets of structured programming.) --Joe English jeenglis@nunki.usc.edu