Convert template into C++ class

P

Patrik Servin

Does anyone know of a tool that will convert templates into classes?

Background: Suppose you have a bunch of generic classes (templates) that
actually doesn't need to be generic. They are hard to understand and debug.
Now you want to rewrite them into plain non-generic classes but there is so
many of them that you want to automate this rewriting. Any idea?



Patrik
 
V

Victor Bazarov

Patrik said:
Does anyone know of a tool that will convert templates into classes?

I use the tool called "text editor".
Background: Suppose you have a bunch of generic classes (templates) that
actually doesn't need to be generic. They are hard to understand and debug.
Now you want to rewrite them into plain non-generic classes but there is so
many of them that you want to automate this rewriting. Any idea?

Multi-file search-and-replace feature exists in many good text editors.
 
A

Alvin

Patrik said:
Does anyone know of a tool that will convert templates into classes?

Background: Suppose you have a bunch of generic classes (templates) that
actually doesn't need to be generic. They are hard to understand and
debug. Now you want to rewrite them into plain non-generic classes but
there is so many of them that you want to automate this rewriting. Any
idea?



Patrik

I say, 'sed' is your best friend here. You can write a simple sed script
that will do this pretty easily.
 
E

E. Robert Tisdale

Patrik said:
Does anyone know of a tool that will convert templates into classes?

Background: Suppose you have a bunch of generic classes (templates) that
actually doesn't need to be generic. They are hard to understand and debug.
Now you want to rewrite them into plain non-generic classes but there is so
many of them that you want to automate this rewriting. Any idea?

I used Google

http://www.google.com/

to search for

+"genclass" +"C++" +"Oswego"

and I found lots of stuff including

http://www.ibiblio.org/pub/historic-linux/distributions/slackware/2.1/usr/bin/genclass

We used the genclass script to create instances
from templates in "prototype" files
before Bjarne incorporated templates into the language.

Of course, this isn't exactly what you want to do.
I think that what you want to do is "wrong headed"
and I don't believe that any tools exist to do it.
 

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,293
Messages
2,571,500
Members
48,187
Latest member
ashish_758

Latest Threads

Top