Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
8cd54aae
Commit
8cd54aae
authored
Jan 20, 2016
by
Hahn, Steven
Browse files
Workaround libstdc++ bug.
parent
c75921cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Framework/API/src/HistoryView.cpp
View file @
8cd54aae
...
...
@@ -39,6 +39,11 @@ void HistoryView::unroll(size_t index) {
unroll
(
it
);
}
#if defined(__GNUC__) && !defined(__clang__)
#define GCC_VERSION \
(__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
#endif
/**
* Unroll an algorithm history to export its child algorithms.
*
...
...
@@ -58,7 +63,6 @@ void HistoryView::unroll(std::vector<HistoryItem>::iterator &it) {
// mark this record as being ignored by the script builder
it
->
unrolled
(
true
);
++
it
;
// move iterator forward to insertion position
// insert each of the records, in order, at this position
std
::
vector
<
HistoryItem
>
tmpHistory
;
tmpHistory
.
reserve
(
childHistories
.
size
());
...
...
@@ -66,7 +70,17 @@ void HistoryView::unroll(std::vector<HistoryItem>::iterator &it) {
tmpHistory
.
emplace_back
(
item
);
}
// since we are using a std::vector, do all insertions at the same time.
#if !defined(GCC_VERSION) || GCC_VERSION >= 409000
++
it
;
// move iterator forward to insertion position
it
=
m_historyItems
.
insert
(
it
,
tmpHistory
.
begin
(),
tmpHistory
.
end
());
#else
// workaround for GCC < 4.9
// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=55817
for
(
const
auto
&
item
:
tmpHistory
)
{
++
it
;
// move iterator forward to insertion position
it
=
m_historyItems
.
insert
(
it
,
item
);
}
#endif
}
else
++
it
;
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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