This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: [[patch] valarray (was Re: valarray_copy implementation question)
On Thu, Nov 26, 2009 at 5:58 AM, Christian BRUEL <christian.bruel@st.com> wrote:
> what about
>
> #include <valarray>
> using namespace std;
>
> int main(void)
> {
> ?int n = 1;
>
> ?valarray<int> ?dest(n);
> ?valarray<bool> b(false, n);
> ?valarray<int> ?src(1, n);
>
> ?dest[b] = src;
Christian,
the array expression `dest[b]' has length 0; the array expression `src'
has length 1. That violates the equal length precondition.
>
> ?return 0;
> }
>
> is it a user error also ?
yes; it is user confusion; the same as we discussed before.
-- Gaby