Skip to content

Commit

Permalink
Cpp: Fix toString case generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
agdavydov81 committed Oct 12, 2023
1 parent 277264e commit 1791549
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,8 @@ public static void make(final String outputRoot, final List<ApiEntry> api, final
" return *this;\n" +
" }\n" +
" explicit operator std::string() const {\n" +
" char str[32];\n" +
" toString(str);\n" +
" return std::string(str);\n" +
" char str[512];\n" +
" return std::string(" + decimalNativePrefix + "to_string_3(_value, '.', str));\n" +
" }\n" +
" friend std::ostream& operator <<(std::ostream& output, " + dfpClassType + " const& a) {\n" +
" output << a._value;\n" +
Expand Down
2 changes: 1 addition & 1 deletion native/demo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ int main(int argc, char *argv[]) {
return 1;
}

std::cout << x << "(=" << x.toUnderlying() << ") " << op << " " << y << "(=" << y.toUnderlying() << ") = " << z << "(=" << z.toUnderlying() << ")" << std::endl;
std::cout << x << "(=" << x.toUnderlying() << ") " << op << " " << (std::string)y << "(=" << y.toUnderlying() << ") = " << z << "(=" << z.toUnderlying() << ")" << std::endl;
return 0;
}

0 comments on commit 1791549

Please sign in to comment.