Forty-Fifth Doctor

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

However, what she 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 — with the Doctor's mind taking 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", were thought up by Steven Moffat in 2008 during the writing of the Library two-parter, though Moffat admitted 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.