Re: [patch] const_cast to be replaced by str_unconst



On Tuesday, April 12, 2005 at 12:27, Roland Illig wrote:

Hi!

> I'd like to introduce a new function:
> 
>     char *str_unconst(const char *);
> 
> The function returns a string that compares equal to its argument, but 
> does not have the "const" qualifier. Currently it just returns its 
> argument, cast to (char *).

In what way is this function (or macro) useful? It seems to break the
whole point with 'const' in C. If something is const, you shouldn't
touch it. Or should you?

Regards,

Oskar Liljeblad (oskar osk mine nu)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]