comp.lang.c++
  Home FAQ Contact Sign in
comp.lang.c++ only
 
Advanced search
April 2008
motuwethfrsasuw
 123456 14
78910111213 15
14151617181920 16
21222324252627 17
282930     18
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007 2006  
total
comp.lang.c++ Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  operator+ cant be constant         


Author: Taras_96
Date: Apr 24, 2008 23:54

Hi all,

Jesse Liberty writes:

"Note that the String class provides the operator+. The designer of
the Employee class has
blocked access to the operator+ being called on Employee objects by
declaring that all the string
accessors, such as GetFirstName(), return a constant reference.
Because operator+ is not (and
can't be) a const function (it changes the object it is called on),
attempting to write the following will
cause a compile-time error:

String buffer = Edie.GetFirstName() + Edie.GetLastName();"

(the String class he refers to is a custom String class coded for
demonstration purposes)

I agree that the line will cause a compile time error because operator
+ isn't defined as a const method:

constString.operator+(anotherConstString) <- will not compile
Show full article (1.05Kb)
6 Comments
  EARN FROM YOUR P.C . WORK FROM YOUR HOME. THE WELL PAID ONLINE MAKING PROGRAMME INVITES YOU TO WORK WITH THEM AND GET PAID FOR YOUR WORK.YOU CAN EARN $2,00,000 IN A SINGLE WEEK. THE LINK IS BELOW         


Author: vicky
Date: Apr 24, 2008 23:11

EARN FROM YOUR P.C . WORK FROM YOUR HOME. THE WELL PAID ONLINE MAKING
PROGRAMME INVITES YOU TO WORK WITH THEM AND GET PAID FOR YOUR WORK.YOU
CAN EARN $2,00,000 IN A SINGLE WEEK. THE LINK IS BELOW

www.jeeva235.blogspot.com

THE BIGGEST OPPORTUNITY FOR YOU
no comments
  Speeding up calculating parsed equations         


Author: nkomli
Date: Apr 24, 2008 19:56

My goal is to allow users to enter in an equation that will be
calculated. In order to do this I’ve attached a parser to the program.
Unfortunately the equation has to be calculated millions of times. For
example

while(count !=limit)
{
Xnext= x+1;

x=xnext;
}

The parser is called to recalculate the equation every cycle which I
believe is the reason is why the program is as slow as Christmas. I
was wondering if there was any way to store the equation once it is
parsed to allow it to run at least close to the speeds it would of the
equation was hardcoded.

Here is the relevant part of the code in this example assume args and
args2 are x+1 and y+1.

int calculate()
{
Show full article (1.76Kb)
3 Comments
  Need Hashmap in C AND C++         


Author: lbrtchx
Date: Apr 24, 2008 19:18

Hi,
~
I have found myself in need of some code resembling a Hashmap
~
This is easily done in Java this way:
~
import java.util.*;
Show full article (0.77Kb)
no comments
  passing ref to ptr again as ref to ptr....         


Author: osama178
Date: Apr 24, 2008 13:43

Let's say I have this code

--------------------
class GenericQueue
{
public:
bool Pop(void*& refToPtr); //--------------(1)

};

class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return
GenericQueue::Pop(refToPtr); /
--------------------(2)
}

};

Why does the statement in (2) generate an error?
6 Comments
  passing ref to ptr again as ref to ptr....         


Author: osama178
Date: Apr 24, 2008 13:37

Let's say I have this code

--------------------
class GenericQueue
{
public:
bool Pop(void*& refToPtr); // //--------------------(1)

};

class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return
GenericQueue::Pop(refToPtr); /
--------------------(2)
}

};

Why doesn't the statement in -------(2) compile?
23 Comments
  passing ref to ptr again as ref to ptr....         


Author: osama178
Date: Apr 24, 2008 13:23

Let's say I have this code

--------------------
class GenericQueue
{
bool Pop(void*& refToPtr); // //--------------------(1)

};

class SpecialQueue: private GenericQueue
{
public:
bool Pop(T*& refToPtr)
{
return GenericQueue::Pop(refToPtr); //--------------------(2)
}

};

.... The statement in (2) generates an error.

I know it doesn't compile because we're passing a pointer in (2) to a
function that expects a reference to a pointer, but as soon as we go
into the code block in (2), refToPtr becomes just the pointer. How do
I get it as a reference to pointer so I can pass it correctly?
Show full article (0.62Kb)
no comments
  "Juro" is a newer series that resembles the "Museum," but features a smaller face and more subtle diamond inlays. The men's "Esperanza" model is the most complex luxury model with the three minute, second and tenth-of-a-second sub-dials.         


Author: service0093
Date: Apr 24, 2008 12:56

"Juro" is a newer series that resembles the "Museum," but features a
smaller face and more subtle diamond inlays. The men's "Esperanza"
model is the most complex luxury model with the three minute, second
and tenth-of-a-second sub-dials.

The 800 Series is a colorful line of sport watches for men and women
made out of durable stainless steel casing and has stick-like markers
for the obsessive time keeper or athlete. The Series 800 Chronograph
is the ultimate sports watch, with three round sub-dials accurately
measuring minutes, seconds and tenths-of-a-second.

at:salereplicawatch.com
no comments
  open files with specific pattern         


Author: unknown
Date: Apr 24, 2008 10:59

Hi,

I'm having files with a name pattern like "log_record-YY-MM-DD" and i would
like to create a list of the files available.
I'm wondering how i can do this, any ideas?

Thank you!
Ron
--
weeks of software enineering safe hours of planing ;)
4 Comments
  different results for C/C++ compiler         


Author: Vols
Date: Apr 24, 2008 10:26

char s[7] = "1234567";

when we use C compiler (gcc), it works fine.
An error is reported if using C++ compiler (g++).

any story for this one?

Vol
16 Comments
1 2 3 4