473,395 Members | 1,454 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,395 software developers and data experts.

Template and typename

Hi all:

I have the template class:

template<typename InfoTabla> class TablaBusqueda {
typename InfoTabla::Tabla TipoTabla;
typename InfoTabla::Registro TipoRegistro;
typename InfoTabla::TipoClave TipoClave;
typedef map<TipoClave,TipoRegistro> Tabla; //line 9

...
};

When I compile I get the error:

hdrs/BDNotifUssd.h:9: error: invalid use of member `
ussd::TablaBusqueda<InfoTabla>::TipoClave'
I want to create a map with template parameters from TablaBusqueda
template parameter.

What is wrong?

Thanks in advance
Mar 30 '06 #1
1 1428
kkk
I believe you have forgot to write typedef before typename.
use the following statements:
typedef typename InfoTabla::Tabla TipoTabla;
typedef typename InfoTabla::Registro TipoRegistro;
typedef typename InfoTabla::TipoClave TipoClave;
typedef map<TipoClave,TipoRegistro> Tabla; //line 9

You have to pass a data type in map template arguments.
using just typename InfoTabla::Tabla TipoTabla; will assume that you
have defined a variable named TipoTabla with type InfoTable::Table.

Carlos Martinez Garcia wrote:
Hi all:

I have the template class:

template<typename InfoTabla> class TablaBusqueda {
typename InfoTabla::Tabla TipoTabla;
typename InfoTabla::Registro TipoRegistro;
typename InfoTabla::TipoClave TipoClave;
typedef map<TipoClave,TipoRegistro> Tabla; //line 9

...
};

When I compile I get the error:

hdrs/BDNotifUssd.h:9: error: invalid use of member `
ussd::TablaBusqueda<InfoTabla>::TipoClave'
I want to create a map with template parameters from TablaBusqueda
template parameter.

What is wrong?

Thanks in advance


Mar 30 '06 #2

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

Similar topics

2
by: Alex Vinokur | last post by:
========================================= Windows 2000 CYGWIN_NT-5.0 1.3.22(0.78/3/2) GNU gcc version 3.2 20020927 (prerelease) ========================================= Here is some program...
6
by: Patrick Kowalzick | last post by:
Dear all, I have a question about default template parameters. I want to have a second template parameter which as a default parameter, but depends on the first one (see below). Is something...
31
by: nikola | last post by:
Hi all, I was working with a simple function template to find the min of two values. But since I would like the two values to be different (type) I dont know what kind of value (type) it will...
2
by: Steven T. Hatton | last post by:
While thunbing through _C++ Templates, The Complete Guide_ (reckon I aught to read it?) I came across a discussion of using templates to "unroll" loops. I thought that looked like a good idea, so...
5
by: Gianni Mariani | last post by:
The spirit of this arguably pointless exercise, is that the numeric_limits<T> class could be replaced with a totally generic template of compile-time, template computed constants. The problem is...
13
by: jsnX | last post by:
say i have a function object silly that takes a const ref to clowns class silly : public std::unary_function<const clown&, bool> { ... } and then i decide to feed it a bunch of pointers to...
11
by: cyberdave | last post by:
Someone please help me! I have a template class like this: -------------------------------------------------- template<typename T> class List { public:
2
by: PengYu.UT | last post by:
I have the following sample program, which can convert function object with 1 argument into function object with 2 arguments. It can also do + between function object of the same type. The last...
5
by: Pedro Sousa | last post by:
Hi, I'm trying to create an template class that represent points in all possible dimensions, what I've made until now is #ifndef _POINT_HPP_ #define _POINT_HPP_ #include <vector>
5
by: randysimes | last post by:
I am making a previous program into a template to calculate all 11 options. (int, double, long double, char, etc) I believe I have the right idea, but the syntax is way off. Could you please provide...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.