Unique_ptr has no member function

I am upgrading my gcc 4.4 to gCC 4.7, I will do this to use 4.7.

My problem is what I use unique_ptr. I wrote this code

#include <iostream>
#include <memory>

#include <CL/cl.h>

using namespace std;

/*
 * 
 */
int main(int argc, char** argv) {

  std::unique_ptr<cl_platform_id[]>yt;
  yt = std::unique_ptr<icl_platform_id[]> (new cl_platform_id [3]);


  /* yt.get()[0] = ...... */ this is error no member found

    return 0;
}

but I want to use a member ytsuch as uique_ptr::get(), and the only function I get is this operator*, so what is the problem?

Edited by:

here is my problem: http://image-load.biz/?di=6FBY

+3
source share
2 answers

This will be a problem with the suggestions of the IDE members. std::unique_ptrcertainly has a member pointer get() const noexcept;, both in the default template and in the partial specialization for arrays.

get() , . , IDE, .

get() ; yt[0] .. get() , .

+2

- :

std::unique_ptr<cl_platform_id[]> yt ( new cl_platform_id[3] );
yt[0].some_member();
+2

All Articles