Re: Why not allow elementwise operations on tuples?

2023-01-19 Thread Sergei Nosov via Digitalmars-d-learn
On Wednesday, 18 January 2023 at 16:42:00 UTC, JG wrote: I guess such a method wouldn't be particularly generic since a tuple does not need to consist of types that have the same operations e.g. Tuple!(int,string) etc That's where `areCompatibleTuples` function comes in!

Re: Why not allow elementwise operations on tuples?

2023-01-18 Thread JG via Digitalmars-d-learn
On Monday, 16 January 2023 at 08:30:15 UTC, Sergei Nosov wrote: On Friday, 13 January 2023 at 15:27:26 UTC, H. S. Teoh wrote: [...] Yeah, that's clear that such an implementation is rather straightforward. Although, I'm a bit confused with your implementation - 1. it doesn't seem to use

Re: Why not allow elementwise operations on tuples?

2023-01-16 Thread Sergei Nosov via Digitalmars-d-learn
On Friday, 13 January 2023 at 15:27:26 UTC, H. S. Teoh wrote: On Fri, Jan 13, 2023 at 02:22:34PM +, Sergei Nosov via Digitalmars-d-learn wrote: Hey, everyone! I was wondering if there's a strong reason behind not implementing elementwise operations on tuples? Say, I've decided to store

Re: Why not allow elementwise operations on tuples?

2023-01-13 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jan 13, 2023 at 02:22:34PM +, Sergei Nosov via Digitalmars-d-learn wrote: > Hey, everyone! > > I was wondering if there's a strong reason behind not implementing > elementwise operations on tuples? > > Say, I've decided to store 2d points in a `Tuple!(int, int)`. It would > be