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

Implicit Typename Deprecated?

Hi all,

I'm starting to use templates and I just got a weird error which I was
able to simplify into this code:
#include <vector>

using std::vector;

template<class T>
class foo {
public:
void setval(vector<T>::const_iterator itBegin,
vector<T>::const_iterator itEnd) { }
};

I get by g++:
$ g++ -Wall -std=c++98 -c temptest.cc
temptest.cc:8: warning: `std::vector<T, std::allocator<_CharT>
::const_iterator' is implicitly a typename temptest.cc:8: warning: implicit typename is deprecated, please see the

documentation for details
temptest.cc:8: warning: `std::vector<T, std::allocator<_CharT>::const_iterator' is implicitly a typename

temptest.cc:8: warning: implicit typename is deprecated, please see the

documentation for details
Can someone please explain me what's happening?

Cheers,

Paulo Matos

Jul 23 '05 #1
1 2130
* pmatos:

I'm starting to use templates and I just got a weird error which I was
able to simplify into this code:
#include <vector>

using std::vector;

template<class T>
class foo {
public:
void setval(vector<T>::const_iterator itBegin,
vector<T>::const_iterator itEnd) { }
};


The compiler doesn't know for sure that vector<T>::const_iterator is type,
because that depends on the T (as far as the compiler knows).

To tell the compiler, use

void setval( typename vector<T>::const_iterator itBegin
--
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
Jul 23 '05 #2

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

Similar topics

1
by: Steve Hill | last post by:
Hi, When compiling under g++ (version 3.2) the following code fragement gives me a warning: steve@khan:~/tmp> /opt/bin/g++ -o state_test state_test.cpp state_test.cpp:42: warning: `typename...
1
by: Marcin Kalicinski | last post by:
Hi, The following code template<class Type> class Base::List: public std::list<Type> { public: explicit List(size_type count): std::list<Type>(count) { } // this is line 14 /*...*/
11
by: Johan | last post by:
Hi Can somebody explain to me why I get this warning message and how I can solve this warning message. Thanks a lot Johan In member function `void
1
by: Christophe Poucet | last post by:
Hellom I have an issue with implicit conversions. Apparently when one calls an operator on a class Y which has a conversion operator to class X which has the operator . Sadly it will not do...
3
by: Šimon Tóth | last post by:
Can anybody tell me how to turn of this warning? -Wno-deprecated doesn't work. I don't want to edit the source file, because it works fine and it's a bit hardcore stuff for me :) warning:...
1
by: lutorm | last post by:
Hi all, I'm working on migrating my code from KCC to gcc, and I'm having some issues with "implicit typename" warnings from gcc. Essentially, what happens is described by this example: ...
3
by: Generic Usenet Account | last post by:
This is a two-part question. (1) I have implemented a "Datastructure Registry" template class. I am getting no compiler warnings with older compilers, but newer compilers are generating the...
3
by: SharpCoderMP | last post by:
hi, i've found out here: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=131195&SiteID=1 that FtpWebRequest does not support implicit connections. I have a serious problem with that,...
8
by: xuatla | last post by:
Hi, When I compile the following test code I got a warning about implicit typename. This happens in the member functions. Do you know the detail reason and solution? Thanks. - X ----------
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: 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
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
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
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.