CppInterOp
C++ Language Interoperability Layer
Loading...
Searching...
No Matches
Macros
Sins.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CONCATE_(X, Y)   X##Y
 Standard-protected facility allowing access into private members in C++.
 
#define CONCATE(X, Y)   CONCATE_(X, Y)
 
#define ALLOW_ACCESS(CLASS, MEMBER, ...)
 
#define ACCESS(OBJECT, MEMBER)
 

Macro Definition Documentation

◆ ACCESS

#define ACCESS (   OBJECT,
  MEMBER 
)
Value:
(OBJECT).* \
Access( \
(Only_##MEMBER<std::remove_reference_t<decltype(OBJECT)>>*)nullptr)

Definition at line 21 of file Sins.h.

◆ ALLOW_ACCESS

#define ALLOW_ACCESS (   CLASS,
  MEMBER,
  ... 
)
Value:
template <typename Only, __VA_ARGS__ CLASS::*Member> \
struct CONCATE(MEMBER, __LINE__) { \
friend __VA_ARGS__ CLASS::*Access(Only*) { return Member; } \
}; \
template <typename> struct Only_##MEMBER; \
template <> struct Only_##MEMBER<CLASS> { \
friend __VA_ARGS__ CLASS::*Access(Only_##MEMBER<CLASS>*); \
}; \
template struct CONCATE(MEMBER, \
__LINE__)<Only_##MEMBER<CLASS>, &CLASS::MEMBER>
#define CONCATE(X, Y)
Definition Sins.h:8

Definition at line 9 of file Sins.h.

◆ CONCATE

#define CONCATE (   X,
 
)    CONCATE_(X, Y)

Definition at line 8 of file Sins.h.

◆ CONCATE_

#define CONCATE_ (   X,
 
)    X##Y

Standard-protected facility allowing access into private members in C++.

Use with caution!

Definition at line 7 of file Sins.h.