AlphaMode is now typesafe
use unique_ptr instead of auto_ptr when c++11 is enabled