Reply to topic

KDevelop unique_ptr autocompletion

User avatar macbie
Registered Member
Posts
2
Karma
0
OS

KDevelop unique_ptr autocompletion

Tue Nov 06, 2012 12:07 am
Hi,
Is it possible to get autocompletion for objects pointed by std::unique_ptr ? For example (using openCV):
Code: Select all
std::unique_ptr<cv::FileStorage> fs(new cv::FileStorage(filename, cv::FileStorage::READ));
  if( fs->/*some proposals here*/ isOpened() )

Code is working properly but without autocompletion.
Is there some way to get this working?

There was a bug reported some time ago:
http://article.gmane.org/gmane.comp.kde ... gs/1265092
User avatar scummos
KDE Developer
Posts
627
Karma
4
OS
Hi,

The problem seems to be that KDevelop's parser chokes on some of the complicated templates which are used in the unique_ptr header, for example this one:
Code: Select all
template<typename _Up, typename _Ep, typename = typename
   std::enable_if
     <std::is_convertible<typename unique_ptr<_Up, _Ep>::pointer,
                pointer>::value
      && !std::is_array<_Up>::value
      && ((std::is_reference<_Dp>::value
      && std::is_same<_Ep, _Dp>::value)
          || (!std::is_reference<_Dp>::value
         && std::is_convertible<_Ep, _Dp>::value))>
        ::type>
   unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
   : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
   { }

This is a bug in the KDevelop C++ parser, which is no easy thing to fix. If you want to speed up the process of fixing it, maybe identifying a minimal example of such a template and posting that to the bug report would help.

Greetings,
Sven



 
Reply to topic

Bookmarks



Who is online

Registered users: 16777216, Baidu [Spider], Bing [Bot], Buddlespit, eddiej, Exabot [Bot], garthecho, Google [Bot], Hans, housepig, irisuser, La Ninje, Majestic-12 [Bot], orbmiser, paulmcvay, qwach, searchfgold6789, Sentynel, soldier9599, tparrott, Uri_Herrera, veqz, Yahoo [Bot]