Skip to main content
gamedev.net
🔒 Locked

Bitset addition

Started by Thetan 0 replies 1k views
Original Post
Thetan
Thetan
I'm trying to increment a bitset by one. I know this is wrong, and g++ bitches when i try it. workLoad.bitset(workLoad.to_ulong()+1); but how would i do this?
___#define ever (;;)for ever delete (void *) rand();
Zakwayda
Zakwayda
Quote:
Original post by Thetan
I'm trying to increment a bitset by one.

I know this is wrong, and g++ bitches when i try it.
workLoad.bitset(workLoad.to_ulong()+1);

but how would i do this?
I don't think the bitset constructor that takes an integer is marked explicit, so you should be able to write:
workLoad = workLoad.to_ulong() + 1;
I'm assuming that workLoad is a bitset object.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.