Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

无法支持namespace下的结构体 #71

Open
coolxv opened this issue Nov 29, 2022 · 5 comments
Open

无法支持namespace下的结构体 #71

coolxv opened this issue Nov 29, 2022 · 5 comments

Comments

@coolxv
Copy link

coolxv commented Nov 29, 2022

namespace abc{
struct person
{
	int id;
	std::string name;
	int age;
};
}
REFLECTION(abc::person, id, name, age)
@qicosmos
Copy link
Owner

qicosmos commented Dec 1, 2022

暂时不支持这种写法,先和struct保持在同一个命名空间内吧。

@coolxv
Copy link
Author

coolxv commented Dec 1, 2022

namespace abc{
struct person
{
	int id;
	std::string name;
	int age;
};

REFLECTION(abc::person, id, name, age)
}

这种也会报错。

@qicosmos
Copy link
Owner

qicosmos commented Dec 1, 2022

要把abc::去掉,主要原因是生成字段名的宏里面的字符串如果含有::就会报名字不存在的错误,简言之,不要有::在宏里面。

@coolxv
Copy link
Author

coolxv commented Dec 2, 2022

namespace abc{
struct person
{
	int id;
	std::string name;
	int age;
};

REFLECTION(person, id, name, age)
}

using def = abc::persion;
REFLECTION(def, id, name, age)

这两种都不行

@qicosmos
Copy link
Owner

qicosmos commented Dec 2, 2022

放到里面是可以的,你要用最新的iguana哈

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants