Modify

Opened 7 years ago

Closed 7 years ago

#3849 closed Bugs (fixed)

intrusive::unordered_set::suggested_lower_bucket_count

Reported by: ef@… Owned by: igaztanaga
Milestone: Boost 1.45.0 Component: intrusive
Version: Boost 1.41.0 Severity: Problem
Keywords: Cc:

Description

The above static method crashes or doesn't return the correct value.

Code in boost 1.41 is:
static size_type suggested_lower_bucket_count(size_type n)
{

const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
size_type const* bound = std::upper_bound(primes, primes_end, n);
if(bound != primes_end)

bound--;

return size_type(*bound);

}

I think it should be:
static size_type suggested_lower_bucket_count(size_type n)
{

const std::size_t *primes = &detail::prime_list_holder<0>::prime_list[0];
const std::size_t *primes_end = primes + detail::prime_list_holder<0>::prime_list_size;
size_type const* bound = std::upper_bound(primes, primes_end, n);
if(bound != primes)

bound--;

return size_type(*bound);

}

Thank you,
Etienne

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by Etienne Frédéric <ef@…>

The bug is still there in 1.42. Has somebody at least read this ticket ? Thanks.

comment:2 Changed 7 years ago by igaztanaga

  • Milestone changed from Boost 1.42.0 to Boost-1.45.0
  • Resolution set to fixed
  • Status changed from new to closed

Fixed for Boost 1.45 in release branch

Add Comment

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain igaztanaga.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.