Skip navigation
Tagged Unions in C
0:00 / 3:10

Tagged Unions in C

Тsфdiиg

@tsoding121K followers

Visit on X
618 likesDownloadOriginal post

26,267 views

Tagged Unions in C

8 Comments

Comments from the original post on X (Twitter)

  • DuskyElf's profile picture

    @DuskyDaily

    Honestly your tagged unions with `.as` thingy is not "verbose"... it does exactly what it's suppose to do and one can clearly see it

    15 likes

  • Anshuman Khanna's profile picture

    @AnshumanKhanna5

    I didn't know this "as" naming and it's genuinely interesting but I would replace "tag" with "type" or "is"

    4 likes

  • /* pakiwasi */'s profile picture

    @Wasi_______

    With C11's unnamed unions, you don't have to name the union anything, is a bit nicer than

    3 likes

  • Тsфdiиg's profile picture

    @tsoding

    Tracks: - -

    3 likes

  • Giacomo Masseroni's profile picture

    @giacomomasseron

    does the switch warn you when you miss a variant or does it silently fall through

    1 like

  • Szacher's profile picture

    @TutaNeraType

    Clever

  • CaptainAmericaTex's profile picture

    @CaptAmericaTx

    Tagged unions in C are fine to use. I developed a framework just for that purpose. The framework is just a one liner script "alias gcc=g++" . Once installed, the tags can be specified using the "class" feature of my framework. Framework tokens billed per 100 lines of C code.

  • HeavyMetalGeek's profile picture

    @ExpertOfNil

    Trying to make a language fit a different mold usually results in pain when things get complicated... in my experience.