removing void*

  • Thread starter Christian Christmann
  • Start date
C

Christian Christmann

Hi,

I was asked to remove the void*'s from an old project.

My idea was to replace them with templates.
Is this a good idea? How would you proceed?

Thanks

Chris
 
H

Howard

Christian Christmann said:
Hi,

I was asked to remove the void*'s from an old project.

My idea was to replace them with templates.
Is this a good idea? How would you proceed?

There is no pat answer we can give you.

The questions, in each individual case, will be "What is this variable being
used for?", "What type of data does it *really* represent?" and "Is there a
reason that this is declared as void* in the first place?"

It could be that many of those have legitimate uses. Or not. You'll have
to deal with each variable on its own.

Simply being told to "remove all void*s" is rather silly, in my opinion. If
it is felt that the current software is poorly written, then the software in
its entirety needs to be reviewed, documented, and potentially redesigned,
prior to simply making coding changes.

Of course, we do what we're told, most of the time. But honestly, there's
nothing we can tell you about what to use instead of void*, because we have
no idea what each of those cases are.

If you have questions about a specific case or two that stump you, post
those here and we might be able to suggest a better alternative. Otherwise,
it'll be up to you to decide each individual case.

Sorry, but it looks like you've got your work cut out for you.

-Howard
 
D

Dave Rahardja

Christian said:
Hi,

I was asked to remove the void*'s from an old project.

My idea was to replace them with templates.
Is this a good idea? How would you proceed?

Thanks

Chris

The initial questions I would ask are:

1. Why were they there in the first place?
2. Why do you want them removed?
 

Ask a Question

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.

Ask a Question

Members online

Forum statistics

Threads
474,291
Messages
2,571,483
Members
48,142
Latest member
MarkBurbac

Latest Threads

Top