Is there any way to achieve the same in CLI/C++ as the following:
namespace Test
{
static class TestClass
{
static (int a, int b) test = (1, 0);
static void v()
{
var a = test.a;
var b = test.b;
_ = (a, b);
}
}
} So is there any way to create an ValueTuple with other names than Item1 and Item2 in CLI/C++ so it could be used inside C#. I am using .Net Framework 4.7.
The names of the values are not part of
ValueTuple<...>
.The names are maintained by the compiler and attributes are added when they need to be communicated to outside code.
Check it out on sharplab.io.
This:
will be translated into this: