Resource theories can be used to formalize the quantification and manipulation of resources in quantum information processing such as entanglement, asymmetry and coherence of quantum states, and incompatibility of quantum measurements. Given a certain state or measurement, one can ask whether there is a task in which it performs better than any resourceless state or measurement. Using conic programming, we prove that any general robustness measure (with respect to a convex set of free states or measurements) can be seen as a quantifier of such outperformance in some discrimination task. We apply the technique to various examples, e.g. joint measurability, POVMs simulable by projective measurements, and state assemblages preparable with a given Schmidt number.arXiv:1812.09216v2 [quant-ph]