graph-v2 icon indicating copy to clipboard operation
graph-v2 copied to clipboard

Why `void` nested types in `vertex_info` and `edge_info`?

Open akrzemi1 opened this issue 6 months ago • 1 comments

vertex_info and edge_info are class templates for defining aggregates. When passed void as a template parameter:

  • the corresponding aggregate member disappears,
  • the corresponding nested type is void: https://github.com/stdgraph/graph-v2/blob/desc4/include/graph/graph_info.hpp#L41.

Why do we get an alias for void rather than a missing alias? Is there a use case for this?

akrzemi1 avatar Jun 18 '25 14:06 akrzemi1

I'd found that I wanted other code to adapt to whether a value existed or not. (I don't remember the circumstances off the top of my head.) It was easiest to have an alias of void.

Sent from Outlookhttp://aka.ms/weboutlook


From: Andrzej Krzemieński @.> Sent: Wednesday, June 18, 2025 7:19 AM To: stdgraph/graph-v2 @.> Cc: Subscribed @.***> Subject: [stdgraph/graph-v2] Why void nested types in vertex_info and edge_info? (Issue #166)

[https://avatars.githubusercontent.com/u/2912717?s=20&v=4]akrzemi1 created an issue (stdgraph/graph-v2#166)https://github.com/stdgraph/graph-v2/issues/166

vertex_info and edge_info are class templates for defining aggregates. When passed void as a template parameter:

  • the corresponding aggregate member disappears,
  • the corresponding nested type is void: https://github.com/stdgraph/graph-v2/blob/desc4/include/graph/graph_info.hpp#L41.

Why do we get an alias for void rather than a missing alias? Is there a use case for this?

— Reply to this email directly, view it on GitHubhttps://github.com/stdgraph/graph-v2/issues/166, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7NKETHKVC2EJ4LZB72YC33EFYPJAVCNFSM6AAAAAB7TIWKUWVHI2DSMVQWIX3LMV43ASLTON2WKOZTGE2TOMBXGU2TCMI. You are receiving this because you are subscribed to this thread.Message ID: @.***>

pratzl avatar Jun 18 '25 16:06 pratzl