Re: [htdig3-dev] Re: robots.txt bug (was [ANNOUNCE] ht://Dig


Subject: Re: [htdig3-dev] Re: robots.txt bug (was [ANNOUNCE] ht://Dig
From: loic@ceic.com
Date: Tue Feb 08 2000 - 11:40:37 PST


Geoff Hutchison writes:
> On Tue, 8 Feb 2000 loic@ceic.com wrote:
>
> > > given that rest is char * and not const char *? What will (String) =
> > > (char *) default to?
> >
> > No it's not. The opposite would be, barking when (String) = (const char*).
>
> Uhm. I hope I'm not the only one confused by your statement Loic. Are you
> saying that this code should be OK?

 No, I did not look at it. I was just saying that operator = (const char*)
was good for (char*) assignement. Sorry for the terse response :-} Here is
what I meant:

/*
[loic@localhost tmp]$ g++ -Wall -o /tmp/a /tmp/a.C
/tmp/a.C: In function `int main()':
/tmp/a.C:39: passing `const char *' as argument 1 of `t1::operator =(char *)' discards qualifiers
[loic@localhost tmp]$ /tmp/a
t1:char*
t1:char*
t2:const char*
t2:const char*
t3:const char*
t3:char*
[loic@localhost tmp]$
*/

#include <iostream.h>

class t1 {
public:
  void operator = (char* foo) { cerr << "t1:char*" << endl; }
};

class t2 {
public:
  void operator = (const char* foo) { cerr << "t2:const char*" << endl; }
};

class t3 {
public:
  void operator = (char* foo) { cerr << "t3:char*" << endl; }
  void operator = (const char* foo) { cerr << "t3:const char*" << endl; }
};

int main()
{
  const char* vconst = "foo";
  char* v = "bar";

  t1 v1;
  v1 = vconst;
  v1 = v;

  t2 v2;
  v2 = vconst;
  v2 = v;

  t3 v3;
  v3 = vconst;
  v3 = v;
}

-- 
		Loic Dachary

24 av Secretan 75019 Paris Tel: 33 1 42 45 09 16 e-mail: loic@dachary.org URL: http://www.senga.org/

------------------------------------ To unsubscribe from the htdig3-dev mailing list, send a message to htdig3-dev-unsubscribe@htdig.org You will receive a message to confirm this.



This archive was generated by hypermail 2b28 : Tue Feb 08 2000 - 10:26:27 PST