When Queen Anne died on 1 August 1714 she was the succession passed peacefully to a middle-aged German who knew little English; George, Elector of Hanover. His succession was guaranteed under the 1701 Act of Settlement which defined just who was heir to the throne once it became apparent that the Stuart line was soon to die out. The Act of Settlement stated that only the descendents of Sophia, Electress of Hanover (granddaughter of King James I) could inherit the throne and furthermore it excluded Catholics.
So on the day Queen Anne died her heir, by law, was the Elector of Hanover. But amazingly there were 58 people with a better claim to the throne, in bloodline, ahead of him, but all were excluded under the 1701 Act. The list included some young Princes who were to become rulers themselves one day -
4th on the list was Carlo Emanuele, Prince of Aosta, aged 13, later King of Sardinia.
5th, Louis, Dauphin of France, aged 4, later King of France.
6th, Luis, Prince of the Asturias, aged 6, later King of Spain.
8th, Fernando of Spain, aged 10 months, later King of Spain.
18th, Franz of Lorraine, aged 5, later Holy Roman Emperor.
49th, Francesco of Modena, aged 16, later Duke of Modena.