Re: random_shuffle seed
"Pete Becker" <petebecker@acm .org> wrote in message
news:3FAA5FC8.8 2984BEB@acm.org ...[color=blue]
> DrPizza wrote:[color=green]
> >
> > "Pete Becker" <petebecker@acm .org> wrote in message
> > news:3FA9B097.7 46AD23B@acm.org ...[color=darkred]
> > > DrPizza wrote:
> > > >
> > > > You wouldn't want to permit your C++ library to call strtok()
> > > > internally, would you?
> > >
> > > Sure. Why not?[/color]
> > Because it means you can't use strtok() yourself?[/color]
> Non sequitur.[/color]
If the implementation can call strtok() then I can't be sure what state
strtok()'s static buffer is in -- it need not be in the state I left it in.
This renders strtok() useless. If I use it I risk fucking up the library; if
the library uses it it risks fucking up my program.
[color=blue]
> The C++ standard does not change that constraint. No C function calls
> rand.[/color]
Except the "not called by the library" statement refers only to the library of
the implementation, not the C library. Given that in C++ the implementation
is one of C++, and the library is that of C++, the restriction should constain
the C++ library too.
--
Now Playing: Daft Punk - Around The World
char a[99999],*p=a;main(c,V) char**V;{char*v =c>0?1[V]:V;if(c)for(;(c =*v)&&93^
c;p+=!(62^c)-!(60^c),*p+=!(4 3^c)-!(45^c),44^c||r ead(0,p,1),46^c ||putchar(*p)
,91^c||(v=*p?ma in(-1,v+1),v-1:main(0,v)),++ v);else for(;c+=!(91^*v )-!(93^*v)
;++v);return v;} /* drpizza@battlea xe.net brainf*** program as argv[1] */
"Pete Becker" <petebecker@acm .org> wrote in message
news:3FAA5FC8.8 2984BEB@acm.org ...[color=blue]
> DrPizza wrote:[color=green]
> >
> > "Pete Becker" <petebecker@acm .org> wrote in message
> > news:3FA9B097.7 46AD23B@acm.org ...[color=darkred]
> > > DrPizza wrote:
> > > >
> > > > You wouldn't want to permit your C++ library to call strtok()
> > > > internally, would you?
> > >
> > > Sure. Why not?[/color]
> > Because it means you can't use strtok() yourself?[/color]
> Non sequitur.[/color]
If the implementation can call strtok() then I can't be sure what state
strtok()'s static buffer is in -- it need not be in the state I left it in.
This renders strtok() useless. If I use it I risk fucking up the library; if
the library uses it it risks fucking up my program.
[color=blue]
> The C++ standard does not change that constraint. No C function calls
> rand.[/color]
Except the "not called by the library" statement refers only to the library of
the implementation, not the C library. Given that in C++ the implementation
is one of C++, and the library is that of C++, the restriction should constain
the C++ library too.
--
Now Playing: Daft Punk - Around The World
char a[99999],*p=a;main(c,V) char**V;{char*v =c>0?1[V]:V;if(c)for(;(c =*v)&&93^
c;p+=!(62^c)-!(60^c),*p+=!(4 3^c)-!(45^c),44^c||r ead(0,p,1),46^c ||putchar(*p)
,91^c||(v=*p?ma in(-1,v+1),v-1:main(0,v)),++ v);else for(;c+=!(91^*v )-!(93^*v)
;++v);return v;} /* drpizza@battlea xe.net brainf*** program as argv[1] */
Comment