This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KDevelop unique_ptr autocompletion

Tags: kdevelop kdevelop kdevelop
(comma "," separated)
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
Global Moderator
Posts
1175
Karma
7
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


I'm working on the KDevelop IDE.


Bookmarks



Who is online

Registered users: bancha, Bing [Bot], Evergrowing, Google [Bot], lockheed, mesutakcan, Sogou [Bot]