Date: Tue, 10 May 2022 15:32:34 +0100
On Tue, 10 May 2022 at 14:13, Patrik Tegelberg via Std-Proposals <
std-proposals_at_[hidden]> wrote:
> I often use vector math and usually make a small vector class overloading
> the math operators. I always lack a good option for element wise
> multiplication (Hadamard product). Divide becomes element wise divide,
> multiplication becomes the dot product and % becomes the cross product.
> There are no more operators with the correct precedence to overload. I
> suggest making another symbol, with multiplication precedence, available
> for overloading.
>
>
>
> Matlab uses .* for their elementwise operations. They also use ./ and .^
> so it is an established convention. But both dot and asterisk have other
> meanings in C++, maybe ยค would be pretty, if we are allowed to use it.
>
> The symbol is not that important, the important thing is to get another
> operator with multiplication precedence.
>
Have you considered implementing the named operator idiom?
https://github.com/klmr/named-operator
std-proposals_at_[hidden]> wrote:
> I often use vector math and usually make a small vector class overloading
> the math operators. I always lack a good option for element wise
> multiplication (Hadamard product). Divide becomes element wise divide,
> multiplication becomes the dot product and % becomes the cross product.
> There are no more operators with the correct precedence to overload. I
> suggest making another symbol, with multiplication precedence, available
> for overloading.
>
>
>
> Matlab uses .* for their elementwise operations. They also use ./ and .^
> so it is an established convention. But both dot and asterisk have other
> meanings in C++, maybe ยค would be pretty, if we are allowed to use it.
>
> The symbol is not that important, the important thing is to get another
> operator with multiplication precedence.
>
Have you considered implementing the named operator idiom?
https://github.com/klmr/named-operator
Received on 2022-05-10 14:32:46