Open doctorjei opened 3 years ago
Sorry, my knowledge of C++ is small. Probably this construct is enabled in some higher standard of C++. I think Open Watcom C++ support C++98 standard with some extension.
Sorry, my markup was bad, so "#include <string>"
was missing.
Yeah, I am sure it wasn't in Open Watcom C++ old version. If you want me to mark this as a "feature", I can. I'm even happy to try to fix this. It's actually not too hard a fix - I don't know the code base so well, but I know C++ standards pretty well. If there is anyone who works on the standard library, and can help me navigate, I can submit a pull request. :)
You are welcome to any contribution to OW.
Now nobody is working on C++ compiler and standard library, due to very old standard support. There is some limitations by design of C++ compiler. I can help you with some basic information and OW build system C++ compiler sources are in bld/pluplus/c, bld/plusplus/a and bld/plusplus/h C++ run-time libraries are in bld/cpplib divided by appropriate class to subdirectories with cpp and h sudirectory for iostream classes it is bld/cpplib/iostream/cpp and bld/cpplib/iostream/h
Anyway there are regression tests in bld/plustest subdirectory C++ compiler is little bit broken by previous changes from contributors (some I fixed but not all). There is problem with regard to "this" operator and floating-point constants folding that you get some bug from testing.
Of course that is what I did. :) I don't mind pitching in on these sorts of small issues (I will try to squeeze in some time to fix this one in particular). I wouldn't exactly call the string class new - it's C++98 after all! :) (But probably after the open sourcing of OW I'm guessing.)
I can get around these issues myself, but it was a head scratcher at first. I'd just like to help make it better, whether via bug reports or other means.
Thanks. Any help is welcome.
I have been involved with the Open Watcom C++ standard library, and I am the author of Open Watcom's standard string template.
As I recall, and it has been a while, this particular feature was left unimplemented in anticipation of overhauling the IOStreams library to make it more modern. The idea was that it didn't make sense to mix standard strings with an ancient IOStreams library. However, that overhaul has not happened (yet), so it is long overdue to patch this issue.
I'd be happy to assist with navigating the C++ library headers, etc., if you are still interested in contributing. Finally doing that IOStreams overhaul would be nice, but there are compiler limitations that hold that back. Anyway, that's probably a bigger project than you were thinking about!
When compiling for a DOS target (maybe others?), in both the DOS version and WINNT version of WATCOM, cout fails when passed a C++ string object.
Example:
(teststr.cpp)
Compile with "wcl teststr.cpp" or "wpp teststr.cpp".
Expected result: Compiles program that prints "Foo"
Actual result: Compiler error: