473,624 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

vector use warnings

(VC6) When I use the STL <vector> template as follows:

#include <vector>
....
vector<CString> m_nameList; // Names of the chips

I get these compiler warnings :

C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\xmemory(39 ) : warning
C4100: '_P' : unreferenced formal parameter
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\xmemory(41 ) : warning
C4100: '_P' : unreferenced formal parameter
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(249 ) : warning
C4663: C++ language change: to explicitly specialize class template 'vector'
use the following syntax:
template<> class vector<bool,cla ss std::allocator< unsigned int> >
....
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(156 ) : warning
C4018: '<' : signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(156 ) :
while compiling class-template member function 'void __thiscall
std::vector<uns igned int,class std::allocator< unsigned int>
::insert(unsig ned int *,unsigned int,const unsig ned int &)'
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(167 ) : warning
C4018: '<' : signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(156 ) :
while compiling class-template member function 'void __thiscall
std::vector<uns igned int,class std::allocator< unsigned int>::insert(unsig ned int *,unsigned int,const unsig ned int &)'
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(156 ) : warning
C4018: '<' : signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(156 ) :
while compiling class-template member function 'void __thiscall
std::vector<cla ss CString,class std::allocator< class CString>::insert(cla ss CString *,unsigned int,const cl ass CString &)'
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(167 ) : warning
C4018: '<' : signed/unsigned mismatch
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\vector(156 ) :
while compiling class-template member function 'void __thiscall
std::vector<cla ss CString,class std::allocator< class CString>::insert(cla ss CString *,unsigned int,const cl

ass CString &)'
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\xmemory(37 ) : warning
C4100: '_P' : unreferenced formal parameter
C:\Program Files\Microsoft Visual Studio\VC98\INC LUDE\xmemory(68 ) :
see reference to function template instantiation 'void __cdecl
std::_Destroy(u nsigned int *)' being compiled

What am I doing wrong ??

--

Alan Benn
Jul 19 '05 #1
1 5907
> #include <vector>
...
vector<CString> m_nameList; // Names of the chips
That's on-topic at news:microsoft. public.vc.langu age

This group tries to remain platform neutral, so we can give the best answers
for questions about generally portable code.
What am I doing wrong ??


That newsgroup might know any number of things, such as missing a service
pack.

This newsgroup advises you to try vector<string>, just to see what happens.

You might be about to discover how broken MFC can be. I remember the days
when it simply did not compile with STL.

--
Phlip
Jul 19 '05 #2

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

Similar topics

10
2197
by: Kylotan | last post by:
I have the following code: def IntToRandFloat(x): """Given a 32-bit integer, return a float in """ x = int(x) x = int(x << 13) ^ x return (1.0-((x*(x*x*15731+789221)+1376312589)&0x7fffffff)/1073741824.0) Basically it's a function directly copied from a C implementation. Now
7
10620
by: Forecast | last post by:
I run the following code in UNIX compiled by g++ 3.3.2 successfully. : // proj2.cc: returns a dynamic vector and prints out at main~~ : // : #include <iostream> : #include <vector> : : using namespace std; : : vector<string>* getTyphoon()
5
2496
by: Adrian | last post by:
Hi all, I am getting a warning compiling the following code using Borland C++ Builder 6, but I dont think I am doing anything wrong. When using g++ I get no warnings at all with a g++ -Wall -ansi -pedantic. Now I usually assume the compiler is correct but in this case I am not sure. push 1 gives the warning the other 2 go through fine.
20
17809
by: Anonymous | last post by:
Is there a non-brute force method of doing this? transform() looked likely but had no predefined function object. std::vector<double> src; std::vector<int> dest; std::vector<double>::size_type size = src.size(); dest.reserve(size); for (std::vector<int>::size_type i = 0;
27
14873
by: Marcus Kwok | last post by:
I am getting warnings when comparing a (regular) int to the value returned from std::vector.size() in code similar to the following: int i = //stuff if (i >= vec.size()) The compiler gives me a "signed/unsigned mismatch" warning (I am using the C++ compiler found in Visual Studio .NET 2003, which tells me that the return type is a size_t). I get similar warnings when assigning the
8
18536
by: Manuel | last post by:
Hi! If I've a vector filled with abstract classes, can I push in it the derived classes too? Even if derived classes have new methods? I've done some experiments, and it seem I can push the derived classes, but I can use them only calling the methods declared in abstract class (the new methods declared only in derived classes return an error). Please take a look to my code (hey, this is not an homework!
8
4171
by: markww | last post by:
Hi, If I have a vector of structs like this: struct IMAGE { unsigned char *pPix; string strName; int nNumber; };
4
15491
by: gallows | last post by:
I've tried to use C qsort() on an object derivate by std::vector, but it doesn't work. I've the follow structure: struct Item { std::string name; int number; }
9
2597
by: Chris Roth | last post by:
I have a vector of vectors: vector< vector<double v; and have initialized it with: v( 5 ); as I know I will have 5 columns of data. At this point, I read text file data into each of the the vectors using push_back. I know that I will be reading in 5000 elements into each vector, so I use reserve: ifstream f( "file.txt" ); if(f.is_open()) {
0
8685
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8633
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8348
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8493
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6112
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5570
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2613
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1797
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.