473,394 Members | 2,020 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,394 software developers and data experts.

A tool to view instantiated templates?

If I understand correctly, a template is translated into its source
equivalence, either explicitly, or implicitly. It seems to me, a tool that
would show me that intermediate form of the template would be very useful
in understanding what my templates are actually doing. Is there such a
tool?

G++ may support this, but I didn't see a way to do it when I looked in the
documentaton. I'll ask on a gcc newsgroup and see if I can get an answer
about that specific issue.
--
STH
Hatton's Law: "There is only One inviolable Law"
KDevelop: http://www.kdevelop.org SuSE: http://www.suse.com
Mozilla: http://www.mozilla.org
Jul 22 '05 #1
2 1475
Steven T. Hatton wrote:
If I understand correctly, a template is translated into its source
equivalence, either explicitly, or implicitly. It seems to me, a tool that
would show me that intermediate form of the template would be very useful
in understanding what my templates are actually doing. Is there such a
tool?

G++ may support this, but I didn't see a way to do it when I looked in the
documentaton. I'll ask on a gcc newsgroup and see if I can get an answer
about that specific issue.


I don't know of such a tool. But how would it be "very useful"? What
in the template code don't you see that the tool would show you? The
actual types? Write your template so that the type argument is named
as one of the supported types, say 'CHAR' for 'char' or 'INT' for 'int'.
It'll be quite readable (better than 'T'). The actual values? Well,
the same solution could work: name the values _1 and _0 or something
like it. Or do you need to see recursive template expansion to see what
happens when you do

template<int _1> class S { blah S<_1 - 1>; };
template<> class S<0> { blahblah; };

? Well, that's a bit tricky. I, for one, would only use that "template
viewing tool" to see the expanded recursive templates. However, I would
be very surprised if such tool would be provided by a company who doesn't
have a compiler because rules concerning templates are complicated and if
you can get them right, you're more than half-way in writing a compiler.
OTOH, if you have enough people to write a compiler, that's what your
efforts would be concentrated on... IMHO.

V
Jul 22 '05 #2
Steven T. Hatton wrote:
If I understand correctly, a template is translated into its source
equivalence, either explicitly, or implicitly. It seems to me that,
a tool that would show me that intermediate form of the template
would be very useful in understanding what my templates are actually doing.
Is there such a tool?

G++ may support this, but I didn't see a way to do it
when I looked in the documentaton. I'll ask on a gcc newsgroup
and see if I can get an answer about that specific issue.


C++ template code is more difficult to read, debug and maintain.
I don't know of any tools (g++ or otherwise)
that will help you display the instantiations.
Jul 22 '05 #3

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

Similar topics

12
by: vincent_delft | last post by:
I'm looking for a Web Tool kit to build web pages with the following criteria (in priority order) : - easy to use, develop (reuseability of code, ...) - flexible (ideally should run with Python...
3
by: Atlas | last post by:
I'm looking for a tool that may "visually" improve ASP code generation. The project is about a presentation web site, whose main features are: - 4 main sections each one containg from 1 to 3 page...
8
by: | last post by:
This code get's a link error (I'm guessing because the template isn't being instantiated)... // For using templates to simplify deleting items template <class T> // Returns the next ADHL in the...
6
by: d.warnermurray | last post by:
I am doing a project for school that involves creating help files for a html authoring tool. If you could help me with answers to some questions it would really help. 1. What tasks do you expect...
0
by: Namratha Shah \(Nasha\) | last post by:
Hi All, We have almost covered all the .NET Framework Tools except a few, which we will cover in the coming days. Today we will are going to check out a tool called as mscorcfg.msc. This is a...
5
by: Felix I. Wyss | last post by:
Good Afternoon, I recently noticed that some very simple methods of a template declared and used in a DLL library get inlined when used by the DLL itself, but not by other DLLs and EXEs. After...
6
by: Robbie Hatley | last post by:
I'm maintaining a software project with 134 C++ files, some of them huge (as much as 10,000 lines each), and very few prototypes. The author's attitude towards prototypes was like this: ...
26
by: webrod | last post by:
Hi, I have some php pages with a lot of HTML code. I am looking for a HTML validator tool (like TIDY). TIDY is not good enough with PHP tags (it removes a lot of php code). Do you have any...
2
by: Francesc001 | last post by:
I will try to explain a little which is the functionality that we are looking for. We need a tool to create XSL templates able to transform plane text to XML. As source we have strings where...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.