Add documentation for as<T>() function.