Use __typeof__ for C++11 compatibility.

Bug: 18466763
Change-Id: I13caa2d79a35db64ad3d9ed87fb0dc835c3e96dd