Author Topic: Using C++11 uniform initialization of POD struct breaks autocomplete  (Read 3849 times)

acarlow

  • Junior Community Member
  • Posts: 3
  • Hero Points: 1
Given a POD struct Student,

Code: [Select]
struct Student {
    std::string first;
    std::string middle;
    std::string last;
    int id;
}

Student aaron = {"first", "middle", "list", 83924};    // notice we used "=" here
aaron.      <---- auto-completion works here

Code: [Select]
Student aaron2 {"first", "middle", "last", 83842};    // In C++11 the "=" is redundantaaron2.     <---- auto-completion gives no completions here

If Student is modified to contain member methods (i.e. no longer a POD) then auto-completion works for the methods (but not other members) if the instance was initialized using the new "uniform initialization" syntax:

Code: [Select]
struct Student {
    std::string first;
    std::string middle;
    std::string last;
    int id;

    std::string getFirst() const;
}

Student aaron3 {"first", "middle", "last", 1234};
aaron3.       <--- getFirst() method is offered as a completion here, but not the other public members.

So basically uniform initialization of POD breaks auto completion from what I can see.
« Last Edit: February 27, 2014, 10:12:28 PM by acarlow »

brainsalad

  • Community Member
  • Posts: 11
  • Hero Points: 2
Re: Using C++11 uniform initialization of POD struct breaks autocomplete
« Reply #1 on: April 16, 2014, 03:37:44 PM »
Indeed, it does.  I hope it's fixed soon  :'(

Dennis

  • Senior Community Member
  • Posts: 3965
  • Hero Points: 517
Re: Using C++11 uniform initialization of POD struct breaks autocomplete
« Reply #2 on: April 17, 2014, 01:31:36 PM »
I'll add this to my list for the next release.

brainsalad

  • Community Member
  • Posts: 11
  • Hero Points: 2
Re: Using C++11 uniform initialization of POD struct breaks autocomplete
« Reply #3 on: April 17, 2014, 01:52:42 PM »
I'll add this to my list for the next release.

Cool!  This is what makes me feel good about paying up.