News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

SmartSense C++11-Features

Started by rldml, June 22, 2016, 09:03:00 PM

Previous topic - Next topic

rldml

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

oBFusCATed

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!]

rldml

#2
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

oBFusCATed

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!]

ollydbg

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.