January 12, 2004 Syntax challenge: new / delete | ||||
---|---|---|---|---|
| ||||
I am looking for C++ syntax options for the following problem, but it applies to D as well: Suppose I have different sources from which I can allocate memory: - global - current module / component - current process - current thread what is the 'prettiest' / most natural way to code this? (in C++ / D) For example (C++ syntax): Object* o = new (THREAD) Object( ... ) Alternatives are perhaps: - template (-functions) - namespace-based solutions - macro's - ... And what about D? |
Copyright © 1999-2021 by the D Language Foundation