contract CappedToken is MintableToken {

    uint public cap;

    /**
     * @dev Function to mint tokens
     * @param _to The address that will receive the minted tokens.
     * @param _amount The amount of tokens to mint.
     */
    function mint(address _to, uint _amount)
        public
        onlyOwner
        canMint
    {
        require(totalSupply.add(_amount) <= cap);

        super.mint(_to, _amount);
    }

}
/**
 * @title Capped token
 * @dev Mintable token with a token cap.
 */
function mint(address _to, uint _amount)
    public
    onlyOwner
    canMint
{
    require(totalSupply.add(_amount) <= cap);

    super.mint(_to, _amount);
}

/**
 * @dev Function to mint tokens
 * @param _to The address that will receive the minted tokens.
 * @param _amount The amount of tokens to mint.
 */