This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Adapting switch(x){case(y):...} with hashing


<<One of the obscure to-do list entries had an interesting request.
Currently, g++ uses a binary-tree / jump-table solution to handle
"switch"-"case" processing.  The request was for hashing to be added as
an alternative when it would be appropriate (the note suggested sparse
sets).  Obviously, the problem is more complex than it appears, and
binary searches have their strengths.  Also, memory requirements may be
critically fatal.
>>

I don't see why there should be any conceptual problem in implementing
this approach. All BCPL compilers had this capability for example.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]