http://www.cppblog.com/mzty/archive/2006/11/03/14631.html