Click here to Skip to main content
15,919,931 members
Home / Discussions / ATL / WTL / STL
   

ATL / WTL / STL

 
GeneralRe: What is the difference between delete[] and delete? Pin
Joaquín M López Muñoz10-Feb-03 2:44
Joaquín M López Muñoz10-Feb-03 2:44 
GeneralRe: What is the difference between delete[] and delete? Pin
George210-Feb-03 3:00
George210-Feb-03 3:00 
GeneralRe: What is the difference between delete[] and delete? Pin
Joaquín M López Muñoz10-Feb-03 3:49
Joaquín M López Muñoz10-Feb-03 3:49 
GeneralRe: What is the difference between delete[] and delete? Pin
George210-Feb-03 18:02
George210-Feb-03 18:02 
GeneralSTL remove_copy_if is not working properly Pin
George210-Feb-03 1:15
George210-Feb-03 1:15 
GeneralRe: STL remove_copy_if is not working properly Pin
Joaquín M López Muñoz10-Feb-03 9:29
Joaquín M López Muñoz10-Feb-03 9:29 
GeneralRe: STL remove_copy_if is not working properly Pin
George210-Feb-03 18:00
George210-Feb-03 18:00 
GeneralCompiling error on my simple STL spell-checker. Pin
George29-Feb-03 2:39
George29-Feb-03 2:39 
Hi, everyone!

Here is my simple STL program, it is a spell-checker.
The program copy every word of text to output
that is not in the dictionary. I have added all the source
codes and error messages below. My IDE is VC6.0.


Source Codes:

--------
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <fstream>

using namespace std;

template <class bidirectional_iterator, class T>
class nonAssocFinder {
public:
nonAssocFinder(bidirectional_iterator begin,
bidirectional_iterator end) :
_begin(begin), _end(end) {}

bool operator() (const T& word) {
return binary_search(_begin, _end, word); }

private:
bidirectional_iterator _begin;
bidirectional_iterator _end;
};


void main()
{
typedef vector<string > dict_type;

ifstream dictFile("dict.txt");
ifstream wordsFile("words.txt");

dict_type dictionary;

copy (istream_iterator<string>(dictFile),
istream_iterator<string>(),
back_inserter(dictionary));

remove_copy_if (
istream_iterator<string>(wordsFile),
istream_iterator<string>(),
ostream_iterator<string>(cout, "\n"),
nonAssocFinder<dict_type::iterator,
dict_type::value_type>
(dictionary.begin(), dictionary.end()));
}
--------

Warning and error messages:
--------
C:\Program Files\Microsoft Visual Studio\MyProjects\testDict\testDict.cpp(45) : warning C4786:

'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> > const

*,std::basic_string<char,std::char_traits<char>,std::all
ocator<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const

&,std::basic_string<char,std::char_traits<char>,std::allocator<char> > const *,int>' : identifier was truncated to '255'

characters in the debug information
C:\Program Files\Microsoft Visual Studio\MyProjects\testDict\testDict.cpp(45) : warning C4786:

'std::reverse_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char> >

*,std::basic_string<char,std::char_traits<char>,std::allocator
<char> >,std::basic_string<char,std::char_traits<char>,std::allocator<char> >

&,std::basic_string<char,std::char_traits<char>,std::allocator<char> > *,int>' : identifier was truncated to '255' characters

in the debug information
c:\program files\microsoft visual studio\vc98\include\iterator(176) : error C2679: binary '>>' : no operator defined which

takes a right-hand operand of type 'class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >'

(
or there is no acceptable conversion)
c:\program files\microsoft visual studio\vc98\include\iterator(176) : while compiling class-template member function

'void __thiscall std::istream_iterator<class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char>
>,char,struct std::char_traits<char> >::_Getval(void)'
--------


How to resolve the trouble?


Thanks in advance,
George
GeneralRe: Compiling error on my simple STL spell-checker. Pin
Joaquín M López Muñoz9-Feb-03 11:23
Joaquín M López Muñoz9-Feb-03 11:23 
GeneralRe: Compiling error on my simple STL spell-checker. Pin
George210-Feb-03 1:10
George210-Feb-03 1:10 
GeneralManta Web ATL Sample. Pin
Bo Hunter7-Feb-03 11:14
Bo Hunter7-Feb-03 11:14 
GeneralRe: Manta Web ATL Sample. Pin
TigerNinja_19-Feb-03 3:18
TigerNinja_19-Feb-03 3:18 
Generalresume download Pin
Anonymous6-Feb-03 17:34
Anonymous6-Feb-03 17:34 
GeneralRe: resume download Pin
JoeSox6-Feb-03 19:02
JoeSox6-Feb-03 19:02 
GeneralRe: resume download Pin
AlexO7-Feb-03 3:05
AlexO7-Feb-03 3:05 
GeneralRe: resume download Pin
Todd Smith19-Feb-03 9:29
Todd Smith19-Feb-03 9:29 
Generaloutlook express configuration Pin
naradaji6-Feb-03 5:25
naradaji6-Feb-03 5:25 
GeneralRe: outlook express configuration Pin
Michael Dunn6-Feb-03 9:43
sitebuilderMichael Dunn6-Feb-03 9:43 
GeneralRe: outlook express configuration Pin
naradaji6-Feb-03 21:13
naradaji6-Feb-03 21:13 
GeneralRe: outlook express configuration Pin
Michael Dunn8-Feb-03 19:09
sitebuilderMichael Dunn8-Feb-03 19:09 
GeneralRe: outlook express configuration Pin
naradaji9-Feb-03 21:22
naradaji9-Feb-03 21:22 
GeneralProblems connecting DWebBrowserEvents2 Pin
Xavyer5-Feb-03 22:43
Xavyer5-Feb-03 22:43 
GeneralQuestion about input iterator. Pin
George25-Feb-03 21:34
George25-Feb-03 21:34 
GeneralRe: Question about input iterator. Pin
Joaquín M López Muñoz5-Feb-03 22:38
Joaquín M López Muñoz5-Feb-03 22:38 
GeneralRe: Question about input iterator. Pin
George26-Feb-03 0:03
George26-Feb-03 0:03 

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.