stdcxx-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Sebor <mse...@gmail.com>
Subject Re: svn commit: r1242128 - in /stdcxx/branches/4.2.x: include/valarray tests/regress/26.valarray.binary.stdcxx-1061.cpp
Date Wed, 08 Feb 2012 23:30:58 GMT
...
> +int main ()
> +{
> +    const int a[] = { 0, 1, 0, 3, 0, -5, 0, -7, 0, -11 };
> +
> +    const std::valarray<int>   v0 (a, sizeof a);
                                          ^^^^^^^^
I'm sure you meant sizeof a / sizeof *a here...

> +    const std::valarray<bool>  v1 = std::operator&&  (v0, 1);
> +
> +    for (std::size_t i = 0; i<  sizeof a; ++i)

and the same or v0.size() here.

Martin

> +        assert ((a [i]&&  1) == v1 [i]);
> +
> +    return 0;
> +}
> +
>
>


Mime
View raw message