We discuss the problem of implementing generalized measurements (POVMs) with linear optics, either based upon a static linear array or including conditional dynamics. In our approach, a given POVM shall be identified as a solution to an optimization problem for a chosen cost function. We formulate a general principle: the implementation is only possible if a linear-optics circuit exists for which the quantum mechanical optimum (minimum) is still attainable after dephasing the corresponding quantum states. The general principle enables us, for instance, to derive a set of necessary conditions for the linear-optics implementation of the POVM that realizes the quantum mechanically optimal unambiguous discrimination of two pure nonorthogonal states. This extends our previous results on projection measurements and the exact discrimination of orthogonal states. Notes: Peter van Loock and Kae Nemoto, National Institute of Informatics, 2-1-2 Hitotsubashi, Chiyoda-ku, Tokyo 101-8430, Japan Philippe Raynal and Norbert Lutkenhaus, Quantum Information Theory Group, Institute of Theoretical Physics I, Institute of Optics, Information and Photonics (Max-Planck Forschungsgruppe), Universitat Erlangen-Nurnberg, Staudtstr.7, D-91058 Erlangen, Germany 13 Pages