|
Boost : |
From: Dirk Gerrits (dirkg_at_[hidden])
Date: 2002-05-31 11:49:00
----- Original Message -----
From: "Victor A. Wagner, Jr." <vawjr_at_[hidden]>
> surely changing the required signature to allow for const is a better
solution
> putting const in the signature ALLOWS you to pas both const _and_
non-const
> items.
Are you sure? If it was a simple pointer than this would be true, but it's a
pointer to a pointer. (Or an array of pointers if you prefer.) The following
does
not compile in MSVC6 SP5 (and I don't think it should):
void test(const char**) { }
int main(int argc, char** argv)
{
test(argv);
return 0;
}
error C2664: 'test' : cannot convert parameter 1 from 'char ** ' to 'const
char ** '
Conversion loses qualifiers
Dirk Gerrits
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk