 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Ray Lischner Guest
|
Posted: Wed Jun 15, 2005 9:34 am Post subject: slist: singly-linked list class template |
|
|
I wrote slist, a singly-linked list class template in preparation for a
talk I will be giving at C++ Connections ([url]www.cpp-connections.com)[/url]. The
code and documentation are on my web site (URL below), if anyone is
interested in commenting on it.
--
Ray Lischner, author of C++ in a Nutshell
http://cpphelp.com
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Roland Pibinger Guest
|
Posted: Sat Jun 18, 2005 9:34 am Post subject: Re: slist: singly-linked list class template |
|
|
On 15 Jun 2005 05:34:30 -0400, Ray Lischner <rl.news (AT) tempest-sw (DOT) com>
wrote:
| Quote: | I wrote slist, a singly-linked list class template in preparation for a
talk I will be giving at C++ Connections ([url]www.cpp-connections.com)[/url]. The
code and documentation are on my web site (URL below), if anyone is
interested in commenting on it.
|
1. Get rid of the (unnecessary) Boost dependency.
2. Unit tests: you certainly have not developed the slist template
without unit tests. Prospective users need this tests in order to
check the usability or at least the compilability of the code with
their compiler and Standard library.
3. Compile your code with several compilers (you could ask others if
they had the unit tests) and publish on which compilers the code is
usable (you certainly know that the compilation of template code is
very fragile and compiler dependant).
Thank you and best wishes,
Roland Pibinger
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
Ray Lischner Guest
|
Posted: Tue Jun 21, 2005 4:19 pm Post subject: Re: slist: singly-linked list class template |
|
|
On Saturday 18 June 2005 05:34 am, Roland Pibinger wrote:
| Quote: | 1. Get rid of the (unnecessary) Boost dependency.
|
My first version did not rely on Boost, but when I went through a
clean-up cycle, I chucked all my ad-hoc code to test whether an
iterator is an integral type in favor of boost type traits (at least
until TR1 becomes widespread, at which time, I will switch).
Such a tiny sliver of the code relies on Boost, and for someone who does
not use Boost or have it installed, that becomes quite a barrier to
using my code. So I can see that argument that the Boost dependency is
unnecessary and a hindrance.
On the other hand, I fail to see the point of reinventing the wheel. So
far, I've kept all my C++ code private because I haven't felt like it
was ready for public presentation. As I find the time, I hope to make
more of it available. Should I assiduously avoid dependency on
third-party libraries, I will end up reinventing those same libraries
on my own. And to what end?
--
Ray Lischner, author of C++ in a Nutshell
http://www.tempest-sw.com/cpp
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
kanze@gabi-soft.fr Guest
|
Posted: Wed Jun 22, 2005 1:10 pm Post subject: Re: slist: singly-linked list class template |
|
|
Ray Lischner wrote:
| Quote: | On Saturday 18 June 2005 05:34 am, Roland Pibinger wrote:
1. Get rid of the (unnecessary) Boost dependency.
My first version did not rely on Boost, but when I went
through a clean-up cycle, I chucked all my ad-hoc code to test
whether an iterator is an integral type in favor of boost type
traits (at least until TR1 becomes widespread, at which time,
I will switch).
Such a tiny sliver of the code relies on Boost, and for
someone who does not use Boost or have it installed, that
becomes quite a barrier to using my code. So I can see that
argument that the Boost dependency is unnecessary and a
hindrance.
On the other hand, I fail to see the point of reinventing the
wheel. So far, I've kept all my C++ code private because I
haven't felt like it was ready for public presentation. As I
find the time, I hope to make more of it available. Should I
assiduously avoid dependency on third-party libraries, I will
end up reinventing those same libraries on my own. And to what
end?
|
The problem is more complex than it seems, and depends on who
you are targetting with your code. For better or for worse,
Boost (and doubtlessly many other modern libraries) doesn't work
with older compilers, nor with some up to date ones (e.g. Sun
CC). If your intent is for your code to be usable even in such
cases, you have to avoid the modern libraries.
None of my libraries use Boost, simply because my customer's
main platform is Sun CC (and an older version at that), where
Boost doesn't work. (Of course, in my case, it's not so much a
case of reinventing the wheel, as it is of continuing to use a
wheel invented long before Boost existed. Regretfully, it's
sometimes a sort of a bumpy wheel, and there are definitly
places where the code would be a lot cleaner if I used the Boost
wheel. Independantly of the value of reuse.)
--
James Kanze GABI Software
Conseils en informatique orientée objet/
Beratung in objektorientierter Datenverarbeitung
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|