black-magic

How is a StringBuffer passing data through voids with no fields in the Class?

Given: Class has no fields, every variable is local. littleString was created by refactoring bigString in Eclipse: public String bigString() { StringBuffer bob = new StringBuffer(); this.littleString(bob); return bob.toString(); } private void littleString(final StringBuffer bob) { bob.append...

C++ template black magic

This needs only work in g++. I want a function template<typename T> std::string magic(); such that: Class Foo{}; magic<Foo>(); // returns "Foo"; Class Bar{}; magic<Bar>(); // returns "Bar"; I don't want this to be done via specialization (i.e. having to define magic for each type. I'm hoping to pull some macro/template black magic...