Closed
Description
I'm plaing with cppfront trying to port some bits of code to get a feel of new syntax.
One thing I cannot figure out is how to write operator=:
to delegate construction.
I tried operator=: (out this, major: u32) = this(major, 0, 0, 0);
, operator=: (out this, major: u32) = this := (major, 0, 0, 0);
, even stared with operator=: (out this, major: u32) = Version(major, 0, 0, 0);
.
In cppfront source I didn't found code emitting, but I'm not yet 100% sure.
Did I missed the intended syntax or feature is not present at this time? Thanks!
For reference:
Version: @value type =
{
Major: u32 = 0;
Minor: u32 = 0;
Revision: u32 = 0;
Patch: u32 = 0;
operator=: (out this, major: u32) = { this.Major = major; }
operator=: (out this, major: u32, minor: u32) = { this.Major = major; this.Minor = minor; }
operator=: (out this, major: u32, minor: u32, revision: u32) = { this.Major = major; this.Minor = minor; this.Revision = revision; }
operator=: (out this, major: u32, minor: u32, revision: u32, patch: u32) =
{
this.Major = major;
this.Minor = minor;
this.Revision = revision;
this.Patch = patch;
}
Metadata
Metadata
Assignees
Labels
No labels