template specialization
fix in cast macro
two files modified