Title: ambiguous call · Issue #3 · Cryoris/matplotlib-cpp · GitHub
Open Graph Title: ambiguous call · Issue #3 · Cryoris/matplotlib-cpp
X Title: ambiguous call · Issue #3 · Cryoris/matplotlib-cpp
Description: When compiling a standard example from readthedocs, #include #include "matplotlibcpp.h" namespace plt = matplotlibcpp; int main() { std::vector x = {1, 2, 3, 4}; std::vector y = {1, 4, 9, 16}; plt::plot(x, y,"r*"); plt::show(); } on Visu...
Open Graph Description: When compiling a standard example from readthedocs, #include #include "matplotlibcpp.h" namespace plt = matplotlibcpp; int main() { std::vector x = {1, 2, 3, 4}; std::vector y = {1, 4, 9, 16}; plt:...
X Description: When compiling a standard example from readthedocs, #include #include "matplotlibcpp.h" namespace plt = matplotlibcpp; int main() { std::vector x = {1, 2, 3, 4}; std::vector y = {1, 4, 9,...
Opengraph URL: https://github.com/Cryoris/matplotlib-cpp/issues/3
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"ambiguous call","articleBody":"When compiling a standard example from [readthedocs](https://matplotlib-cpp.readthedocs.io/en/latest/docs.html), \r\n\r\n#include \u003cvector\u003e\r\n#include \"matplotlibcpp.h\"\r\nnamespace plt = matplotlibcpp;\r\nint main() {\r\n std::vector\u003cdouble\u003e x = {1, 2, 3, 4};\r\n std::vector\u003cdouble\u003e y = {1, 4, 9, 16};\r\n plt::plot(x, y,\"r*\");\r\n plt::show();\r\n}\r\n\r\n on VisualStudio22 with the ISO C++20 flag and native Python 3.10, I get\r\n\r\n\r\n\r\nApparently, the compiler cannot decide between \r\n\r\n// @brief standard plot function supporting the args (x, y, s, keywords) // line 519\r\n// ...\r\ntemplate \u003ctypename VectorX, typename VectorY\u003e\r\nbool plot(const VectorX \u0026x, const VectorY \u0026y, const std::string \u0026s = \"\",\r\n const std::map\u003cstd::string, std::string\u003e \u0026keywords = {}) {\r\n return detail::plot_base(detail::_interpreter::get().s_python_function_plot,\r\n x, y, s, keywords);\r\n}\r\n\r\nand\r\n\r\n// enable plotting of multiple triples (x, y, format) // line 1953\r\ntemplate \u003ctypename A, typename B, typename... Args\u003e\r\nbool plot(const A \u0026a, const B \u0026b, const std::string \u0026format, Args... args) {\r\n return plot(a, b, format) \u0026\u0026 plot(args...);\r\n}\r\n\r\nAs I understand, correct me if I'm wrong, there a several constructors, each of which is designed to fall through to the first one above, the one that finally calls plot_base. So, I renamed all constructors but the first one above plot1, and my code now successfully calls plt::plot1 ..... Of course, messing with your library and using non-standard calls on my side is not a proper solution. Rename the fall-through constructor, and I haven't even tested similarily overloaded functions?","author":{"url":"https://github.com/bjornrommel","@type":"Person","name":"bjornrommel"},"datePublished":"2022-01-28T11:57:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/3/matplotlib-cpp/issues/3"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:0c9c56e3-35d2-b8dc-41e1-39a2eb370e88 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ABD8:300650:2C8DD4:3C2A5C:6A568E1A |
| html-safe-nonce | 8fb348c01c742831ca0bf9416958f63da0ffde090a2c5ab94d30ebce8cbb30ac |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkQ4OjMwMDY1MDoyQzhERDQ6M0MyQTVDOjZBNTY4RTFBIiwidmlzaXRvcl9pZCI6IjYwNDI0NDc2NTc4MjE0NDE1NjIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 7e0ce1ec9afba3430a57ceb6b45a5901024ee895df8a6c4ad3e900fb887f34fd |
| hovercard-subject-tag | issue:1117321911 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/Cryoris/matplotlib-cpp/3/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8404164669f5e947f81939b18f0b8fca631e798500563f3d2e63443969a84b32/Cryoris/matplotlib-cpp/issues/3 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8404164669f5e947f81939b18f0b8fca631e798500563f3d2e63443969a84b32/Cryoris/matplotlib-cpp/issues/3 |
| og:image:alt | When compiling a standard example from readthedocs, #include #include "matplotlibcpp.h" namespace plt = matplotlibcpp; int main() { std::vector x = {1, 2, 3, 4}; std::vector y = {1, 4, 9, 16}; plt:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | bjornrommel |
| hostname | github.com |
| expected-hostname | github.com |
| None | 8f21be8503ba8fe6154df415b855c03af52eae3f285bd6ae1fef041dc053da38 |
| turbo-cache-control | no-preview |
| go-import | github.com/Cryoris/matplotlib-cpp git https://github.com/Cryoris/matplotlib-cpp.git |
| octolytics-dimension-user_id | 5978796 |
| octolytics-dimension-user_login | Cryoris |
| octolytics-dimension-repository_id | 41151748 |
| octolytics-dimension-repository_nwo | Cryoris/matplotlib-cpp |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | true |
| octolytics-dimension-repository_parent_id | 24936365 |
| octolytics-dimension-repository_parent_nwo | lava/matplotlib-cpp |
| octolytics-dimension-repository_network_root_id | 24936365 |
| octolytics-dimension-repository_network_root_nwo | lava/matplotlib-cpp |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 78af172a48a2056810bb627ffa684003e4f9a5ca |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width