Search
Setup for Free
C
C#
•
2y ago
Claudiu HBann
CSharp's C++ std::variant
Is there a
s
t
d
:
:variant in C
# like in C
+
+
?
If not what is the closest thing to it
?
C#
Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,155
Members
View on Discord
Similar Threads
Was this page helpful?
Yes
No
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
J
Jimmacle
•
7/31/24, 9:06 PM
object
object
and pattern matching
?
C
Claudiu HBann
OP
•
7/31/24, 9:07 PM
what do you mean by pattern matching
?
checking for the object
's type
?
J
Jimmacle
•
7/31/24, 9:07 PM
basically
, yes
J
Jimmacle
•
7/31/24, 9:08 PM
what problem are you trying to solve
?
C
Claudiu HBann
OP
•
7/31/24, 9:08 PM
are any popular libraries that mimics the most C
+
+ STL containers
?
J
Jimmacle
•
7/31/24, 9:08 PM
i don
't know of any
, i use C
# standard containers
J
Jimmacle
•
7/31/24, 9:09 PM
the names are different but there are lots that work the same as STL containers
J
Jimmacle
•
7/31/24, 9:10 PM
for variant specifically you could look at
https://github.com/mcintyre321/OneOf
GitHub
GitHub - mcintyre321/OneOf: Easy to use F#-like ~discriminated~ uni...
Easy to use F
#
-like
~discriminated
~ unions for C
# with exhaustive compile time matching
- mcintyre321
/OneOf
J
Jimmacle
what problem are you trying to solve?
C
Claudiu HBann
OP
•
7/31/24, 9:34 PM
i dont have a specific problem
, i was ust curious
D
deprecatio
•
8/1/24, 6:03 AM
just to give choice theres also dunet
https://github.com/domn1995/dunet
GitHub
GitHub - domn1995/dunet: C# discriminated union source generator
C
# discriminated union source generator
. Contribute to domn1995
/dunet development by creating an account on GitHub
.
object
object
Similar Threads
✅ Csharp serializing
C
C# / help
3y ago
❔ csharp error
C
C# / help
3y ago