cpp-stub icon indicating copy to clipboard operation
cpp-stub copied to clipboard

ACCESS_PRIVATE_STATIC_FIELD lead to build failure when the static member is initialized out of the class body

Open 1shuaiwpeng opened this issue 2 years ago • 1 comments

remove the line "Type Class::Name;" can fix the failure

/*#define ACCESS_PRIVATE_STATIC_FIELD(Class, Type, Name)
**Type Class::Name; / * #define ACCESS_PRIVATE_STATIC_FIELD(Class, Type, Name)
PRIVATE_ACCESS_DETAIL_ACCESS_PRIVATE_STATIC_FIELD(
PRIVATE_ACCESS_DETAIL_UNIQUE_TAG, Class, Type, Name)

1shuaiwpeng avatar Jan 30 '23 06:01 1shuaiwpeng

another solution is to call the destination macro: PRIVATE_ACCESS_DETAIL_ACCESS_PRIVATE_STATIC_FIELD

1shuaiwpeng avatar Jan 30 '23 06:01 1shuaiwpeng