How to get a module with different type for code reuse?
问题 Now I have two modules. The functions in the two modules are exactly the same, but one is all about coping with real type, while another is about complex type. All these modules will be used in one program, thus according to different parameter input, we need to choose different modules. According to the major spirit of "code reuse", how to make these modules into one copy of code. And these modules require high performances(thus one need to avoid to use something like "if", "select"). I