14

In short, I'm looking for alternatives to STLPort. STLPort hasn't had an update for some time (since 2008?) and is lacking C++11 support. Does anyone know of any alternatives? I need to compile using various toolchains, for various architectures and various target OSes.

I'm going to start looking into the GNU C++ implementation and see how tied in it is to the GCC toolchain as an alternative and will post back with results. But if anyone has any up front knowledge here that'd be great.

Alternatives to this would be implementations of various key C++11 STL features like new smart pointer types and std::threads. Worst case I can probably extract smart pointers from boost. Are there any implementations of std::threads in terms of say pthreads or Windows threads?

Thanks

Andrew Parker
  • 1,425
  • 2
  • 20
  • 28
  • 3
    For better or worse, recommendation-style question are off-topic on SO. – Marcelo Cantos Nov 20 '13 at 09:00
  • `std::thread` is very close to `boost::thread` and what little differences were introduced will be retrofitted into `boost::thread` anyway, so it might help too. – Matthieu M. Nov 20 '13 at 09:01
  • 8
    The rule is absurd. This question has been closed because, allegedly, it "tends to attract opinionated answers and spam". The question is whether something exists or not, how opinionated are the answers likely to be? How opinionated is Matthieu's pseudo-answer above to the last part of the question? I understand that questions like "please recommend me a good web framework for C++" will attract opinionated answers. This is not like that. – Steve Jessop Nov 20 '13 at 09:42
  • @SteveJessop: The opinion part probably starts at the point that STL has nothing to do with the standard, yet alone C++11... – PlasmaHH Nov 20 '13 at 09:51
  • 4
    @PlasmaHH WHAT. I hope this is not yet another one of those nonsensical rants about "I am the only person in the room that insists in not understanding what everyone else seems to understand when someone uses 'STL', even though I have the ability to understand it but I am too stubborn to stop pretending I don't understand it"? – R. Martinho Fernandes Nov 20 '13 at 11:25
  • 5
    In my opinion, there is a big difference between questions of the type "What is the best $X?" (which can attract opinionated answers/fighting and spam) and this kind of question, which is of the type "Does there exist any $X?". This last kind is perfectly possible to answer definitively. – Magnus Hoff Nov 20 '13 at 11:37
  • 1
    This question is also a duplicate of http://stackoverflow.com/q/18923293/332733 – Mgetz Nov 20 '13 at 14:01
  • @R.MartinhoFernandes: I am just saying that some people have that opinion. Just like they have the opinion that the standard does not define anything called STL. Thats where the possible answers to the question start being opinionated. – PlasmaHH Nov 20 '13 at 15:12
  • 1
    @PlasmaHH: that would be a good (well, bad IMO, but logical) motivation for a hypothetical close reason "mentions STL, because doing so attracts opinion". It's not relevant to the far more general close reason, "asks for recommendations, because doing so attracts opinion". So, while I see your point that someone, somewhere, might provide an opinionated rant in place of an answer to this question, I don't think that's a genuine problem for the general quality of SO in the way that recommendations questions are :-) – Steve Jessop Nov 21 '13 at 17:16
  • Now open in the AOSP bug tracker: [Issue 216331: STLport does not support C++11](http://code.google.com/p/android/issues/detail?id=216331). – jww Jul 17 '16 at 22:52

2 Answers2

7

You can have a look at libc++. It is the standard C++ library for clang. I haven't tried to compile it with a different compiler or on a different Platform than MacOS. While there are certainly compiler dependencies, e.g., in the <type_traits> and the headers from the language support library (e.g., <exception>, <type_info>, etc), I can imagine that most of the code would compile with other compilers.

You already mentioned libstdc++ which seems to work OK with other compilers than gcc, at least on Linux and MacOS: clang used to use libstdc++ on MacOS. However, I don't now how happy libstdc++ is to be compiled with other compilers.

For specific classes, e.g. std::shared_ptr<T> or the std::thread group of classes, you may get suitable replacement implementations from Boost.

Dietmar Kühl
  • 150,225
  • 13
  • 225
  • 380
2

Other than the implementations shipped with gcc and clang, there is also a third-party open-source uSTL (with c++11 support). According to its website, it's aimed at reducing some of the overhead in "template bloat". However, it does not implement wchar strings. They also have non-standard memory allocation.

There are examples in their website showing how it can be used instead of gcc's stl.

thor
  • 21,418
  • 31
  • 87
  • 173