I meant pointer-to-const, but I think I got it the wrong way:

void f(const Pair *a, const Pair *b);
void g(Pair *a, Pair *b);

void test(const Pair *c, Pair *m)
{
        f(c, m);     // No error or warning.
        g(c, m);    // Error
}

const.cc:11: error: invalid conversion from const Pair* to Pair*
const.cc:11: error:   initializing argument 1 of void g(Pair*, Pair*)

PKE.
________________________________________
From: [email protected] [[email protected]] On Behalf Of 
Jonathan S. Shapiro [[email protected]]
Sent: Thursday, March 24, 2011 2:26 PM
To: Discussions about the BitC language
Subject: Re: [bitc-dev] Mutability, again

On Thu, Mar 24, 2011 at 1:53 PM, Pal Engstad 
<[email protected]<mailto:[email protected]>> wrote:
Well, the problem is akin to using a pointer as an argument to a function 
accepting a const-pointer (in C++), which is an error. I would expect BitC to 
be at least as stringent!

const pointer or pointer to const?

_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to