Boost logo

Boost :

Subject: Re: [boost] [qvn] Why doesn't QVM use [] or () to access vector and matrix elements?
From: Vicente J. Botet Escriba (vicente.botet_at_[hidden])
Date: 2015-12-10 01:44:54


Le 10/12/2015 01:03, Emil Dotchevski a écrit :
> On Wed, Dec 9, 2015 at 3:46 PM, Vicente J. Botet Escriba <
> vicente.botet_at_[hidden]> wrote:
>
>> Hi,
>>
>> These operators could be used for views
>>
>> So instead of
>>
>> (m, <http://zajo.github.io/boost-qvm/operator_mod_rationale.html>A42)
>> *= 42;
(sorry for the formating)

(m, A42) *= 42
>> we could have in C++11
>>
>> ref(m)(4,2) *= 42;
>> ref(m)[4][2) *= 42;
>>
> Once you do ref(m) you can have any operator you want for accessing the
> elements, but that's too inconvenient, and to certain degree against the
> spirit of the library.
I don't see where this is against anything.
> In QVM you can multiply m1*m2 regardless of their
> exact static types, you don't have to do ref(m1)*ref(m2) to get the correct
> op* to kick in.
I have not suggested that.
>
> What problem are we solving with this anyway? What's wrong with:
>
> (m,A42) *= 42;

See other post about how controversial seems to be operator,.

Well I was just replaying to one of the Q/A of the doc. You say that you
don't need []().
I say that on views it is the most clear thing when we use C++11.

BTW, qvm::vec and qvm::mat could provide the access operators as well.

Vicente


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk