Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Tiago Peixoto
graph-tool
Commits
463dfbb4
Commit
463dfbb4
authored
Jun 06, 2020
by
Tiago Peixoto
Browse files
Merge branch 'simplify-shared-any' into 'master'
Remove boost::any wrapper around std::shared_ptr See merge request
!28
parents
42e857bc
4c8a80b5
Pipeline
#634
passed with stage
in 308 minutes and 10 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/graph/graph.hh
View file @
463dfbb4
...
...
@@ -150,7 +150,7 @@ public:
// Gets the encapsulated graph view. See graph_filtering.cc for details
boost
::
any
get_graph_view
()
const
;
std
::
vector
<
boo
st
::
any
>&
get_graph_views
()
{
return
_graph_views
;}
std
::
vector
<
st
d
::
shared_ptr
<
void
>
>&
get_graph_views
()
{
return
_graph_views
;}
private:
...
...
@@ -168,7 +168,7 @@ private:
edge_index_map_t
_edge_index
;
// this will hold an instance of the graph views at run time
std
::
vector
<
boo
st
::
any
>
_graph_views
;
std
::
vector
<
st
d
::
shared_ptr
<
void
>
>
_graph_views
;
// reverse and directed states
bool
_reversed
;
...
...
src/graph/graph_filtering.hh
View file @
463dfbb4
...
...
@@ -524,17 +524,15 @@ retrieve_graph_view(GraphInterface& gi, Graph& init)
auto
&
graph_views
=
gi
.
get_graph_views
();
if
(
index
>=
graph_views
.
size
())
graph_views
.
resize
(
index
+
1
);
boost
::
any
&
gview
=
graph_views
[
index
];
std
::
shared_ptr
<
g_t
>*
gptr
=
boost
::
any_cast
<
std
::
shared_ptr
<
g_t
>>
(
&
gview
);
if
(
gptr
==
0
)
std
::
shared_ptr
<
void
>&
gview
=
graph_views
[
index
];
if
(
!
gview
)
{
std
::
shared_ptr
<
g_t
>
new_g
=
get_graph_ptr
<
g_t
>
(
gi
,
init
,
std
::
is_same
<
g_t
,
GraphInterface
::
multigraph_t
>
());
gview
=
new_g
;
return
new_g
;
}
return
*
gptr
;
return
std
::
static_pointer_cast
<
g_t
>
(
gview
)
;
}
}
//graph_tool namespace
...
...
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