mirror of
https://github.com/boostorg/multi_index.git
synced 2025-05-09 23:14:04 +00:00
fixed [12955]
This commit is contained in:
parent
df022fa659
commit
3e1095d609
@ -59,6 +59,10 @@ Acknowledgements
|
||||
|
||||
<p>
|
||||
<ul>
|
||||
<li>Fixed a bug related to ambiguous references in the presence of more than
|
||||
one ranked index
|
||||
(ticket <a href="https://svn.boost.org/trac/boost/ticket/12955">#12955</a>).
|
||||
</li>
|
||||
<li>Maintenance fixes.</li>
|
||||
</ul>
|
||||
</p>
|
||||
@ -530,9 +534,9 @@ Acknowledgements
|
||||
|
||||
<br>
|
||||
|
||||
<p>Revised December 14th 2016</p>
|
||||
<p>Revised April 10th 2017</p>
|
||||
|
||||
<p>© Copyright 2003-2016 Joaquín M López Muñoz.
|
||||
<p>© Copyright 2003-2017 Joaquín M López Muñoz.
|
||||
Distributed under the Boost Software
|
||||
License, Version 1.0. (See accompanying file <a href="../../../LICENSE_1_0.txt">
|
||||
LICENSE_1_0.txt</a> or copy at <a href="http://www.boost.org/LICENSE_1_0.txt">
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -109,7 +109,7 @@ inline std::size_t ranked_index_find_rank(
|
||||
{
|
||||
if(!top)return 0;
|
||||
|
||||
std::size_t s=top->size,
|
||||
std::size_t s=top->impl()->size,
|
||||
s0=s;
|
||||
Node* y0=y;
|
||||
|
||||
@ -162,7 +162,7 @@ inline std::size_t ranked_index_lower_bound_rank(
|
||||
{
|
||||
if(!top)return 0;
|
||||
|
||||
std::size_t s=top->size;
|
||||
std::size_t s=top->impl()->size;
|
||||
|
||||
do{
|
||||
if(!comp(key(top->value()),x)){
|
||||
@ -213,7 +213,7 @@ inline std::size_t ranked_index_upper_bound_rank(
|
||||
{
|
||||
if(!top)return 0;
|
||||
|
||||
std::size_t s=top->size;
|
||||
std::size_t s=top->impl()->size;
|
||||
|
||||
do{
|
||||
if(comp(x,key(top->value()))){
|
||||
@ -266,7 +266,7 @@ inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
|
||||
{
|
||||
if(!top)return std::pair<std::size_t,std::size_t>(0,0);
|
||||
|
||||
std::size_t s=top->size;
|
||||
std::size_t s=top->impl()->size;
|
||||
|
||||
do{
|
||||
if(comp(key(top->value()),x)){
|
||||
@ -279,7 +279,7 @@ inline std::pair<std::size_t,std::size_t> ranked_index_equal_range_rank(
|
||||
}
|
||||
else{
|
||||
return std::pair<std::size_t,std::size_t>(
|
||||
s-top->size+
|
||||
s-top->impl()->size+
|
||||
ranked_index_lower_bound_rank(
|
||||
Node::from_impl(top->left()),top,key,x,comp,mpl::false_()),
|
||||
s-ranked_node_size(top->right())+
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2003-2015 Joaquin M Lopez Munoz.
|
||||
/* Copyright 2003-2017 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -165,7 +165,7 @@ private:
|
||||
|
||||
if(!z)return std::pair<std::size_t,std::size_t>(0,0);
|
||||
|
||||
std::size_t s=z->size;
|
||||
std::size_t s=z->impl()->size;
|
||||
|
||||
do{
|
||||
if(!lower(this->key(z->value()))){
|
||||
@ -178,7 +178,7 @@ private:
|
||||
}
|
||||
else{
|
||||
return std::pair<std::size_t,std::size_t>(
|
||||
s-z->size+
|
||||
s-z->impl()->size+
|
||||
lower_range_rank(node_type::from_impl(z->left()),z,lower),
|
||||
s-ranked_node_size(z->right())+
|
||||
upper_range_rank(node_type::from_impl(z->right()),y,upper));
|
||||
@ -219,7 +219,7 @@ private:
|
||||
{
|
||||
if(!top)return 0;
|
||||
|
||||
std::size_t s=top->size;
|
||||
std::size_t s=top->impl()->size;
|
||||
|
||||
do{
|
||||
if(lower(this->key(top->value()))){
|
||||
@ -239,7 +239,7 @@ private:
|
||||
{
|
||||
if(!top)return 0;
|
||||
|
||||
std::size_t s=top->size;
|
||||
std::size_t s=top->impl()->size;
|
||||
|
||||
do{
|
||||
if(!upper(this->key(top->value()))){
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* Boost.MultiIndex test for rank operations.
|
||||
*
|
||||
* Copyright 2003-2015 Joaquin M Lopez Munoz.
|
||||
* Copyright 2003-2017 Joaquin M Lopez Munoz.
|
||||
* Distributed under the Boost Software License, Version 1.0.
|
||||
* (See accompanying file LICENSE_1_0.txt or copy at
|
||||
* http://www.boost.org/LICENSE_1_0.txt)
|
||||
@ -139,4 +139,16 @@ void test_rank_ops()
|
||||
> ranked_multiset;
|
||||
|
||||
local_test_rank_ops<ranked_multiset>();
|
||||
|
||||
/* testcase for https://svn.boost.org/trac/boost/ticket/12955 */
|
||||
|
||||
typedef multi_index_container<
|
||||
int,
|
||||
indexed_by<
|
||||
ranked_unique<identity<int> >,
|
||||
ranked_non_unique<identity<int> >
|
||||
>
|
||||
> biranked_set;
|
||||
|
||||
local_test_rank_ops<biranked_set>();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user