Guest User

Untitled

a guest
Aug 26th, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.32 KB | None | 0 0
  1. fn require(comptime TRAIT: var) void {
  2.     const fn_names_to_check = @typeInfo(TRAIT).Struct;
  3. }
  4.  
  5. const default = struct {
  6.     fn testing() Wrapper() { return Wrapper; }
  7. };
  8.  
  9. fn Wrapper() type {
  10.     comptime { require(default); }
  11.  
  12.     return struct {};
  13. }
  14.    
  15. pub fn main() void {
  16.  
  17.     var crash = default.testing();
  18. }
Advertisement
Add Comment
Please, Sign In to add comment