C++ generic factory with multiple constructor signatures?
问题 Has anyone ever combined the classic generic factory by Andrei Alexandrescu (page 208 of Chapter 8 in Modern C++ Design) with the 'multifunction' capabilities of Boost.TypeErasure? That is, the flexibility to have several creator function signatures that vary with respect to number and type of parameters (but still have the same return type and are known at compile time). In other words, how to combine this slightly simplified generic Factory: #include <map> #include <utility> #include