
Jonathan Wakely wrote:
Could you supply an extra arg to the macro, specifying whether to define the nullary overload for the cases where it is wanted and valid ?
Yep, or maybe minimum, maximum parameter arguments. Although, if the macro gets complex enough to invoke, it'll probably be better just to write it out manually. For example, your tolower test becomes: #include <string> #include <algorithm> #include <cctype> struct { template <class T> T operator()(T x) { return std::tolower(x); } } tolower_visitor; int main() { std::string s("FNORD"); std::transform(s.begin(), s.end(), s.begin(), tolower_visitor); } Which is perhaps better since it has the correct return type. Daniel