Skip to content

Edge desc#23

Merged
pratzl merged 5 commits intomainfrom
edge_desc
Apr 12, 2026
Merged

Edge desc#23
pratzl merged 5 commits intomainfrom
edge_desc

Conversation

@pratzl
Copy link
Copy Markdown
Collaborator

@pratzl pratzl commented Apr 12, 2026

edge descriptor simplification & performance improvement

pratzl added 5 commits April 1, 2026 21:22
- vertex-patterns.md: add index_only_vertex/container_backed_vertex to
  Foundation Concepts table; add note to Storage Concepts about
  direct_vertex_type covering both container and index-only iterators;
  add requires notes to inner_value/underlying_value in Member Functions;
  add new Index-Only Aliases section with usage example
- concepts.md: add index_only_vertex and container_backed_vertex to
  Descriptor Concepts table
- archive/descriptor.md: add index-only iterator category to vertex
  descriptor spec
…rtices(g)

edge_descriptor always stores EdgeIter directly — edges always have
physical containers, so the conditional_t<random_access_iterator<EdgeIter>,
size_t, EdgeIter> dual-storage path was unnecessary overhead. This
eliminates 38 if constexpr branches across 6 files (~380 lines removed).

compressed_graph: vertices(g) now returns iota_view<size_t,size_t>(0, n),
which the vertices CPO wraps automatically via _wrap_if_needed. The
empty-graph special case is no longer needed.

vertex_descriptor_view: CTAD deduction guides updated to use
std::ranges::iterator_t<> so they work with views (e.g. iota_view)
that lack Container::iterator/const_iterator nested types.

edge_descriptor_view: Fixed forward_list compatibility — removed spurious
sized_range constraint from container constructor, changed if to
if constexpr so std::ranges::size() is not compiled for non-sized ranges.

Tests: Rewrote test_edge_descriptor.cpp and test_descriptor_traits.cpp
for iterator-based storage. Updated test_compressed_graph_cpo.cpp (21
call sites replaced). Fixed pre-existing ODR violation in
test_source_id_cpo.cpp (namespace rename to avoid CustomEdge collision).
Fixed test_edge_value_cpo.cpp custom graph structs to dereference
iterators. Fixed unused vertex_data parameters.
- CHANGELOG: add entries for edge_descriptor simplification, vertices(g)
  iota_view, CTAD guide update, and edge_descriptor_view forward_list fix
- vertex-patterns.md: CTAD guides now show std::ranges::iterator_t<>
- adjacency-list-interface.md: edge_descriptor wraps iterator (not index)
- edge-value-concepts.md: target_id() always dereferences stored iterator
- adjacency-lists.md: fix edge_descriptor template parameter names
- archive/descriptor.md: spec updated for iterator-only edge storage
- bgl2_comparison_result.md: updated code sample and size comparison
- archive/edge_map_analysis.md: updated code sample
@pratzl pratzl merged commit 5085c60 into main Apr 12, 2026
11 checks passed
@pratzl pratzl deleted the edge_desc branch April 12, 2026 16:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant