_divy discovered this bug which I described in:
Basically, std::string appears to be mismanaging the underlying character buffers.
Compile this code with standard g++ and you'll get "b,a", but with Alchemy you'll get "b,b". This leads to serious errors in any STL container class that uses std::string, which you can see in _divy's earlier post.
s1 = "a";
s2 = s1; // copy constructor
s1 = "b";
// use your favorite TRACE function here
TRACE(s1); // expected: "b", actual: "b"
TRACE(s2); // expected: "a", actual: "b", ERROR
I know Alchemy is an experimental product but I find it very useful. I'm very lucky that the code I'm porting doesn't use std::string. However std::string is a very useful utility class and it is absolutely CRITICAL for this to function correctly for the majority of STL code to work.
Is there a formal bug submission process for Alchemy?
Attached is a quick work-around for the std::string bug. I implemented a few of the most common string methods so that you should be able to use cod3monk3y::string wherever you would normally use std::string. Just replace any
Please note that I haven't implemented everything from std::string. If you get compile errors you're probably using one of the missing methods.
After this fix, I also identified additional STL problems in ifstream.