Skip to content
Snippets Groups Projects
  • Przemyslaw Gorszkowski's avatar
    7bcf4831
    C++: fix code completion of stl containers in internal code model · 7bcf4831
    Przemyslaw Gorszkowski authored
    
    This fix makes some trick and replaces existing typedef of 'pointer'
    to the simplest one(only in class unique_ptr), e.g.:
    template <class _Tp>
    class unique_ptr
    {
      typedef some_strange_things pointer;
      pointer operator->();
    }
    is replace with
    template <class _Tp>
    class unique_ptr
    {
      typedef _Tp* pointer;
      pointer operator->();
    }
    
    In most of the implementation of unique_ptr it should work.
    
    Similar approach is done for std::list, std::vector, std::queue, std::set,
    std::multiset, std::unordered_set.
    
    It is done in this hacky way to omit problems with cyclic and complex
    resolving of typedefs.
    
    Change-Id: I1363dfc5e23d3cd2fa7af7fc27423bfbac2d894d
    Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@qt.io>
    7bcf4831
    History
    C++: fix code completion of stl containers in internal code model
    Przemyslaw Gorszkowski authored
    
    This fix makes some trick and replaces existing typedef of 'pointer'
    to the simplest one(only in class unique_ptr), e.g.:
    template <class _Tp>
    class unique_ptr
    {
      typedef some_strange_things pointer;
      pointer operator->();
    }
    is replace with
    template <class _Tp>
    class unique_ptr
    {
      typedef _Tp* pointer;
      pointer operator->();
    }
    
    In most of the implementation of unique_ptr it should work.
    
    Similar approach is done for std::list, std::vector, std::queue, std::set,
    std::multiset, std::unordered_set.
    
    It is done in this hacky way to omit problems with cyclic and complex
    resolving of typedefs.
    
    Change-Id: I1363dfc5e23d3cd2fa7af7fc27423bfbac2d894d
    Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@qt.io>