Error message in CPO `target` does not match its customization options
The assertion error message in CPO target mentions three ways of customizing it: target(g,uv) or uv.target(g) or g.target_id(g,uv):
https://github.com/stdgraph/graph-v2/blob/master/include/graph/detail/graph_cpo.hpp#L1256
But the CPO in reality offers only two ways, and one is still different than these in the message.
Something needs to be changed: either the message or the list of customization methods.
The message referring to g.target_id(g,uv) should be target_id(g,uv), without the "g." prefix. target_id(g,uv) is used with find_vertex(g,uid) to get a vertex reference as default behavior. It makes sense to update the message to make it clearer.
Here's an updated message that I've added to a branch to help: "target(g,uv) or uv.target(g) are not defined for the graph, or target_id(g,uv) is not defined to enable default functionality to find a vertex by Id"
Sent from Outlookhttp://aka.ms/weboutlook
From: Andrzej Krzemieński @.>
Sent: Saturday, July 12, 2025 6:54 PM
To: stdgraph/graph-v2 @.>
Cc: Subscribed @.***>
Subject: [stdgraph/graph-v2] Error message in CPO target does not match its customization options (Issue #177)
[https://avatars.githubusercontent.com/u/2912717?s=20&v=4]akrzemi1 created an issue (stdgraph/graph-v2#177)https://github.com/stdgraph/graph-v2/issues/177
The assertion error message in CPO target mentions three ways of customizing it: target(g,uv) or uv.target(g) or g.target_id(g,uv): https://github.com/stdgraph/graph-v2/blob/master/include/graph/detail/graph_cpo.hpp#L1256
But the CPO in reality offers only two ways, and one is still different than these in the message.
Something needs to be changed: either the message or the list of customization methods.
— Reply to this email directly, view it on GitHubhttps://github.com/stdgraph/graph-v2/issues/177, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7NKEQYZYSNU7YP5FD37SD3IGG4HAVCNFSM6AAAAACBMHYKL6VHI2DSMVQWIX3LMV43ASLTON2WKOZTGIZDKOBYGYYDINY. You are receiving this because you are subscribed to this thread.
May I suggest a more positive message instead.
"Customization point graph::target is not valid. To make it valid either define function target(g,uv) or uv.target(g) (and they will be called), or define function target_id(g,uv) and the default implementation will use it."`