Author Topic: C++11 code completion (CC) doesn't work with list-initialization  (Read 4685 times)

Offline Dert

  • Single posting newcomer
  • *
  • Posts: 5
Windows 7 64-bit
Latest MinGW installed using this guide
C::B svn 9854

C++11 CC is enabled and works
(here is confirmation:

http://s24.postimg.org/b55qqbh6d/c_11_cc_enabled_confirm.png
)

Here's what i get when tried to use C++11's list-initialization (with "=" CC works, without - no):

http://s8.postimg.org/n4dy10ovp/c_11_with_equal.png http://s8.postimg.org/hrp3mw0z9/c_11_without_equal.png

So list-initialization currently isn't supported with CC? Is there any way to get it?
« Last Edit: August 08, 2014, 04:56:58 pm by Dert »

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: C++11 code completion (CC) doesn't work with list-initialization
« Reply #1 on: October 10, 2015, 04:08:55 pm »
 list<int> lst_1  {1, 2,  3};
 lst_1.     //  <-- cc doesn't show any hint..

 list<int> lst_2 = {1, 2, 3};
 lst_2.   // <- cc do work well ....
====
windows 10, mingw , c::b svn 10503

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5915
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: C++11 code completion (CC) doesn't work with list-initialization
« Reply #2 on: October 11, 2015, 12:33:40 am »
list<int> lst_1  {1, 2,  3};
 lst_1.     //  <-- cc doesn't show any hint..

 list<int> lst_2 = {1, 2, 3};
 lst_2.   // <- cc do work well ....
====
windows 10, mingw , c::b svn 10503
A known bug, I have add this post here: Code::Blocks / Tickets / #33 C++11 Initializer lists fool code completion
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline nanyu

  • Almost regular
  • **
  • Posts: 188
  • nanyu
Re: C++11 code completion (CC) doesn't work with list-initialization
« Reply #3 on: October 11, 2015, 03:51:54 pm »
thanks!