Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: RE: C6000 7.4.5 auto_ptr re-assignment error: no operator "="

$
0
0

Hi,

Since the function return a temporary and a temorary can be bind only to a const reference, the compiler should autopatically convert it to auto_ptr_ref and use the operator

  auto_ptr& operator= (auto_ptr_ref<X> r)

While it seem to me that the C6000 TI library defines only the operator:

    auto_ptr<X>& operator=(auto_ptr_ref<X& r)    //TI bug or non C++ std compliance?

That is another reference to non-const object and again cannot be bind to a temporary.

Note that auot_ptr_ref  "is an instrumental class to allow certain conversions that allow auto_ptr objects to be passed to and returned from functions" (from www.cplusplus.com)


Viewing all articles
Browse latest Browse all 91752

Trending Articles



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