0

If a name is aliased by using keyword, and this name need be used as a forward declaration, which name should be used? The origin name or the new name? The name could refer to a plain data type, a class, or a namespace.

For example:

A.h:

using ID = int;
namespace AA {class C;}
using namespace BB = AA;

B.cpp

//here function f is implemented
#include "A.h"

B.h: here ID need a forward declaration

class ID;
namespace BB {class C;}
void f(ID i, BB::C c);

or we could only choose belowing one

//class int;
namespace AA {int C;}
void f(int i, AA::C c);
heLomaN
  • 1,634
  • 2
  • 22
  • 33

0 Answers0