Click here to Skip to main content
16,015,481 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralWTL splitters not sending WM_SIZE to both panes Pin
Kibble19-Apr-03 12:20
Kibble19-Apr-03 12:20 
GeneralRe: WTL splitters not sending WM_SIZE to both panes Pin
Kibble21-Apr-03 8:00
Kibble21-Apr-03 8:00 
GeneralDawing image to client device context in ATL Pin
itay_k17-Apr-03 1:11
itay_k17-Apr-03 1:11 
GeneralRe: Dawing image to client device context in ATL Pin
Paolo Messina18-Apr-03 6:14
professionalPaolo Messina18-Apr-03 6:14 
GeneralRe: Dawing image to client device context in ATL Pin
itay_k19-Apr-03 8:30
itay_k19-Apr-03 8:30 
GeneralShowWindow and DoModal Pin
super16-Apr-03 18:45
professionalsuper16-Apr-03 18:45 
GeneralRe: ShowWindow and DoModal Pin
Stephane Rodriguez.16-Apr-03 18:53
Stephane Rodriguez.16-Apr-03 18:53 
Generalproblem with STL map, string (ignore earlier post) Pin
Matthew Fleming15-Apr-03 7:49
Matthew Fleming15-Apr-03 7:49 
Netmeisters,

I am trying to do something which should be simple. Using Visual C++ I want to create a map containing an STL string as a key and my own type as a value.

#include <string>
#include <map>
#include <iostream>

using namespace std;
map<string,CReport>slips;

Then to add a pair to the map:

string str;
pair<map<string,CReport>::iterator, bool> ret =
slips.insert(map<string,CReport>::value_type(str,report));

But this produces a host of error messages that I've included below.
Can't figure these out at all.

Any assistance much appreciated.

Matthew Fleming
mgf@mcw.edu

c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(138) : while compiling class-template member function 'bool std::less<_Ty>::operator ()(const _Ty &,const std::string &) const'
with
[
_Ty=std::string
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\map(36) : see reference to class template instantiation 'std::less<_Ty>' being compiled
with
[
_Ty=std::string
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xtree(19) : see reference to class template instantiation 'std::_Tmap_traits<_Kty,_Ty,_Pr,_Alloc,_Mfl>' being compiled
with
[
_Kty=std::string,
_Ty=CReport,
_Pr=std::less<std::string>,
_Alloc=std::allocator<std::pair<const std::string,CReport>>,
_Mfl=false
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xtree(61) : see reference to class template instantiation 'std::_Tree_nod<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,CReport,std::less<std::string>,std::allocator<std::pair<const std::string,CReport>>,false>
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xtree(83) : see reference to class template instantiation 'std::_Tree_ptr<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,CReport,std::less<std::string>,std::allocator<std::pair<const std::string,CReport>>,false>
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\xtree(101) : see reference to class template instantiation 'std::_Tree_val<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,CReport,std::less<std::string>,std::allocator<std::pair<const std::string,CReport>>,false>
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\map(77) : see reference to class template instantiation 'std::_Tree<_Traits>' being compiled
with
[
_Traits=std::_Tmap_traits<std::string,CReport,std::less<std::string>,std::allocator<std::pair<const std::string,CReport>>,false>
]
c:\Palm\dpCold\DpCGenCond.cpp(201) : see reference to class template instantiation 'std::map<_Kty,_Ty,_Pr,_Alloc>' being compiled
with
[
_Kty=std::string,
_Ty=CReport,
_Pr=std::less<std::string>,
_Alloc=std::allocator<std::pair<const std::string,CReport>>
]
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::_Tree<_Traits> &,const std::_Tree<_Traits> &)' : could not deduce template argument for 'const std::_Tree<_Traits> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::list<_Ty,_Alloc> &,const std::list<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::list<_Ty,_Ax> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::list<_Ty,_Alloc> &,const std::list<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::list<_Ty,_Ax> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::list<_Ty,_Alloc> &,const std::list<_Ty,_Alloc> &)' : could not deduce template argument for 'const std::list<_Ty,_Ax> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::reverse_iterator<_RanIt> &,const std::reverse_iterator<_RanIt> &)' : could not deduce template argument for 'const std::reverse_iterator<_RanIt> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &,const std::_Ptrit<_Ty,_Diff,_Pointer,_Reference,_Pointer2,_Reference2> &)' : could not deduce template argument for 'const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &,const std::_Ptrit<_Ty,_Diff,_Pointer,_Reference,_Pointer2,_Reference2> &)' : could not deduce template argument for 'const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &,const std::_Ptrit<_Ty,_Diff,_Pointer,_Reference,_Pointer2,_Reference2> &)' : could not deduce template argument for 'const std::_Ptrit<_Ty,_Diff,_Pointer2,_Reference2,_Pointer2,_Reference2> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2784: 'bool std::operator <(const std::pair<_Ty1,_Ty2> &,const std::pair<_Ty1,_Ty2> &)' : could not deduce template argument for 'const std::pair<_Ty1,_Ty2> &' from 'const std::string'
c:\Program Files\Microsoft Visual Studio .NET\Vc7\include\functional(139) : error C2676: binary '<' : 'const std::string' does not define this operator or a conversion to a type acceptable to the predefined operator



