views:

1654

answers:

3

I'm working with the Android NDK, and since it does not currently support the STL, I was wondering if there are any brilliant people out there who have had success with this, or know which is better suited for the Android platform: uSTL or STLPort.

Thanks!

EDIT: Looks like another option may be CrystaX .NET.

From their website:

...customized distribution of Android NDK r3 which I have rebuilt from official sources. Support of C++ exceptions, RTTI and Standard C++ Library added.

+6  A: 

Just note that uSTL deviates from the standard quite a bit. For instance, it assumes UTF-8 encoding for std::string. Still looks interesting, though...

Nemanja Trifunovic
Now that's not really a deviation; the encoding of `char` (and even `wchar_t`) is implementation defined. Choosing UTF-8 on a platform where `cHAR_BIT==8` is not just allowed, it's reasonable.
MSalters
Take a look at the actual library code (or even documentation) and you'll see what I mean.
Nemanja Trifunovic
The uSTL does deviate in significant ways from the standard. It's really not a stdlib implementation, but an entire reimagining; check out how deque is "implemented": `#define deque list`.
Roger Pate
+6  A: 

I recently came across some helper scripts and a port of STLport for Android, by John Ripley.

There is also a related blog post with instructions of how to set it up.

I suppose that might make it easier to go with STLport.

Stjepan Rajko
this is great! can't wait to try it tonight. damn tricker treaters keep interrupting me though....
Andrew Garrison