  The possible use of high-resolution rovibrational spectroscopy of the
hydrogen molecular ions H + 2 and HD + for an independent determination of
several fundamental constants is analyzed. While these molecules had been
proposed for metrology of nuclear-to-electron mass ratios, we show that they
are also sensitive to the radii of the proton and deuteron and to the Rydberg
constant at the level of the current discrepancies colloquially known as the
proton size puzzle. The required level of accuracy, in the 10 --12 range, can
be reached both by experiments, using Doppler-free two-photon spectroscopy
schemes, and by theoretical predictions. It is shown how the measurement of
several well-chosen rovibrational transitions may shed new light on the
proton-radius puzzle, provide an alternative accurate determination of the
Rydberg constant, and yield new values of the proton-to-electron and
deuteron-to-proton mass ratios with one order of magnitude higher precision.
