Hi, char* is not longer supported as a default range type by the range library. you can use const char* literals only. You can pass char* only if you convert it to a range using as_literal or as_array helpers, that are part of the range library. We have to change this since thare were ambiguieties in char* usage. Best regards, Pavol. L Pocaille wrote:
The following code was working in boost 1.34
char smurf_name[512]; strcpy(smurf_name, "Schtroumpf"); bool samething= boost::iequals("Schtroumpf", smurf_name); assert(samething);
but it no longer works in 1.35.
Thanks,
www.jubii.fr http://www.jubii.fr/jubii-partner-1.0/viewSimpleLogin.do c'est une seule interface pour communiquer. Email, téléphone gratuit, messagerie instantanée, 10 Go d'espace de stockage. Avec www.jubii.fr < http://www.jubii.fr/jubii-partner-1.0/viewSimpleLogin.do> simplifiez-vous la vie !
------------------------------------------------------------------------
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Pavol Droba skrev:
Hi,
char* is not longer supported as a default range type by the range library. you can use const char* literals only.
You can pass char* only if you convert it to a range using as_literal or as_array helpers, that are part of the range library.
We have to change this since thare were ambiguieties in char* usage.
Best regards, Pavol.
L Pocaille wrote:
The following code was working in boost 1.34
char smurf_name[512]; strcpy(smurf_name, "Schtroumpf"); bool samething= boost::iequals("Schtroumpf", smurf_name); assert(samething);
but it no longer works in 1.35.
Pavol, why don't you use as_literal() internally in the string library? Would that not preserve the behavior? -Thorsten
Thorsten Ottosen wrote:
Pavol Droba skrev:
Hi,
char* is not longer supported as a default range type by the range library. you can use const char* literals only.
You can pass char* only if you convert it to a range using as_literal or as_array helpers, that are part of the range library.
We have to change this since thare were ambiguieties in char* usage.
Best regards, Pavol.
L Pocaille wrote:
The following code was working in boost 1.34
char smurf_name[512]; strcpy(smurf_name, "Schtroumpf"); bool samething= boost::iequals("Schtroumpf", smurf_name); assert(samething);
but it no longer works in 1.35.
Pavol,
why don't you use as_literal() internally in the string library? Would that not preserve the behavior?
Actualy I do. But it seems, that this way it works only with const-chars . Pavol.
Pavol Droba skrev:
Thorsten Ottosen wrote:
Pavol Droba skrev:
Hi,
char* is not longer supported as a default range type by the range library. you can use const char* literals only.
You can pass char* only if you convert it to a range using as_literal or as_array helpers, that are part of the range library.
We have to change this since thare were ambiguieties in char* usage.
Best regards, Pavol.
L Pocaille wrote:
The following code was working in boost 1.34
char smurf_name[512]; strcpy(smurf_name, "Schtroumpf"); bool samething= boost::iequals("Schtroumpf", smurf_name); assert(samething);
but it no longer works in 1.35. Pavol,
why don't you use as_literal() internally in the string library? Would that not preserve the behavior?
Actualy I do. But it seems, that this way it works only with const-chars .
Oh? On every compiler? Looking at the example I'me a bit surprised that this have ever worked *unless smurf_name was passed by value to force a decay*. AFAICT, the range returned by as_literal(smurf_name) will be very long because we don't scan arrays, only pointers, for a null. I remember some problems with this earlier. But I'm suprprised that our regression of the string algorithms library would not have cought this. -Thorsten
Thorsten Ottosen wrote:
Pavol Droba skrev:
Thorsten Ottosen wrote:
Pavol Droba skrev:
Hi,
char* is not longer supported as a default range type by the range library. you can use const char* literals only.
You can pass char* only if you convert it to a range using as_literal or as_array helpers, that are part of the range library.
We have to change this since thare were ambiguieties in char* usage.
Best regards, Pavol.
L Pocaille wrote:
The following code was working in boost 1.34
char smurf_name[512]; strcpy(smurf_name, "Schtroumpf"); bool samething= boost::iequals("Schtroumpf", smurf_name); assert(samething);
but it no longer works in 1.35. Pavol,
why don't you use as_literal() internally in the string library? Would that not preserve the behavior?
Actualy I do. But it seems, that this way it works only with const-chars .
Oh? On every compiler?
Looking at the example I'me a bit surprised that this have ever worked *unless smurf_name was passed by value to force a decay*. AFAICT, the range returned by as_literal(smurf_name) will be very long because we don't scan arrays, only pointers, for a null.
Ooops, I was supposed to fix this, but it seems, that I forgot ;(
I remember some problems with this earlier. But I'm suprprised that our regression of the string algorithms library would not have cought this.
There used to be tests for char* arguments, but since they were deemed as invalid usage, I have removed them from the test suite. Pavol.
participants (3)
-
L Pocaille
-
Pavol Droba
-
Thorsten Ottosen