Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions include/boost/graph/detail/adjacency_list.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//=======================================================================
// Copyright 1997, 1998, 1999, 2000 University of Notre Dame.
// Copyright 2010 Thomas Claveirole
// Copyright (c) 2026 Arnaud Becheler
// Authors: Andrew Lumsdaine, Lie-Quan Lee, Jeremy G. Siek, Thomas Claveirole
//
// Distributed under the Boost Software License, Version 1.0. (See
Expand Down Expand Up @@ -1217,28 +1218,24 @@ struct bidirectional_graph_helper_with_property
typedef typename Config::graph_type graph_type;
typedef typename Config::out_edge_iterator out_edge_iterator;

std::pair< out_edge_iterator, out_edge_iterator > get_parallel_edge_sublist(
typename Config::edge_descriptor e, const graph_type& g, void*)
// Templates so that instantiating the whole class never compiles edge_range for out edge lists that lack it.
template < class OutEdgeListS >
std::pair< out_edge_iterator, out_edge_iterator > get_parallel_edge_sublist(typename Config::edge_descriptor e, const graph_type& g, OutEdgeListS*)
{
return out_edges(source(e, g), g);
}

std::pair< out_edge_iterator, out_edge_iterator > get_parallel_edge_sublist(
typename Config::edge_descriptor e, const graph_type& g, setS*)
{
return edge_range(source(e, g), target(e, g), g);
using has_edge_range = std::integral_constant< bool, std::is_convertible< OutEdgeListS*, setS* >::value || std::is_convertible< OutEdgeListS*, multisetS* >::value || std::is_convertible< OutEdgeListS*, hash_setS* >::value >;
return parallel_edge_sublist(e, g, has_edge_range());
}

std::pair< out_edge_iterator, out_edge_iterator > get_parallel_edge_sublist(
typename Config::edge_descriptor e, const graph_type& g, multisetS*)
template < class Graph >
std::pair< out_edge_iterator, out_edge_iterator > parallel_edge_sublist(typename Config::edge_descriptor e, const Graph& g, std::true_type)
{
return edge_range(source(e, g), target(e, g), g);
}

std::pair< out_edge_iterator, out_edge_iterator > get_parallel_edge_sublist(
typename Config::edge_descriptor e, const graph_type& g, hash_setS*)
template < class Graph >
std::pair< out_edge_iterator, out_edge_iterator > parallel_edge_sublist(typename Config::edge_descriptor e, const Graph& g, std::false_type)
{
return edge_range(source(e, g), target(e, g), g);
return out_edges(source(e, g), g);
}

// Placement of these overloaded remove_edge() functions
Expand Down
1 change: 1 addition & 0 deletions test/Jamfile.v2
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ alias graph_test_regular :
[ run betweenness_centrality_test.cpp : 100 ]
[ run bidir_remove_edge.cpp ]
[ compile-fail bidir_vec_remove_edge.cpp ]
[ compile bidir_list_out_edges_instantiation.cpp ]
[ run bipartite_test.cpp ]
[ run csr_graph_test.cpp : : : : : <variant>release ]
[ run dag_longest_paths.cpp ]
Expand Down
17 changes: 17 additions & 0 deletions test/bidir_list_out_edges_instantiation.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//=======================================================================
// Copyright (c) 2026 Arnaud Becheler
//
// 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)
//=======================================================================

// Forces every member of the bidirectional helper to compile for listS out edges, as a DLL export does (issue 229).

#include <boost/graph/adjacency_list.hpp>

using EdgeProperty = boost::property< boost::edge_weight_t, double >;
using Graph = boost::adjacency_list< boost::listS, boost::listS, boost::bidirectionalS, boost::no_property, EdgeProperty >;
using Config = boost::detail::adj_list_gen< Graph, boost::listS, boost::listS, boost::bidirectionalS, boost::no_property, EdgeProperty, boost::no_property, boost::listS >::config;

template struct boost::bidirectional_graph_helper_with_property< Config >;
Loading