www.digitalmars.com         C & C++   DMDScript  

c++.stlsoft - STLSoft on C

reply Dave <annonymous notsure.org> writes:
I downloaded STLSoft 1.9.27 and have been perusing some of the
code.  I quickly found the following:

/* Template support */
#if defined(__cplusplus) && \
    !defined(STLSOFT_CF_TEMPLATE_SUPPORT)

template-based and require this support.
#endif /* STLSOFT_CF_TEMPLATE_SUPPORT */

I also saw something elsewhere that made me think STLSoft was for
C as well as C++.

Am I seeing this correctly?  Is there ANY part of STLSoft that
will work under C?

I vascilate between trying to stay strictly within C (I feel there
are some really good reasons) and wandering out into the C++
world.  Recently I was putting together some general purpose C
libraries (exceptions, strings, indices, etc.) when I found your
product.  Can I use parts of STLSoft within my C code?  I've
resisted C++ in a large part because of the "fully committed, all
or nothing, no going back" approach one has to take when adopting
a C++ slant to a project (plus some things highlighted at
http://yosefk.com/c++fqa/defective.html).

If not STLSoft, do you by chance know of a good general purpose C
library with similar functionality?

Thanks.
Mar 20 2008
parent reply "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
"Dave" <annonymous notsure.org> wrote in message
news:frudsp$g2u$1 digitalmars.com...
 I downloaded STLSoft 1.9.27 and have been perusing some of the
 code.  I quickly found the following:

 /* Template support */
 #if defined(__cplusplus) && \
     !defined(STLSOFT_CF_TEMPLATE_SUPPORT)

 template-based and require this support.
 #endif /* STLSOFT_CF_TEMPLATE_SUPPORT */

 I also saw something elsewhere that made me think STLSoft was for
 C as well as C++.

 Am I seeing this correctly?  Is there ANY part of STLSoft that
 will work under C?
Yes, several parts of STLSoft are C-compatible
 I vascilate between trying to stay strictly within C (I feel there
 are some really good reasons)
There are: control, compilation speed, compatiblity, and (dare I say it) discipline (!) Several of my libraries (open-source and commercial) are written in C, and use a subset of STLSoft for compiler/language-discrimination, simple utility functions, and so on. For example, many of the util/front-end/back-end components in Pantheios (http://pantheios.org/) are written in C. It's quite amusing to watch the compilation on my 64-bit Linux box: all you get to see are the C++ compilation units, because the C ones fly by too fast to observe. ;-)
 and wandering out into the C++
 world.  Recently I was putting together some general purpose C
 libraries (exceptions, strings, indices, etc.)
I'm interested. In fact, I was only pondering about doing the same thing - like I'd ever find the time! - recently. I'd be keen to have a look. Do you have a link?
 when I found your
 product.
May I ask where?
  Can I use parts of STLSoft within my C code?
Yes indeed. Anything ending in .h should be C/C++ compatible, whereas those ending in .hpp are C++ only.
  I've
 resisted C++ in a large part because of the "fully committed, all
 or nothing, no going back" approach one has to take when adopting
 a C++ slant to a project (plus some things highlighted at
 http://yosefk.com/c++fqa/defective.html).
He he. My next book, Breaking Up The Monolith (http://breakingupthemonolith.com/), examines the supposed necessary tradeoffs between discoverability, safety, extensibility, portability and efficiency that the C++ community has seen fit to accept, and throws out many of these. As is speed, demonstrated in Pantheios, and soon will be with FastFormat, you can have simplicity, safety, extensibility and ridiculously high performance without sacrificing discoverability. (Anyway, that's my story. =P)
 If not STLSoft, do you by chance know of a good general purpose C
 library with similar functionality?
Nope. But I'd be interested to see yours, or any that you might come across. Cheers Matt
Mar 20 2008
parent reply Dave <davidlqualls gmail.com> writes:
== Quote from Matthew Wilson (matthew hat.stlsoft.dot.org)'s
article
 "Dave" <annonymous notsure.org> wrote in message
news:frudsp$g2u$1 digitalmars.com...
 Am I seeing this correctly?  Is there ANY part of STLSoft that
 will work under C?
Yes, several parts of STLSoft are C-compatible
 Recently I was putting together some general purpose C
 libraries (exceptions, strings, indices, etc.)
I'm interested. In fact, I was only pondering about doing the
same thing - like I'd ever find the time! - recently. I'd be keen to
 have a look. Do you have a link?
I don't. I doubt my libraries are really production quality (although I use them, and they work), plus I make regular changes to them, and because I control them, I just don't worry about breaking anyone else's code -- yet. I could e-mail you some subset that is pretty stable if you're interested.
 when I found your
 product.
May I ask where?
I'm a Digital Mars customer; I just haven't looked thru everything yet; especially if it had "STL" in the name. Until recently, I just haven't been interested.
  Can I use parts of STLSoft within my C code?
Yes indeed. Anything ending in .h should be C/C++ compatible,
whereas those ending in .hpp are C++ only.
 If not STLSoft, do you by chance know of a good general
purpose C
 library with similar functionality?
Nope. But I'd be interested to see yours, or any that you might
come across.
 Cheers
 Matt
Mar 21 2008
parent "Matthew Wilson" <matthew hat.stlsoft.dot.org> writes:
 Do you have a link?
I don't. I doubt my libraries are really production quality (although I use them, and they work), plus I make regular changes to them, and because I control them, I just don't worry about breaking anyone else's code -- yet. I could e-mail you some subset that is pretty stable if you're interested.
Sure. I'd like to take a look. m a t t h e w s y n e s i s <dot> c o m <dot> a u Cheers Matt
Mar 21 2008