I think this method is much more elegant. You would save 7 lines of code by removing the class. (Actually less, because you'd need to do the typedef.