I
Ian Collins
It can, with a little effort, implement qsort as an inline function,
which then allows at least as much optimization as templates do.
Do you know of any that do?
It can, with a little effort, implement qsort as an inline function,
which then allows at least as much optimization as templates do.
Ian Collins a écrit :
Another point is that in my implementation (I do not know if in C++ that
holds)
you can customize the generated code. For instance it doesn't make sense to
have a pointer to objects that are smaller than a pointer size. It would be
much better to store directly the object in the place of the pointer and
access it directly.
you don't give that impression. It seems more like "I don't think this
is a good idea in C and I can't see any reason for it". This is even
after a couple of people have pointed out the possible benefit.
[...]other than e-penis size.
idiot
If you disagree, what is the
real incentive behind C metaprogramming?
type safety. A quick and easy way to produce efficient container code..Finally, a real answer. Comment below.
[...]
given that the language is, by
design, inadequate for that purpose?
well if he's done it plainly isn't inadequateC is not fully capable of introspection. This is a fact. It is the
reason behind the following:
- the extra preprocessing step(s) in producing the "template library".
C++ jumps through rather similar hoops under the hood
again you just say that
I don't see those things as saying the same thing. I thought you were
asking for a particular application. Containers don't work that way.
What application *wouldn't* it work on.
find a C++ that uses an STL container and explain why the same sort of
thing couldn't be used with a generic container in C
ok you've memorised the puffin book of freud...
I think we're probably done here
On Apr 20, 5:19 pm, Nick Keighley <[email protected]>
other than e-penis size.
idiot
[...] what is the real incentive behind C metaprogramming?
type safety. A quick and easy way to produce efficient container code.C++ jumps through rather similar hoops under the hood
You are correct. C++ is equally inadequate (for JN's approach, that
is).
OK, let's revisit each point:
- Is the library generic? Not if you have to preprocess it for each
different data type you want to store. The void * approach/
implementation, on the other hand, is.
- Is the library user friendly? Not if it introduces an extraneous
step in the building process, which gives more room for errors and
aggravates developers.
ibid
- Is the library usable? Yes, if one ignores the above two points.
ibid
You misunderstood, again. The choice (or not) of a custom container
like JNs in a purely academic discussion (such as this, so far) is
irrelevant; the real question is what constraints does it operate
under, what problems it solves (besides storing things in a black
box), what benefits does it have over other container libraries. Do
you still disagree?
I didn't realize this was about turning C into C++. Do continue.
I am guessing that was meant as an insult, can I choose to ignore you?
Indeed we are.
OK, let's revisit each point:
- Is the library generic? Not if you have to preprocess it for each
different data type you want to store. The void * approach/
implementation, on the other hand, is.
- Is the library user friendly? Not if it introduces an extraneous
step in the building process, which gives more room for errors and
aggravates developers.
- Is the library usable? Yes, if one ignores the above two points.
You misunderstood, again. The choice (or not) of a custom container
like JNs in a purely academic discussion (such as this, so far) is
irrelevant; the real question is what constraints does it operate
under, what problems it solves (besides storing things in a black
box), what benefits does it have over other container libraries. Do
you still disagree?
Michael said:- Is the library user friendly? Not if it introduces an extraneous
step in the building process, which gives more room for errors and
aggravates developers.
Ian Collins said:Do you know of any that do?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.