473,396 Members | 1,758 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Convert template into C++ class

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
Jul 23 '05 #1
3 1943
Patrik Servin wrote:
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.
Jul 23 '05 #2
Patrik Servin wrote:
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.

--
Alvin
Jul 23 '05 #3
Patrik Servin wrote:
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-...r/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.
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: skyer | last post by:
Hello ! How to convert int value to string in QT or ANSI C++ library ? please help skyer
11
by: Marcin Kalicinski | last post by:
Hi, How to convert a type inside a template from pointer to type to type itself? struct S { }; template<class It> void f(It begin, It end) { // When called from g(), It::value_type is a...
8
by: Thomas Heller | last post by:
I need to convert C preprocessor definitions into python code. The definitions are dumped out of gccxml (see http://www.gccxml.org) , running over the windows header files (for example). This...
4
by: Eric Lilja | last post by:
Hello, I've made a templated class Option (a child of the abstract base class OptionBase) that stores an option name (in the form someoption=) and the value belonging to that option. The value is...
7
by: Ish2000 | last post by:
Hello, I've a simple windows application and i want to be able to convert a csv file to xml. So far, i can browse for the csv file from the file structure and display in a textbox. I want to...
2
by: nassim.bouayad.agha | last post by:
Hello, here is a code snippet showning my problem : template<typename _K> class TClass1 { public: void Process(const _K& arg) const {
9
by: Leo jay | last post by:
i'd like to implement a class template to convert binary numbers to decimal at compile time. and my test cases are: BOOST_STATIC_ASSERT((bin<1111,1111,1111,1111>::value == 65535));...
2
budigila
by: budigila | last post by:
Hiya peeps, Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am...
3
by: JosephLee | last post by:
/* Below you will find the declaration and the definition of the class Format that can be used to manipulate the ostream. Although the class is only capable of setting the width and precision,...
9
by: Marco Nef | last post by:
Hi there I'm looking for a template class that converts the template argument to a string, so something like the following should work: Convert<float>::Get() == "float"; Convert<3>::Get() ==...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.