STL
STL
Does anyone know of a good easy to port to kernel space STL. I have come across quite a few and they all rely heavily on exceptions and lots of headers I don't have and don't wish to create. I would like to be able to use vectors, lists, dequeues, and at least some of the associative containers. I thought I would ask before I try my hand at ripping the exceptions out and trying to make up the rest of the headers.
Thanks,
Frank
Thanks,
Frank
- Kevin McGuire
- Member
- Posts: 843
- Joined: Tue Nov 09, 2004 12:00 am
- Location: United States
- Contact:
I bought "The C++ Standard - Incorporating Technical Corrigendum 1" (published by Wiley), but there is also the final Draft of the C++ Standard (also including technical corrigendum 1. Just for the record: imho in some STLs you can disable exceptions with a define or something similar.
- carbonBased
- Member
- Posts: 382
- Joined: Sat Nov 20, 2004 12:00 am
- Location: Wellesley, Ontario, Canada
- Contact:
SGI used to have good docs on the interfaces, and insight into the "under-workings" of the library; I used to use those sites whenever developing on top of STL, at least. I assume they would be of some use if implementing your own STL, as well (but they are mostly geared towards development on top of STL).
A searched google, and found this -- looks like the same site I remember:
http://www.sgi.com/tech/stl/
--Jeff
A searched google, and found this -- looks like the same site I remember:
http://www.sgi.com/tech/stl/
--Jeff
Re: STL
You can disable exceptions fairly easily (IIRC it's a define indeed), replacing allocation & such by your own should be trivial. Do notice what functions return when they fail without exception, because you should (must) handle those cases.frank wrote:Does anyone know of a good easy to port to kernel space STL. I have come across quite a few and they all rely heavily on exceptions and lots of headers I don't have and don't wish to create. I would like to be able to use vectors, lists, dequeues, and at least some of the associative containers. I thought I would ask before I try my hand at ripping the exceptions out and trying to make up the rest of the headers.
I ported SGI STL to my kernel before. It wasn't too hard. You can disable exceptions by editing stl_config.h; apart from that, the only problem I found was that it calls fprintf(stderr, ...) in a few places.
EDIT: I just noticed that it needs new.h. That means you have to define operator new, but the wiki explains that (under "new and delete").
EDIT: I just noticed that it needs new.h. That means you have to define operator new, but the wiki explains that (under "new and delete").