C++ Design Pattern for Passing a Large Number of Parameters

前端 未结 6 933
小鲜肉
小鲜肉 2020-12-25 13:44

I have a reasonably-sized class that implements several logically-related algorithms (from graph theory). About 10-15 parameters are required as input to the algorithm. Thes

6条回答
  •  无人及你
    2020-12-25 14:21

    I use this technique that you already mentioned:

    void runAlgorithm(AlgorithmGlobals const & globals);
    

    But would call the class AlgorithmParams instead.

提交回复
热议问题