Poll: Is it worth creating a generic MACRO library while we wait for templates?
You do not have permission to vote in this poll.
Yes, and I would definitely have a use for it
100.00%
10 100.00%
Yes, but I probably use very little of it, if at all.
0%
0 0%
I don\'t know.
0%
0 0%
No, I\'d rather wait for template support.
0%
0 0%
Total 10 vote(s) 100%
* You voted for this item. [Show Results]

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Standard MACRO Library
#11
Agamemnus, I'm afraid I don't follow. Could you elaborate?
stylin:
Reply
#12
Something that can make, say, "IF X IS NOT EQUAL TO 5" into "IF X <> 5".
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#13
How in any way would that be useful?
stylin:
Reply
#14
Well..... it could be useful for...other...things...with spaces....
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply
#15
still sad...

i wonder how you are going about the deallocators. i can't see a generic way to do this for arbitrary udts that have, say dynamically allocated memory in them that could again point to other dynamically allocated memory ad infinitum
quote="NecrosIhsan"]
[Image: yagl1.png]
[/quote]
Reply
#16
Quote:still sad...

i wonder how you are going about the deallocators. i can't see a generic way to do this for arbitrary udts that have, say dynamically allocated memory in them that could again point to other dynamically allocated memory ad infinitum

Dynamically allocated memory associated with a UDT is always the responsibility of the programmer to deal with. Even the STL will leak memory if we don't manually deallocate our resources. Currently, I'm jury-rigging constructor and destructor calls in the raw memory functions (in all implementations I've studied, the STL allocates memory and constructs objects on demand).

So basically, there's no difference than having classes except for the fact that the client must manually construct their objects (as opposed to merely initializing objects and having the compiler construct the object for you, ala C++, Java, etc.) A little cumbersome, to be sure, but hey - what can you do?

I just wish I knew what the syntax for classes is going to be when they finally get supported so I can start reworking the library; since it looks like templates are probably not going to be a reality, at least for a long while (years, I supppose), I won't feel too bad about committing the entire code-base to MACRO'd classes.
stylin:
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)