Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
Actor Framework
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
cpp-libs
Actor Framework
Commits
b76d88ee
Commit
b76d88ee
authored
Apr 06, 2018
by
Dominik Charousset
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix build on GCC 4.8 (workaround for broken STL)
parent
8d5649f0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
3 deletions
+19
-3
libcaf_core/caf/detail/unordered_flat_map.hpp
libcaf_core/caf/detail/unordered_flat_map.hpp
+19
-3
No files found.
libcaf_core/caf/detail/unordered_flat_map.hpp
View file @
b76d88ee
...
@@ -178,7 +178,7 @@ public:
...
@@ -178,7 +178,7 @@ public:
std
::
pair
<
iterator
,
bool
>
insert
(
const_iterator
hint
,
value_type
x
)
{
std
::
pair
<
iterator
,
bool
>
insert
(
const_iterator
hint
,
value_type
x
)
{
auto
i
=
find
(
x
.
first
);
auto
i
=
find
(
x
.
first
);
if
(
i
==
end
())
if
(
i
==
end
())
return
{
xs_
.
insert
(
hint
,
std
::
move
(
x
)),
true
};
return
{
xs_
.
insert
(
gcc48_iterator_workaround
(
hint
)
,
std
::
move
(
x
)),
true
};
return
{
i
,
false
};
return
{
i
,
false
};
}
}
...
@@ -201,11 +201,12 @@ public:
...
@@ -201,11 +201,12 @@ public:
// -- removal ----------------------------------------------------------------
// -- removal ----------------------------------------------------------------
iterator
erase
(
const_iterator
i
)
{
iterator
erase
(
const_iterator
i
)
{
return
xs_
.
erase
(
i
);
return
xs_
.
erase
(
gcc48_iterator_workaround
(
i
)
);
}
}
iterator
erase
(
const_iterator
first
,
const_iterator
last
)
{
iterator
erase
(
const_iterator
first
,
const_iterator
last
)
{
return
xs_
.
erase
(
first
,
last
);
return
xs_
.
erase
(
gcc48_iterator_workaround
(
first
),
gcc48_iterator_workaround
(
last
));
}
}
size_type
erase
(
const
key_type
&
x
)
{
size_type
erase
(
const
key_type
&
x
)
{
...
@@ -268,6 +269,21 @@ public:
...
@@ -268,6 +269,21 @@ public:
}
}
private:
private:
// GCC < 4.9 has a broken STL: vector::erase accepts iterator instead of
// const_iterator.
// TODO: remove when dropping support for GCC 4.8.
#if defined(CAF_GCC) && CAF_COMPILER_VERSION < 49000
iterator
gcc48_iterator_workaround
(
const_iterator
i
)
{
auto
j
=
begin
();
std
::
advance
(
j
,
std
::
distance
(
cbegin
(),
i
));
return
j
;
}
#else
const_iterator
gcc48_iterator_workaround
(
const_iterator
i
)
{
return
i
;
}
#endif
vector_type
xs_
;
vector_type
xs_
;
};
};
...
...
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