Skip to content

map中存储struct会导致类型判断错误 #55

Open
@wuyiwei2018

Description

@wuyiwei2018

Image

std::string FdogSerializer::getTypeName(string TypeName) {
#ifdef __GNUC__
	TypeName = abi::__cxa_demangle(TypeName.c_str(), 0, 0, 0);
#elif _MSC_VER
	if (TypeName.find("struct ") != string::npos && TypeName.find("class std::basic_string<char,struct ") == string::npos) {
		//只是针对string,暂不确定MSVC上面其他类型是否和gcc有出入
                //这里会错误的进来导致出bug
		TypeName = TypeName.substr(7);
	}
	//针对msvc应该做系统接口 过滤struct
#endif
	auto iter = this->TypeName.find(TypeName);
	if (iter != this->TypeName.end()) {
		return iter->second;
	}
	return TypeName;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions