AFAI read when the bayonet was invented, the division between riflemen and pikeneers became unnecessary since a rifle with a bayonet can do both jobs.
Since the bayonet isn't really the most complicated weapon to invent (I am not an expert, though) I wonder what had happened if the armies had...