dimanche 30 octobre 2016

C++ approach to configuration

I am implementing a library, and using abstract class which has some different implementations. I want to allow user to select particular implementation using a config file e.g. config.h. I have two questions:

  • How to achieve this without macro ?
  • I am using inheritance to implement the subclasses, is there a way to allow statically compile/link with the chosen class to avoid virtual function lookup and allow other inlining optimization?

I am looking for c++11 solution, but c++14 and c++17 is welcome too.

Aucun commentaire:

Enregistrer un commentaire