I'm stuck with C++03 for now, and I want to create a global function that accepts any number of type-safe arguments (up to a reasonable limit if necessary, like 9).
I have access to the full boost library in my code base, so I'm hoping boost::mpl::vector
can be useful here. I also don't want this to be too inconvenient to write. Syntax at the call site should be simple like so:
LogDebugMessage("Number of cats and dogs:", m_myPets->NumCats(), m_myPets->NumDogs());
What would be the best way to implement this, in a type safe way?
EDIT
I also realize I could use template specialization for this, but I don't want to end up defining the same struct 9 times, one for each additional template parameter. That's just too messy for this. I'd like to avoid that if at all possible.