Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

10
LINES

< > BotCompany Repo | #1004316 // YN - union type (yes/no)

JavaX fragment (include)

static class YN<Y, N> {
  Y yes;  // invariant: !sYes => (yes == null)
  N no;   // invariant: isYes => (no == null)
  bool isYes;
  
  *() {}
  *(bool *isYes) {}
  *(bool *isYes, Y *yes) {}
  *(bool *isYes, Y *yes, N *no) {}
}

download  show line numbers  debug dex  old transpilations   

Travelled to 16 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, sawdedvomwva, tslmcundralx, tvejysmllsmz, vouqrxazstgt

2 comment(s) hidden. show

Snippet ID: #1004316
Snippet name: YN - union type (yes/no)
Eternal ID of this version: #1004316/1
Text MD5: 300f9591f799357f31c75bcb886cef89
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2016-08-13 14:24:10
Source code size: 236 bytes / 10 lines
Pitched / IR pitched: No / No
Views / Downloads: 852 / 1428
Referenced in: [show references]