Boost logo

Boost Users :

Subject: Re: [Boost-users] [Multi-Array] Coercion to multi_array_ref from array_view?
From: Rhys Ulerich (rhys.ulerich_at_[hidden])
Date: 2012-09-20 14:01:15


> I suspect, without having looked at the code itself, that
> multi_array_ref was never designed to be coerced from array_view, but
> I don't understand why.

Me neither. I'd be interested in hearing if it was a design oversight
or a design decision.

> Is there a solution to my foo_ref problem that
> doesn't involve moving all such functions to headers and templating
> them?

Short of changing your example to be

void foo_ref(array_3d::array_view<2>::type& ma)
{
    ma[0][1] = 1.0;
}

I'm unaware of another non-templated solution. I expect that I'm
wrong, however, and that something prettier should be possible.

- Rhys


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net