_divy discovered this bug which I described in:
http://forums.adobe.com/message/2227018#2227018
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.
string s1;
string s2;
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?
/cm
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
using std::string;
with:
using cod3monk3y::string;
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.
/cm
North America
Europe, Middle East and Africa
Asia Pacific