c++ - CPP reference to pointer in std::list -


this question has answer here:

this following code doesn't want compile:

#include <list>  int main() {   std::list<int *&> l;    return 0; } 

it's *& , not *. why ? ho hell why doesn't work ? tried answer on internet no way relevant. please ?

have day !

it not allowed use references container type. can use std::reference_wrapper instead.

std::list<std::reference_wrapper<int>> l; 

or can use pointer pointer

 std::list<int**> l; 

Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -