コード例 #1
0
ファイル: bits.hpp プロジェクト: gfphoenix/i2d
    inline void toggle(int nr){
	int idx = nr/bits_();
	int off = nr%bits_();
	data_[idx] ^= (((ul)1)<<off);
    }
コード例 #2
0
ファイル: bits.hpp プロジェクト: gfphoenix/i2d
    inline void clear(int nr){
	int idx = nr/bits_();
	int off = nr%bits_();
	data_[idx] &= ~(((ul)1)<<off);
    }
コード例 #3
0
ファイル: bits.hpp プロジェクト: gfphoenix/i2d
    inline bool isSet(int nr)const{
	int idx = nr/bits_();
	int off = nr%bits_();
	return (data_[idx]&(((ul)1)<<off)) != 0;
    }
コード例 #4
0
ファイル: bits.hpp プロジェクト: gfphoenix/i2d
    inline void set(int nr){
	int idx = nr/bits_();
	int off = nr%bits_();
	data_[idx] |= ((ul)1)<<off;
    }
コード例 #5
0
ファイル: integer.cpp プロジェクト: mchlhess/Integer
Integer::Integer()
{
  //Need to declare an empty vector, otherwise subtraction operator will dereference a null pointer
  std::vector<bool> bits_(0);
}