use forward declaration to replace type cast
Merge pull request #288 from volvet/develop_b

use forward declaration to replace type cast
Merge remote-tracking branch 'upstream/master' into travis.osx