How do I do this? (Construction of classes)

How do I do this? (Construction of classes)

Post by Dhru » Sun, 27 Jul 2003 22:08:50

Ok, I get the picture. Thatnks evetyone for all the input. :-)

Now that I know that this cannot be done, I need to know how to accomplish
this problem that I'm faced with:

The set is something like this:

I have an allocator class (standard), but it supports parameterized
construction. That's not a requirement for allocators. The 2 parameters
that it takes are:
1. Initial size to allocate.
2. Size to allocate when memory runs out.

Now, I have another void_allocator<> class that is parameterized around a
standard allocator. However this standard allocator might include the one
that supports parameterized construction. If that's the case, I would want
to take advantage of that fact. So, for that, I need to pass paramteres to
the constructor of the allocator in the initializer list (unless I can
defer construction of the object, which is not possible). I had earlier
thought of making the void_allocator<> hold a pointer to allocator, so
that I could create an allocator using new, and then pass paramters during
construction. However, doing this would mean that no calls are inlined. At
compile time, basically the whole of the void_allocator<> layer vanishes,
because of inlining. So, to do that, I thought of a technique to pass void
parameters that accept void parameters, but that as I can see is not

So, for now, I have a technique that makes use of allocator_traits to
check for default construction, and if so, then the right_allocator<>
template will construct the allocator accordingly. Both of these are in
the file memory.hpp. The source files are zipped up at: . For how this is
being used currently, you can peek into void_alloc.hpp. Why I'm not happy
with the current technique is that you cannot use any comparison function
of the base class form the derived class, as in suppose base has op.==
defined, then you have to define derived to have an op.==. Otherwise, it
won't work.


      [ See for info about ]
      [ comp.lang.c++.moderated.    First time posters: Do this! ]


1. Running graphical dos program under dos shell window

I had a program which is written in Pascal that is running in Graphics mode
using the egavga (egavga.bgi) mode. I am trying to run this program under
Windows 95 Dos Prompt Shell in "window" form, which mean that the program is
not running in full screen. This enable me to switch between windows by
using the mouse and monitoring other program while the DOS program is

(My DOS program is running in vga 256 colour 640x480 mode while my windows
setting is 800x600 16.8 million colour mode.)
But when I try to do that, Dos shell reported that the appplcation must
running in full screen mode. I am required to run the program in shell
windows. Is there any way to do that ?


2. quicktime movies

3. Borland C++ and DOS 16bit DOS console applications

4. Agfa 1212U & Win2k =?

5. Doing DOS INT 31H under Windows

6. Is there a workaround to allow access to a public server behind a SonicWall from the LAN using the domain name?

7. set title bar of DOS box via DOS program?

8. Windows 3.1 DOS box memory mapping with DOS extenders

9. How do I run a DOS program without a DOS Box????

10. Access NT TCP/IP from DOS app, or NT<->DOS IPC

11. DOS-extended apps crash in a DOS window

12. how to run a DOS program without DOS window