Template parameters:
- \p BitString - a fixed-sized type that interprets as bit string
- - \p BitStringSize - the siZe of \p BitString in bytes, default is <tt>sizeof( BitString )</tt>
+ - \p BitStringSize - the size of \p BitString in bytes, default is <tt>sizeof( BitString )</tt>.
+ You can specify 0 for default.
- \p UInt - an unsigned integer, return type of \p cut()
*/
template <typename BitString, size_t BitStringSize = sizeof( BitString ), typename UInt = typename std::conditional< BitStringSize % sizeof(size_t) == 0, size_t, unsigned >::type >
public:
typedef BitString bitstring; ///< Bit-string type
typedef UInt uint_type; ///< Bit-string portion type
- static CDS_CONSTEXPR size_t const c_bitstring_size = BitStringSize; ///< size of \p BitString in bytes
+ static CDS_CONSTEXPR size_t const c_bitstring_size = BitStringSize ? BitStringSize : sizeof( BitString ); ///< size of \p BitString in bytes
//@cond
static CDS_CONSTEXPR size_t const c_nHashSize = (c_bitstring_size + sizeof(uint_type) - 1) / sizeof(uint_type);
template <typename Q>
node_type(hasher& h, Q const& key)
- : m_Value(std::move(std::make_pair(key, mapped_type())))
- , m_hash(h(m_Value.first))
+ : m_Value( std::move( std::make_pair( key_type( key ), mapped_type())))
+ , m_hash( h( m_Value.first ))
{}
template <typename Q, typename U >
node_type(hasher& h, Q const& key, U const& val)
- : m_Value(std::move(std::make_pair(key, mapped_type(val))))
- , m_hash(h(m_Value.first))
+ : m_Value( std::move( std::make_pair( key_type( key ), mapped_type(val))))
+ , m_hash( h( m_Value.first ))
{}
template <typename Q, typename... Args>
node_type(hasher& h, Q&& key, Args&&... args)
- : m_Value(std::move(std::make_pair(std::forward<Q>(key), std::move(mapped_type(std::forward<Args>(args)...)))))
- , m_hash(h(m_Value.first))
+ : m_Value( std::move(std::make_pair( key_type( std::forward<Q>(key)), std::move( mapped_type(std::forward<Args>(args)...)))))
+ , m_hash( h( m_Value.first ))
{}
};
{
typedef typename TestFixture::hash_accessor2 hash_accessor;
enum: size_t {
- hash_size = sizeof( std::declval<key_val>().nKey )
+ hash_size = sizeof( std::declval<typename TestFixture::key_val>().nKey )
};
typedef typename TestFixture::cmp2 compare;
typedef typename TestFixture::mock_disposer disposer;
{
typedef PartUInt part_uint;
- typedef cds::algo::split_bitstring< uint64_t, part_uint > split_bitstring;
+ typedef cds::algo::split_bitstring< uint64_t, 0, part_uint > split_bitstring;
uint64_t src = 0xFEDCBA9876543210;
split_bitstring splitter(src);
{
typedef PartUInt part_uint;
- typedef cds::algo::split_bitstring< uint64_t, part_uint > split_bitstring;
+ typedef cds::algo::split_bitstring< uint64_t, 0, part_uint > split_bitstring;
uint64_t src = 0xFEDCBA9876543210;
split_bitstring splitter(src);
struct set_traits: public cc::feldman_hashset::traits
{
enum: size_t {
- hash_size = sizeof( std::declval<int_item2>().nKey )
+ hash_size = sizeof( std::declval<int_item>().nKey )
};
typedef get_hash2 hash_accessor;
+ typedef typename TestFixture::cmp2 compare;
typedef cc::feldman_hashset::stat<> stat;
};
- typedef cc::FeldmanHashSet< rcu_type, int_item2, set_traits > set_type;
+ typedef cc::FeldmanHashSet< rcu_type, int_item, set_traits > set_type;
set_type s( 8, 4 );
this->test( s );