Advertisement
Guest User

Untitled

a guest
May 14th, 2019
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. const std = @import("std");
  2. const builtin = @import("builtin");
  3. const typeinfo = builtin.TypeInfo;
  4. const typeid = builtin.TypeId;
  5. const S = builtin.TypeInfo.Struct;
  6.  
  7. pub fn main() anyerror!void {
  8.     const info = @typeInfo(std);
  9.  
  10.     switch (info) {
  11.         typeinfo.Struct => |s| {
  12.             for (s) |field| {
  13.  
  14.             }
  15.         },
  16.         else => unreachable,
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement