Measurement of the charge asymmetry in top-quark pair production in proton–proton collisions at