https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120682

--- Comment #6 from Benjamin Schulz <schulz.benjamin at googlemail dot com> ---
Jakub Jelinek wrote:
> The reason why it is invalid is that T lookup fails in the declare mapper > 
> definition.

Yes, And that exactly is the problem.

> #pragma omp declare mapper(myvec<double> v) map(v, v.data[0:v.len])
> instead of your line would be valid 

Yes, but usually, one defines the template type only when one is using the
template.

Say, I want to use myvec with doubles, floats, ints, 

In the current implementation, I would then have to define 3 separate mappers.
One for the float, one for the int and another for the double template
parameter...


In c++ templates are there that you do not have to write specific code for all
these types separately.

Once you have to write long code for each datatype, then a template is
useless..

Reply via email to