I have code as such:
typedef intptr_t ptr_t;
const int num_elements = 100;
ptr_t *pstr = (ptr_t *)malloc(sizeof(ptr_t) * num_elements);
std::array<ptr_t,num_elements> *parray = new (pstr) std::array<ptr_t,num_elements>;
我愿把第1至2号要素uff起来,因此,我想用的是:sh。
auto s = parray->begin()++;
auto e = parray->end()--;
std::random_shuffle ( s, e );
I get a complaint that there is no overloaded function for this. I m feeling really stupid at my inability to see what I m doing wrong. How do I do this right?
EDIT:由于答复和反馈,已经改为
auto s = parray->begin();
s++;
auto e = parray->end();
std::random_shuffle ( s, e );
然而,在汽车上,我发现:汽车在间接程度上不同于 in。