Message from C, C++ discussions

January 2020

— #pragma once

— 

/* a.hpp */
#include "b.hpp"
class A
{
public:
A() : b(*this) {}

int whatever_property;

private:
B _b
};

/* b.hpp */

class A;
class B
{
public:
B() = delete;
B(A &a) : _a(a) {}

template <typename T>
void foo(T t)
{
//Here I need the complete type definition
_a.whatever_property += t;
}

private:
A &_a;
};

— With my configuration, it won't prevent the error

— User invest_with has 1/2 warnings; be careful!
The latest warn was because:
crypto that 1000% works

— Oh sorry

— No worries!

— Can anyone reply please

— Any standard and complete resources or documentation for C and C++

— There's probably a better design, but I faced a similar problem a while ago and ended up changing the design

Message permanent page

— Generally it' s not a problem since we can move the complete type inclusion in a cpp file. But when I need to use both the templated parameter and the complete A type, I end up with this. It's very limiting

Message permanent page

— I hope that c++ modules will improve this situation :) https://www.modernescpp.com/index.php/c-20-modules

Message permanent page

— Hey guys I learnt C now suggests me a project to practice