Author Topic: SmartSense C++11-Features  (Read 4363 times)

Offline rldml

  • Single posting newcomer
  • *
  • Posts: 2
SmartSense C++11-Features
« on: June 22, 2016, 09:03:00 pm »
Hello there,

 a short search in this forum didn't bring any results, so i try it to write a new post.

Is there an option to configure SmartSense to recognize C++11-Code?

This is my example code:
File: vehikel.h

#ifndef __CLASS_VEHIKEL__
#define __CLASS_VEHIKEL__

#include <string>

class Vehikel
{
    private: unsigned int maxGeschwindigkeit;
    private: unsigned int anzahlReifen;
    private: std::string typ;

    public: Vehikel();
    public: Vehikel(unsigned int maxGeschwindigkeit, unsigned int anzahlReifen, std::string typ);
    public: std::string GetTyp();
};

#endif // __CLASS_VEHIKEL__

File: vehikel.cpp:

#include "vehikel.h"

Vehikel::Vehikel()
{
    this->typ = "Auto";
    this->maxGeschwindigkeit = 110;
    this->anzahlReifen = 4;
}

Vehikel::Vehikel(unsigned int maxGeschwindigkeit, unsigned int anzahlReifen, std::string typ)
{
    this->typ = typ;
    this->anzahlReifen = anzahlReifen;
    this->maxGeschwindigkeit = maxGeschwindigkeit;
}

std::string Vehikel::GetTyp()
{
    return this->typ;
}

File: main.cpp:

#include <iostream>
#include "vehikel.h"

using namespace std;

int main()
{
    Vehikel Car();
    string bla = Car.GetTyp();
    cout << bla << endl;
    return 0;
}


If i change the line "Vehikel Car();" to "Vehikel Car{};" (C++11-Standard), retype the line under that, SmartSense will not detect Car as a valid object and don't offer me any options.

It's my pleasure to use the new intialization-type, but i don't want to miss SmartSense. Is there a way to combine both things?

edit: same to this->... :(

Greetz, Ronny
« Last Edit: June 22, 2016, 09:04:34 pm by rldml »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: SmartSense C++11-Features
« Reply #1 on: June 23, 2016, 08:21:16 am »
No, there is no setting, because the support in the parser for c++11 is missing.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline rldml

  • Single posting newcomer
  • *
  • Posts: 2
Re: SmartSense C++11-Features
« Reply #2 on: June 23, 2016, 08:51:15 am »
Thank you for reply =D.

So, i have to adjust my coding-behavior until i am good enough to add this feature by myself if possible... Is this plugin Open Source too?

Greetz, Ronny
« Last Edit: June 23, 2016, 08:52:46 am by rldml »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: SmartSense C++11-Features
« Reply #3 on: June 23, 2016, 09:35:38 am »
Yes it is. Also there is the clang based codecompletion plugin available on github.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6077
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
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.