amir9480 / vscode-cpp-helper

vscode extension to create implementation for c++ function prototypes.

Home Page:https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.cpp-helper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Better friend function support

Binary-Song opened this issue · comments

commented

It doesn't seem to generate friend functions correctly. The friend token was not removed and the class scope :: was added.
Amazing plugin by the way! Saved me a lot of work.

Hello.

I need more information about what you are doing.
Please explain with code samples.
The header code, the implementation, and the expected output.

commented

Hi.

For expamle, I have a class with a friend << operator declaration.

//my_class.h
#ifndef MY_CLASS_H
#define MY_CLASS_H

#include <iostream>

class MyClass
{
    friend std::ostream &operator<<(std::ostream &strm, MyClass obj);
};

#endif

When I use Create Implementation on operator<<, the output goes like this:

//my_class.cpp
friend std::ostream &MyClass::operator<<(std::ostream &strm, MyClass obj)
{
}

while the expected output should be something like:

//my_class.cpp
std::ostream &operator<<(std::ostream &strm, MyClass obj)
{
}