Search:
Forum
General C++ Programming
Declaring a valarray of references?
Declaring a valarray of references?
Sep 26, 2014 at 4:09pm UTC
xuinkrbin
(31)
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 UTC
MiiNiPaa
(8886)
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 UTC
xuinkrbin
(31)
Thanks!
Sep 26, 2014 at 5:20pm UTC
JLBorges
(13770)
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.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs