Half-wave voltage doubler question
You are correct; C1 will discharge while it is charging C2, so Vout will be  less than 2Vin after one cycle. However you may have missed this:-


  Note that this double output voltage is not instantaneous but
  increases slowly on each input cycle, eventually settling to 2Vp.


But how much will C1 discharge, and what will the output voltage be after 1 cycle? It depends on the relative values of C1 and C2. 

If both capacitors have the same value then C1 transfers half its charge to C2 and Vout becomes equal to Vin. On the next cycle C1 transfers 1/4 of its charge and Vout rises to Vin+Vin/2. This cycle continues with C1 discharging less and less and the output voltage getting ever closer to (but not quite reaching) 2Vin.  

However if C1 is much is much larger than C2 it will lose less charge per cycle and the output voltage will rise faster. If C1 is 100 times larger than C2 then Vout will reach 99% of 2Vin in the first cycle.