I'm having trouble compiling the example below, linux platform for esp8266, I need to sample how to return an object through a class function to another class. As an example, it is necessary to have access to the object (c) defined in class C, in class A.
#include "b.h"
#include "c.h"
class A
{
public:
int start();
private:
B b;
C c;
int x;
}
a.cpp
int A::start()
{
c = b.copy();
x = c.d;
return x;
}
#include "c.h"
class B
{
private:
C c;
public:
C copy();
}
b.cpp
C B::copy()
{
c.add(1);
return c;
}
class C
{
public:
void add(int x);
int d;
}
c.cpp
void c.add(int x)
{
C::d = x + 10;
return;
}
main()
{
A a;
int y;
y = a.start();
cout << y ;
}
When trying to compile in Linux the example above the same one presents the error: "error: use of deleted function"