David Haley said:
I haven't looked at the one in AFKMud
I'm talking about this template:
template < size_t N > char *bitset_string( bitset < N > bits, const char *flagarray[] )
{
static char buf[MSL];
size_t x;
buf[0] = '\0';
for( x = 0; x < bits.size( ); ++x )
{
if( bits.test( x ) )
{
mudstrlcat( buf, flagarray[x], MSL );
// don't catenate a blank if the last char is blank --Gorog
if( buf[0] != '\0' && ' ' != buf[strlen( buf ) - 1] )
mudstrlcat( buf, " ", MSL );
}
}
if( ( x = strlen( buf ) ) > 0 )
buf[--x] = '\0';
return buf;
}
I'm not sure exactly what you were proposing with setting flags on the bitvector. Do you mean extending the bitset class with additional member functions?