Advertisement
Guest User

Untitled

a guest
Oct 14th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #![feature(const_generics)]
  2.  
  3. trait Helper {
  4. type T;
  5. }
  6.  
  7. struct ITE<True, False, const B: bool> (
  8. ::core::marker::PhantomData<(True, False)>,
  9. );
  10.  
  11. impl<True, False> Helper
  12. for ITE<True, False, {true}>
  13. {
  14. type T = True;
  15. }
  16.  
  17. impl<True, False> Helper
  18. for ITE<True, False, {false}>
  19. {
  20. type T = False;
  21. }
  22.  
  23. fn foo<const B: bool>() {
  24. let a: <ITE<(), (), {B}> as Helper>::T;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement