[try Beta version]
Not logged in

 
Declaring a valarray of references?

Sep 26, 2014 at 4:09pm
Is it permissible to declare, for example, `std::valarray<int&>`? If so, how do I initialize such if the `valarray` is a class member?
Sep 26, 2014 at 4:39pm
Is it permissible to declare, for example, `std::valarray<int&>`?
No

You can use reference_wrapper to achieve same result
Sep 26, 2014 at 4:56pm
Thanks!
Sep 26, 2014 at 5:20pm
std::reference_wrapper<> does not satisfy the requirements of a numeric type.
http://en.cppreference.com/w/cpp/concept/NumericType
Topic archived. No new replies allowed.