codepad.org is down so i just attached a toy programm with an
implementation of this technique (works at least in msvc10)
Please at least include required headers and add 'using' directives to
the attached code, so that it will be enough to compile :)