daily pastebin goal
17%
SHARE
TWEET

Untitled

a guest Jun 13th, 2018 50 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. void Optionalを使って()
  2. {
  3.     ubyte[] buf;
  4.  
  5.     if (Optional!size_t r = read(buf))
  6.     {
  7.         if (r == 0)
  8.         {
  9.             // EAGAIN
  10.         }
  11.         else
  12.         {
  13.             // 通常コース
  14.         }
  15.     }
  16.     else
  17.     {
  18.         // EOF
  19.     }
  20. }
  21.  
  22.  
  23. void あるいは配列のnullを使って()
  24. {
  25.     ubyte[] buf;
  26.  
  27.     if (ubyte[] r = read(buf))
  28.     {
  29.         if (r == 0)
  30.         {
  31.             // EAGAIN
  32.         }
  33.         else
  34.         {
  35.             // 通常コース
  36.         }
  37.     }
  38.     else
  39.     {
  40.         // EOF
  41.     }
  42. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top