Pointer type without delete operator
<p>Is it possible to construct a pointer type that acts and behaves (in terms of syntax) like a normal pointer, except that you can't call delete on it (perhaps with preprocessor macros)?</p>

<p>Example usage:</p>

<pre><code>borrowed_ptr&lt;int&gt; ptr = new int[42]; 

ptr[12] = 1;
cout&lt;&lt;ptr[12]&lt;&lt;endl; //prints 1

delete ptr; //error: no operator delete for borrowed_ptr&lt;int&gt;

borrowed_ptr&lt;int&gt; ptr2 = new int(2);
delete ptr2; //error
</code></pre>

<p>Also this should work too</p>

<pre><code>template&lt;typename t&gt;
void func(borrowed_ptr&lt;t&gt; *arg)
{
   delete arg; //error
}

//somewhere else
int *t = new *int;
func(t);
</code></pre>

<p>However, "reverse assignement" shouldn't work.</p>

<pre><code>borrowed_ptr&lt;int&gt; foo = new int(2);
int* bar = foo; //error
</code></pre>

<p>Whether or not the * is required when declaring a borrowed_ptr doesn't matter to me. It's just important that code like</p>

<pre><code>template &lt;typename T&gt;
void foo(T* whatever)
{
    //do something with whatever
   delete whatever; 
}

template &lt;typename T&gt;
void bar(T* whatever)
{
    //do something with whatever
}
</code></pre>

<p>can be called with this borrowed_ptr like this:</p>

<pre><code>borrowed_ptr&lt;int&gt; a = new int(2);
foo(a); //error, function tries to delete
bar(a); //fine, and has the same semantics as handing over a raw int*
</code></pre>

<p>Note: i don't want the data deleted when the pointer type is delete itself. it should just be a borrowed ptr that can not be deleted because it belongs to someone else.</p>
