We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Right now, if use ternary operation ? : the C function is called twice:
inline std::string STL::BasicString::CStr() const { exception_info_t cur_exception_info; std::string result(std::string(stl_basic_string_char_cstr_const(&cur_exception_info, GetRawPointer()) ? stl_basic_string_char_cstr_const(&cur_exception_info, GetRawPointer()) : "")); STL::check_and_throw_exception(cur_exception_info.code, cur_exception_info.object_pointer); return result; }
however, better to generate something like that:
inline std::string STL::BasicString::CStr() const { exception_info_t cur_exception_info; const char* c_result = stl_basic_string_char_cstr_const(&cur_exception_info, GetRawPointer()); std::string result(std::string(c_result ? c_result : "")); STL::check_and_throw_exception(cur_exception_info.code, cur_exception_info.object_pointer); return result; }
The text was updated successfully, but these errors were encountered:
Solved #76 issue, now typedefs are completely processed
7bf9f72
Signed-off-by: Petr Petrov <[email protected]>
PetrPPetrov
No branches or pull requests
Right now, if use ternary operation ? : the C function is called twice:
inline std::string STL::BasicString::CStr() const
{
exception_info_t cur_exception_info;
std::string result(std::string(stl_basic_string_char_cstr_const(&cur_exception_info, GetRawPointer()) ? stl_basic_string_char_cstr_const(&cur_exception_info, GetRawPointer()) : ""));
STL::check_and_throw_exception(cur_exception_info.code, cur_exception_info.object_pointer);
return result;
}
however, better to generate something like that:
inline std::string STL::BasicString::CStr() const
{
exception_info_t cur_exception_info;
const char* c_result = stl_basic_string_char_cstr_const(&cur_exception_info, GetRawPointer());
std::string result(std::string(c_result ? c_result : ""));
STL::check_and_throw_exception(cur_exception_info.code, cur_exception_info.object_pointer);
return result;
}
The text was updated successfully, but these errors were encountered: