... and I forgot the `hadamard` before the final semicolon to actually define the variable for the operator.

On Mon, May 16, 2022 at 11:44 AM Gašper Ažman <gasper.azman@gmail.com> wrote:

You know you can spell it asx *hadamard* yby definingstatic constexpr hadamard_t final {struct hadamard_proxy_t {matrix const* m;friend auto operator*(hadamard_proxy_t const& self, matrix const& y) -> matrix {return hadamard_product(*self.m, y);}};friend auto operator*(matrix const& x, hadamard_t) -> hadamard_proxy_t {return hadamard_proxy_t{&x};}};I omitted the associativity helpers which are symmetric for brevity, and of course I completely neglected all the lvalue/rvalue forwarders, but it's close enough to give a hint.GOn Mon, May 16, 2022 at 9:58 AM Patrik Tegelberg via Std-Proposals <std-proposals@lists.isocpp.org> wrote:--P.S. about overloading operator ->*.

Come to think of it, the dot product can not use *= so I’ll let * mean point wise, which do use *

= and let ->* mean dot product, so ->*= is never needed.

Sent from Mail for Windows

From:Sebastian Wittmeier via Std-ProposalsSent:Sunday, 15 May 2022 22:08To:std-proposals@lists.isocpp.orgCc:Sebastian WittmeierSubject:Re: [std-proposals] Add operator for element wise multiplication.

Hi Patrik,

operator->* (pointer-to-member) can be overridden and is very similar in precedence to multiplication (one step higher only).

Best,

Sebastian

--

Sebastian Wittmeier

Std-Proposals mailing list

Std-Proposals@lists.isocpp.org

https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals