Skip to main content

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the standard does not force/specify that. And because references are not objects, you cannot point to them. Storing elements in an array means there is some kind of index address (i.e., pointing to elements at a certain index),; and that is why you cannot have arrays of references, because you cannot point to them.

YouseUse boost::reference_wrapper, or boost::tuple instead.instead; or just pointers.

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the standard does not force/specify that. And because references are not objects, you cannot point to them. Storing elements in an array means there is some kind of index address (i.e., pointing to elements at a certain index), and that is why you cannot have arrays of references because you cannot point to them.

Youse boost::reference_wrapper, or boost::tuple instead. or just pointers.

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the standard does not force/specify that. And because references are not objects, you cannot point to them. Storing elements in an array means there is some kind of index address (i.e., pointing to elements at a certain index); and that is why you cannot have arrays of references, because you cannot point to them.

Use boost::reference_wrapper, or boost::tuple instead; or just pointers.

added 53 characters in body
Source Link
navigator
  • 1.6k
  • 1
  • 13
  • 19

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the compilerstandard does not force/specify that. And because references are not objects, you cannot point to them. AnStoring elements in an array means there is some kind of index address (i.e., pointing to elements at a certain index), and that is why you cannot have arrays of references because you cannot point to them.

Youse boost::reference_wrapper, or boost::tuple instead. or just pointers.

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the compiler does not force/specify that. And because references are not objects, you cannot point to them. An array means there is some kind of index address (i.e., pointing to elements at a certain index), and that is why you cannot have arrays of references.

Youse boost::reference_wrapper, or boost::tuple instead. or just pointers.

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the standard does not force/specify that. And because references are not objects, you cannot point to them. Storing elements in an array means there is some kind of index address (i.e., pointing to elements at a certain index), and that is why you cannot have arrays of references because you cannot point to them.

Youse boost::reference_wrapper, or boost::tuple instead. or just pointers.

Source Link
navigator
  • 1.6k
  • 1
  • 13
  • 19

Because like many have said here, references are not objects. they are simply aliases. True some compilers might implement them as pointers, but the compiler does not force/specify that. And because references are not objects, you cannot point to them. An array means there is some kind of index address (i.e., pointing to elements at a certain index), and that is why you cannot have arrays of references.

Youse boost::reference_wrapper, or boost::tuple instead. or just pointers.