Quantcast
Channel: Visual C forum
Viewing all articles
Browse latest Browse all 15302

I got this complie error 2265

$
0
0


The code is somewhat like this:

template <class T>
class A {
private:
T* ptr_;
public:
T* get() { return ptr_; }
T& operator*() const {
ASSERT(ptr != NULL);
return *ptr;
}
};


int main() {
A<char[]> a;
}

and i got 

Error C2265: (identifier) : reference to a zero-sized array is illegal in "T& operator*()" const 

How can i make the complie happpy. I am using Vs2003 not 13 .

by the way, the problem occur when i complie a cpp file which include socped_ptr.h

Hope you can point me out from this!


Viewing all articles
Browse latest Browse all 15302

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>