Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
3b199abf
Kaydet (Commit)
3b199abf
authored
Tem 17, 2012
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sorted_vector: rename nonconst methods to be more obvious
Change-Id: I4ba4164343f252ac451433ba3b07e2cd214e13f8
üst
a24f1f69
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
sorted_vector.hxx
o3tl/inc/o3tl/sorted_vector.hxx
+8
-7
No files found.
o3tl/inc/o3tl/sorted_vector.hxx
Dosyayı görüntüle @
3b199abf
...
@@ -55,7 +55,7 @@ public:
...
@@ -55,7 +55,7 @@ public:
std
::
pair
<
const_iterator
,
bool
>
insert
(
const
Value
&
x
)
std
::
pair
<
const_iterator
,
bool
>
insert
(
const
Value
&
x
)
{
{
iterator
it
=
_lower_bound
(
x
);
iterator
it
=
lower_bound_nonconst
(
x
);
if
(
it
==
base_t
::
end
()
||
less_than
(
x
,
*
it
))
if
(
it
==
base_t
::
end
()
||
less_than
(
x
,
*
it
))
{
{
it
=
base_t
::
insert
(
it
,
x
);
it
=
base_t
::
insert
(
it
,
x
);
...
@@ -66,7 +66,7 @@ public:
...
@@ -66,7 +66,7 @@ public:
size_type
erase
(
const
Value
&
x
)
size_type
erase
(
const
Value
&
x
)
{
{
iterator
it
=
_lower_bound
(
x
);
iterator
it
=
lower_bound_nonconst
(
x
);
if
(
it
!=
base_t
::
end
()
&&
!
less_than
(
x
,
*
it
))
if
(
it
!=
base_t
::
end
()
&&
!
less_than
(
x
,
*
it
))
{
{
erase
(
it
);
erase
(
it
);
...
@@ -77,7 +77,7 @@ public:
...
@@ -77,7 +77,7 @@ public:
void
erase
(
size_t
index
)
void
erase
(
size_t
index
)
{
{
base_t
::
erase
(
_begin
()
+
index
);
base_t
::
erase
(
begin_nonconst
()
+
index
);
}
}
// ACCESSORS
// ACCESSORS
...
@@ -160,7 +160,8 @@ public:
...
@@ -160,7 +160,8 @@ public:
// of another sorted vector
// of another sorted vector
if
(
empty
()
)
if
(
empty
()
)
{
{
base_t
::
insert
(
_begin
(),
rOther
.
_begin
(),
rOther
.
_end
()
);
base_t
::
insert
(
begin_nonconst
(),
rOther
.
begin_nonconst
(),
rOther
.
end_nonconst
()
);
}
}
else
else
for
(
const_iterator
it
=
rOther
.
begin
();
it
!=
rOther
.
end
();
++
it
)
for
(
const_iterator
it
=
rOther
.
begin
();
it
!=
rOther
.
end
();
++
it
)
...
@@ -183,14 +184,14 @@ private:
...
@@ -183,14 +184,14 @@ private:
return
me
.
operator
()(
lhs
,
rhs
);
return
me
.
operator
()(
lhs
,
rhs
);
}
}
iterator
_lower_bound
(
const
Value
&
x
)
iterator
lower_bound_nonconst
(
const
Value
&
x
)
{
{
const
MyCompare
&
me
=
*
this
;
const
MyCompare
&
me
=
*
this
;
return
std
::
lower_bound
(
base_t
::
begin
(),
base_t
::
end
(),
x
,
me
);
return
std
::
lower_bound
(
base_t
::
begin
(),
base_t
::
end
(),
x
,
me
);
}
}
typename
base_t
::
iterator
_begin
()
{
return
base_t
::
begin
();
}
typename
base_t
::
iterator
begin_nonconst
()
{
return
base_t
::
begin
();
}
typename
base_t
::
iterator
_end
()
{
return
base_t
::
end
();
}
typename
base_t
::
iterator
end_nonconst
()
{
return
base_t
::
end
();
}
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment