Context. The disc instability model (DIM) successfully explains why many accreting compact binary systems exhibit outbursts, during which their luminosity increases by orders of magnitude. The DIM correctly predicts which systems should be transient and works regardless of whether the accretor is a black hole, a neutron star or a white dwarf. However, it has been known for some time that the outbursts of X-ray binaries (which contain neutron-star or black-hole accretors) exhibit hysteresis in the X-ray hardness-intensity diagram (HID). More recently, it has been shown that the outbursts of accreting white dwarfs also show hysteresis, but in a diagram combining optical, EUV and X-ray fluxes. Aims. We examine here the nature of the hysteresis observed in cataclysmic variables and low-mass X-ray binaries. Methods. We use the Hameury et al. (1998) code for modelling dwarf nova outbursts, and construct the hardness intensity diagram as predicted by the disc instability model. Results. We show explicitly that the standard DIM -modified only to account for disc truncation -can explain the hysteresis observed in accreting white dwarfs, but cannot explain that observed in X-ray binaries. Conclusions. The spectral evidence for the existence of different accretion regimes / components (disc, corona, jets, etc.) should be based only on wavebands that are specific to the innermost parts of the discs, i.e. EUV and X-rays, which is a difficult task because of interstellar absorption. The existing data, however, indicate that an EUV/X-ray hysteresis is present in SS Cyg.