  Motivated by the Maximum Theorem for convex functions (in the setting of
linear spaces) and for subadditive functions (in the setting of Abelian
semigroups), we establish a Maximum Theorem for the class of generalized convex
functions, i.e., for functions $f:X\to \mathbb{R}$ that satisfy the inequality
$f(x\circ y)\leq pf(x)+qf(y)$, where $\circ$ is a binary operation on $X$ and
$p,q$ are positive constants. As an application, we also obtain an extension of
the Karush--Kuhn--Tucker theorem for this class of functions.
