Click here to Skip to main content
15,921,203 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionMFC DLL Pin
Sanjay8899918-Nov-07 17:21
Sanjay8899918-Nov-07 17:21 
AnswerRe: MFC DLL Pin
Paresh Chitte18-Nov-07 17:54
Paresh Chitte18-Nov-07 17:54 
QuestionSocket Error Pin
manish.patel18-Nov-07 16:15
manish.patel18-Nov-07 16:15 
AnswerRe: Socket Error Pin
Mark Salsbery18-Nov-07 16:21
Mark Salsbery18-Nov-07 16:21 
GeneralRe: Socket Error Pin
manish.patel18-Nov-07 16:32
manish.patel18-Nov-07 16:32 
AnswerRe: Socket Error Pin
Peter Weyzen18-Nov-07 19:29
Peter Weyzen18-Nov-07 19:29 
Questionvalue_type of vector Pin
George_George18-Nov-07 16:07
George_George18-Nov-07 16:07 
AnswerRe: value_type of vector Pin
Stephen Hewitt18-Nov-07 18:00
Stephen Hewitt18-Nov-07 18:00 
Firstly we can't see the “<” and “>” characters in your post or what’s between them – this information is vital if you expect an answer to your post. Do you review your posts?

I assume you mean the following:
#include <vector>
 
using namespace std;
 
int main (int argc, char** argv)
{
vector<int>::value_type; // should be int ?
vector<int>::iterator::value_type; // should be int* ?
 
return 0;
}


The line vector<int>::iterator::value_type is incorrect and might result in compiler errors (depending on the particular STL implementation you’re using.) The correct way to get type information is as follows:
#include <vector>
#include <iterator>
// …Other stuff…
iterator_traits<vector<int>::iterator>::value_type
// …Other stuff…


The reason for using external adaptation via the iterator_traits class is simple: it allows the use of types such as int* to be used as iterators (since int*s are not classes and so can’t expose a value_type directly.) Also note that the crap-fest STL that comes with MSVC6 will fail to compile the code I gave because it’s missing the required iterator_traits specializations.

Also note that you can not assume that an iterator is a pointer: it may or may not be depending on many factors, among them the whims of the implementors (of the STL being used.)


Steve

GeneralRe: value_type of vector Pin
George_George18-Nov-07 19:46
George_George18-Nov-07 19:46 
GeneralRe: value_type of vector Pin
Stephen Hewitt18-Nov-07 20:01
Stephen Hewitt18-Nov-07 20:01 
GeneralRe: value_type of vector Pin
George_George18-Nov-07 20:47
George_George18-Nov-07 20:47 
GeneralRe: value_type of vector Pin
Stephen Hewitt19-Nov-07 12:38
Stephen Hewitt19-Nov-07 12:38 
GeneralRe: value_type of vector Pin
George_George19-Nov-07 15:38
George_George19-Nov-07 15:38 
QuestionCFileDialog can not been closed while it owner been closed. Pin
CooperWu18-Nov-07 15:51
CooperWu18-Nov-07 15:51 
AnswerRe: CFileDialog can not been closed while it owner been closed. Pin
Nishad S18-Nov-07 16:41
Nishad S18-Nov-07 16:41 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
moye250118-Nov-07 17:35
moye250118-Nov-07 17:35 
QuestionRe: CFileDialog can not been closed while it owner been closed. Pin
Nishad S18-Nov-07 19:32
Nishad S18-Nov-07 19:32 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
CooperWu18-Nov-07 20:08
CooperWu18-Nov-07 20:08 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
Nishad S18-Nov-07 21:14
Nishad S18-Nov-07 21:14 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
CooperWu18-Nov-07 21:21
CooperWu18-Nov-07 21:21 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
Nishad S18-Nov-07 21:26
Nishad S18-Nov-07 21:26 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
moye250118-Nov-07 21:42
moye250118-Nov-07 21:42 
QuestionRe: CFileDialog can not been closed while it owner been closed. Pin
Nishad S18-Nov-07 22:22
Nishad S18-Nov-07 22:22 
AnswerRe: CFileDialog can not been closed while it owner been closed. Pin
moye250119-Nov-07 18:49
moye250119-Nov-07 18:49 
GeneralRe: CFileDialog can not been closed while it owner been closed. Pin
Nishad S19-Nov-07 18:52
Nishad S19-Nov-07 18:52 

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.