Boost logo

Boost :

From: Kai Szuttor (kai_at_[hidden])
Date: 2020-12-09 07:46:07


actually i’m aware of this template. However, it does not take into account the involved binary operator.
Am I missing something or is this template missing this customisation point?

A related follow up question, looking at the vectors operator*, e.g., if i want to express the resulting type of a scalar multiplication with mixed types like a Vector of ints with a double scalar type. How can I implement that? The return type of that function overload is determined by deduce_vec<A>::type which only takes into account the vector data type and not the type for the scalar.

> On 7. Dec 2020, at 21:29, Emil Dotchevski via Boost <boost_at_[hidden]> wrote:
>
> See deduce_vec2 (https://boostorg.github.io/qvm/#deduce_vec2): this
> template is used by QVM whenever it needs to deduce a vector type of
> certain dimension from the types of two user-supplied function parameters
> (there is also deduce_vec, which is used by unary operations).
>
> If you don't care about the resulting vector type but only about its scalar
> type, you can specialize deduce_scalar instead (
> https://boostorg.github.io/qvm/#deduce_scalar), which is used by
> deduce_vec2 by default.
>
> On Mon, Dec 7, 2020 at 8:58 AM Kai Szuttor via Boost <boost_at_[hidden]>
> wrote:
>
>> Hey all,
>>
>> concerning vector operations in boost qvm,
>> is it possible to somehow specify the return type of a binary operator
>> with mixed scalar input data, e.g.
>>
>> operator+(vec<double, 3>, vec<int, 3>)
>>
>> ?
>>
>> Could not find the customisation point to do this depending on the
>> involved operation.
>>
>> Thanks in advance,
>>
>> Kai
>>
>> _______________________________________________
>> Unsubscribe & other changes:
>> http://lists.boost.org/mailman/listinfo.cgi/boost
>>
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost


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