Forty-Fifth Doctor

According to one account, the 45th Doctor died in River Song's arms on a battlefield, telling her that she had yet to have many more adventures with his earlier selves.

However, what he had failed to tell River was that, knowing she was destined to be uploaded to the Library, but not wishing her to be "lonely", the Doctor had arranged to upload his mind into an artificial moon that would orbit the Library forever, which became known as the Doctor Moon. From then on, the Doctor's mind took on a new avatar, "Doctor Moon", within the simulated world of the Library's hard drive. (NOTVALID: Showrunner Showdown) The Tenth Doctor and River had encountered Doctor Moon during their first visit to the Library, before the Doctor knew the truth. (TV: Silence in the Library/Forest of the Dead)

Behind the scenes

 * The 45th Doctor and his story, referred as the "Very Last Scene in Doctor Who", was thought up by Steven Moffat in 2008 during the writing of Silence in the Library/Forest of the Dead. Though Moffat admitted that the idea would likely never make it to screen, it interestingly suggests that, whether he knew it or not, Colin Salmon technically played the 46th Doctor (or, rather, a post-mortem Doctor) on televised Doctor Who.
 * The numbered forms of the designations of the various incarnations of the Doctor are usually given in literal form (e.g. "First Doctor" rather than "1st Doctor"). The 45th Doctor, whose name has yet to be spelled "Forty-Fifth Doctor" in any official source, is thus an unusual exception to this rule.