I found a solution that comes closest to what I want:
public Plane Init (ValueTuple<CVector4D, CVector4D, CVector4D, CVector4D>? vertices = null)
{
CVector4D[] m_vertices;
m_vertices = new Vector4D[4];
// the elements of m_vertices are default initialized as intended already here
if (vertices != null)
{
m_vertices[0] = vertices?.Item1;
m_vertices[1] = vertices?.Item2;
m_vertices[2] = vertices?.Item3;
m_vertices[3] = vertices?.Item4;
}
return this;
}
It is just a little guesswork and a heck of a lot of googling to find out how to write this down.
Btw,
m_vertices[0] = vertices?.Item1 ?? vertices?.Item1 : new Vector4D (0,0,0,0);
Does not work; Instead of ":", I get an error that ";" or "}" are expected.
Simply writing
m_vertices[0] = vertices.Item1;
after the "if (vertices != null)" statement yields an error as well: (Vector4D, Vector4D, Vector4D, Vector4D) does not contain a definition for 'Item1' and no accessible extension method 'Item1' accepting a first argument of type '(Vector4D, Vector4D, Vector4D, Vector4D)' could be found.
Using target system ".NET Framework 4.7.2".
With the hint of Orace below, this is probably the (or a) right way to do it:
public Plane Init (ValueTuple<CVector4D, CVector4D, CVector4D, CVector4D>? vertices = null)
{
CVector4D[] m_vertices;
m_vertices = new Vector4D[4];
// the elements of m_vertices are default initialized as intended already here
if (vertices != null)
{
m_vertices[0] = vertices.Values.Item1;
m_vertices[1] = vertices.Values.Item2;
m_vertices[2] = vertices.Values.Item3;
m_vertices[3] = vertices.Values.Item4;
}
return this;
}