Is it possible to model two programs in a single cvx block?

Consider the following two programs,

\begin{align}
max &~f(x) \
\textrm{s.t.} & ~x\in X.
\end{align}

and

\begin{align}
min &~f(x) \
\textrm{s.t.} & ~x\in X.
\end{align}

where X is a compact convex set and f(x) is nicely linear.
Question:
Is it possible for us to optimize these two programs within one ‘cvx-’ block to avoid declaring redudant constraints and variables?

No, these are separate problems. No solver that I am aware of can take advantage of their similarity.

Thank you very much.