Khimenko Victor wrote:
What about introducing a second `New' that allows the user to pass an additional parameter to the allocator?
Might be a solution. (Not that the syntax of `New' isn't already complicated enough... :-/)
Hmm. IMO something like p:=new[shm_alloc,pool1](string,100); should be recognizeable enough and should not disturb existing mess there much. Even if it's look more like LaTeX then C++ :-)
I do not like this syntax too much. (For Pascal. It's okay for LaTeX.;-) In principle, it should not be too hard to implement
New (allocator_function, other_parameters)
but with the current implementation of `New' it would need some nontrivial work in the parser.
A clean solution would be a re-write of the parser to accept about any command-line for `New' and then do the analysis afterwards.
The only real problem with this approach would be the implicit `with' in `New' when a constructor of an object is called.
Peter