GeneralRe: problem with STL map, string (ignore earlier post) Pin
Joaquín M López Muñoz15-Apr-03 8:03
Joaquín M López Muñoz15-Apr-03 8:03 
GeneralRe: problem with STL map, string (ignore earlier post) Pin
Matthew Fleming15-Apr-03 8:13
Matthew Fleming15-Apr-03 8:13 
GeneralRe: problem with STL map, string (ignore earlier post) Pin
Mike Dimmick16-Apr-03 4:17
Mike Dimmick16-Apr-03 4:17 
GeneralRe: problem with STL map, string (ignore earlier post) Pin
Matthew Fleming16-Apr-03 6:30
Matthew Fleming16-Apr-03 6:30 
GeneralRe: problem with STL map, string (ignore earlier post) Pin
Matthew Fleming16-Apr-03 6:32
Matthew Fleming16-Apr-03 6:32 
GeneralRe: problem with STL map, string (ignore earlier post) Pin
Mike Dimmick16-Apr-03 23:43
Mike Dimmick16-Apr-03 23:43 
Generalproblem with STL map, string Pin
Matthew Fleming15-Apr-03 7:48
Matthew Fleming15-Apr-03 7:48 
GeneralRe: problem with STL map, string Pin
valikac16-Apr-03 5:38
valikac16-Apr-03 5:38 
QuestionWhy the function istringstream.getline is not working? Pin
George215-Apr-03 3:56
George215-Apr-03 3:56 
AnswerRe: Why the function istringstream.getline is not working? Pin
Tim Smith15-Apr-03 4:47
Tim Smith15-Apr-03 4:47 
GeneralRe: Why the function istringstream.getline is not working? Pin
George215-Apr-03 16:06
George215-Apr-03 16:06 
GeneralRe: Why the function istringstream.getline is not working? Pin
Tim Smith16-Apr-03 2:17
Tim Smith16-Apr-03 2:17 
GeneralRe: Why the function istringstream.getline is not working? Pin
George217-Apr-03 15:41
George217-Apr-03 15:41 
QuestionHow to use ActiveX controls in WTL? Pin
Ernesto D.14-Apr-03 14:02
Ernesto D.14-Apr-03 14:02 
AnswerRe: How to use ActiveX controls in WTL? Pin
Stephane Rodriguez.14-Apr-03 21:33
Stephane Rodriguez.14-Apr-03 21:33 
GeneralRe: How to use ActiveX controls in WTL? Pin
Ernesto D.14-Apr-03 23:00
Ernesto D.14-Apr-03 23:00 
GeneralRe: How to use ActiveX controls in WTL? Pin
Stephane Rodriguez.16-Apr-03 11:19
Stephane Rodriguez.16-Apr-03 11:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.