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

use forward declaration to replace type cast