Re: Problem with opBinary

2018-11-14 Thread realhet via Digitalmars-d-learn
Thanks, this make it clear. (This also explains the existence of opBinaryRight)

Re: Problem with opBinary

2018-11-14 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, November 14, 2018 2:54:27 AM MST realhet via Digitalmars-d- learn wrote: > Hi, > > Just a little weird thing I noticed and don't know why it is: > > I have a FilePath struct and I wanted to make it work with the > "~" operator and an additional string. > > So I've created a global

Problem with opBinary

2018-11-14 Thread realhet via Digitalmars-d-learn
Hi, Just a little weird thing I noticed and don't know why it is: I have a FilePath struct and I wanted to make it work with the "~" operator and an additional string. So I've created a global funct: FilePath opBinary(string op:"~")(FilePath p1, string p2){ return FilePath(p1, p2);