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

C / C++ / MFC

 
AnswerRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 0:47
Sebastian Schneider22-Dec-05 0:47 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 0:57
tbrake22-Dec-05 0:57 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 1:23
Sebastian Schneider22-Dec-05 1:23 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 1:43
tbrake22-Dec-05 1:43 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 2:04
Sebastian Schneider22-Dec-05 2:04 
GeneralRe: template with Iterator - some Problems Pin
tbrake22-Dec-05 2:21
tbrake22-Dec-05 2:21 
GeneralRe: template with Iterator - some Problems Pin
Sebastian Schneider22-Dec-05 2:36
Sebastian Schneider22-Dec-05 2:36 
QuestionSTL: C2064 on sort() of a vector Pin
Sebastian Schneider21-Dec-05 23:43
Sebastian Schneider21-Dec-05 23:43 
Hi everybody.

It seems that I am unable to solve a problem I recently encountered while trying to use STLs generic "sort(RanIt First, RanIt Last, Pr Pred)". I have a class which evaluates a range of datasets coming from a lower level of one of our plants (I am doing a performance evaluation).

The product-data is stored in a binary file, which is read and fed to my application by a legacy-tool on which I have no modification privileges. Since that tool works well and is blazingly fast (inflating, reading and forwarding up to 10000 datasets per second, each sized around 100 KB) I am OK with that. There is one catch, though: The data has to be written after the final production step of each product is finished. Products no not necessarily take the same path, so they are stored "unsorted". And try to find a single entry in an ascii-log which holds 10000 products, with IDs being 16 digits, where the first 10 digits refers to a certain product attribute and the last 6 digits are auto-incremented.

Basically, I do the evaluation on a "per product" basis and then store the results (just a couple of integer values) in a struct (which contains 2 vectors). I then push that struct into another vector, e.g.:
<br />
typedef struct example<br />
{<br />
int test1;<br />
int test2;<br />
vector<int> Data;<br />
}Example;<br />

and a class ExClass containing a vector<Example> m_Products;

Hell, I figured, I successfully used sort before, so why not use it this time. I #included <algorithm> and wrote a binary predicate:
<br />
bool ExClass::lessProduct(Example &e1, Example &e2)<br />
{<br />
     return ( e1.test2 < e2.test2 )<br />
} <br />
(
with the appropiate prototype in the header. Originally, this even was inlined for speed, but I got the same error.)


And I get C2064 claiming: "C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\algorithm(1863): error C2064: term does not evaluate to a function taking 2 arguments."

I need help here. Frown | :(

Cheers,
Sebastian

--
Contra vim mortem non est medicamen in hortem.
AnswerRe: STL: C2064 on sort() of a vector Pin
toxcct22-Dec-05 0:22
toxcct22-Dec-05 0:22 
GeneralRe: STL: C2064 on sort() of a vector Pin
Sebastian Schneider22-Dec-05 0:39
Sebastian Schneider22-Dec-05 0:39 
GeneralRe: STL: C2064 on sort() of a vector Pin
toxcct22-Dec-05 2:16
toxcct22-Dec-05 2:16 
GeneralRe: STL: C2064 on sort() of a vector Pin
Sebastian Schneider22-Dec-05 2:43
Sebastian Schneider22-Dec-05 2:43 
QuestionConverting double to BYTE array Pin
ba5h33r21-Dec-05 23:36
ba5h33r21-Dec-05 23:36 
AnswerRe: Converting double to BYTE array Pin
toxcct22-Dec-05 0:20
toxcct22-Dec-05 0:20 
AnswerRe: Converting double to BYTE array Pin
kakan22-Dec-05 0:51
professionalkakan22-Dec-05 0:51 
GeneralRe: Converting double to BYTE array Pin
toxcct22-Dec-05 0:56
toxcct22-Dec-05 0:56 
GeneralRe: Converting double to BYTE array Pin
kakan22-Dec-05 1:00
professionalkakan22-Dec-05 1:00 
GeneralRe: Converting double to BYTE array Pin
toxcct22-Dec-05 1:02
toxcct22-Dec-05 1:02 
GeneralRe: Converting double to BYTE array Pin
kakan22-Dec-05 1:03
professionalkakan22-Dec-05 1:03 
GeneralRe: Converting double to BYTE array Pin
nde_plume22-Dec-05 6:16
nde_plume22-Dec-05 6:16 
AnswerRe: Converting double to BYTE array Pin
nde_plume22-Dec-05 6:11
nde_plume22-Dec-05 6:11 
QuestionCString+= Pin
bachirzantou21-Dec-05 23:36
bachirzantou21-Dec-05 23:36 
AnswerRe: CString+= Pin
Sebastian Schneider21-Dec-05 23:49
Sebastian Schneider21-Dec-05 23:49 
AnswerRe: CString+= Pin
Cedric Moonen22-Dec-05 0:00
Cedric Moonen22-Dec-05 0:00 
AnswerRe: CString+= Pin
vikas amin22-Dec-05 0:12
vikas amin22-Dec-05 0:12 

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.