René's URL Explorer Experiment


Title: Basic C++ & Singleton_registry - Suggestions to GrantRostig from an expert. · Issue #2 · cppmsg/cpp_by_example · GitHub

Open Graph Title: Basic C++ & Singleton_registry - Suggestions to GrantRostig from an expert. · Issue #2 · cppmsg/cpp_by_example

X Title: Basic C++ & Singleton_registry - Suggestions to GrantRostig from an expert. · Issue #2 · cppmsg/cpp_by_example

Description: https://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpp I've taken a look at the code in that header file. As for some suggestions: That .hpp file has both declarations in it as well as function ...

Open Graph Description: https://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpp I've taken a look at the code in that header file. As for some suggestions: That .hpp file has both...

X Description: https://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpp I've taken a look at the code in that header file. As for some suggestions: That .hpp file has ...

Opengraph URL: https://github.com/cppmsg/cpp_by_example/issues/2

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Basic C++ \u0026 Singleton_registry - Suggestions to GrantRostig from an expert.","articleBody":"https://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpp\r\nI've taken a look at the code in that header file.\r\nAs for some suggestions:\r\n1. That .hpp file has both declarations in it as well as function definitions. I'd suggest moving those function definitions into one or more source files or prefixing them with the \"inline\" keyword.\r\n2. The formatting is such that some lines have multiple statements on the same line. It's more common to see only a single statement per line and will be easier to read for people used to that - like myself.\r\n3. I see that file has a \"using namespace...\" statement in it. Those pollute the namespace for any users of that header file. I suggest removing it.\r\n4. The code uses a mix of qualified uses of standard library names and unqualified uses. Use only namespace qualified names for types from the standard library. So prefix mentions of types like \"string\" with \"std\" so those instead appear like \"std::string\".\r\n5. Come up with a more consistent formatting style and use it everywhere within that file. Qt Creator can be configured to auto format to some standard styles and that could be used to help for that.\r\n6. Remove the include of \u003cbits/stdc++.h\u003e from that file.\r\n7. Specifically include the standard library header files that are needed for that header file to stand alone. So for instance, there'd be includes like for \"\u003cstring\u003e\", \"\u003ccassert\u003e\", \"\u003ciostream\u003e\", \"\u003cmutex\u003e\".\r\n8. Don't use \"endl\". That appends a newline AND forces a flush of the stream buffer. If you really want both, use the newline character ('\\n') or string (\"\\n\") and follow it with an explicit \"std::flush\".\r\n9. Pick a max column width no more than like 120 for the code and then enforce that with newlines.\r\n10. \"Singleton_gof_registry::_registry\" does not need to be a pointer to a \"Registry\". That's basically a pointer to a pointer to a dynamically allocated array. Make it just of type \"Registry\" and then it doesn't need to be \"new\" allocated on first use.\r\n11. Don't mix uses of like \"end()\" member function values with \"cend()\" member function values.\r\n12. If you want to provide exclusive access to one section of code so another thread can't access those same variables, those sections need to all use the same \"std::mutex\" (or a different mechanism than \"std::mutex\" has to be used instead). So add \"mtx\" as a private member variable of \"Singleton_gof_registry\" and then the three member functions which use a \"std::mutex\" would all use the \"mtx\" member variable instead.","author":{"url":"https://github.com/grantrostig","@type":"Person","name":"grantrostig"},"datePublished":"2023-11-19T01:51:59.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/2/cpp_by_example/issues/2"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:cb0734ba-f89e-2596-1869-55120e48f9ec
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idDA90:B5089:C1143F:10DF8B8:6A4E83A6
html-safe-noncee075fd5c1bdebf4bfbedba51b55bf5b049cff0e8ea3fb13210a426e544c1da13
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQTkwOkI1MDg5OkMxMTQzRjoxMERGOEI4OjZBNEU4M0E2IiwidmlzaXRvcl9pZCI6Ijg0MjU1ODE5Mjc4MzA4MTU2NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacbca23c2cb44c7396f0952fe50d8ad93121860c48d826724311b3024f4230c893
hovercard-subject-tagissue:2000659210
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/cppmsg/cpp_by_example/2/issue_layout
twitter:imagehttps://opengraph.githubassets.com/771762b8e3ea1bbdf5894f2483d1fc9595050ce450a5fc4d1b8896590ec4e6a9/cppmsg/cpp_by_example/issues/2
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/771762b8e3ea1bbdf5894f2483d1fc9595050ce450a5fc4d1b8896590ec4e6a9/cppmsg/cpp_by_example/issues/2
og:image:althttps://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpp I've taken a look at the code in that header file. As for some suggestions: That .hpp file has both...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamegrantrostig
hostnamegithub.com
expected-hostnamegithub.com
None41b6ab3ba6d20a71766ac245b5a4a94c6fc672a9cd4da7d44c1b33ab8bf6a21c
turbo-cache-controlno-preview
go-importgithub.com/cppmsg/cpp_by_example git https://github.com/cppmsg/cpp_by_example.git
octolytics-dimension-user_id7953680
octolytics-dimension-user_logincppmsg
octolytics-dimension-repository_id697947098
octolytics-dimension-repository_nwocppmsg/cpp_by_example
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forktrue
octolytics-dimension-repository_parent_id697507434
octolytics-dimension-repository_parent_nwograntrostig/cpp_by_example
octolytics-dimension-repository_network_root_id697507434
octolytics-dimension-repository_network_root_nwograntrostig/cpp_by_example
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasee6a744804e8e70f97b4d5a18a94dcc63db22f97a
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/cppmsg/cpp_by_example/issues/2#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcppmsg%2Fcpp_by_example%2Fissues%2F2
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fcppmsg%2Fcpp_by_example%2Fissues%2F2
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=cppmsg%2Fcpp_by_example
Reloadhttps://github.com/cppmsg/cpp_by_example/issues/2
Reloadhttps://github.com/cppmsg/cpp_by_example/issues/2
Reloadhttps://github.com/cppmsg/cpp_by_example/issues/2
Please reload this pagehttps://github.com/cppmsg/cpp_by_example/issues/2
cppmsg https://github.com/cppmsg
cpp_by_examplehttps://github.com/cppmsg/cpp_by_example
grantrostig/cpp_by_examplehttps://github.com/grantrostig/cpp_by_example
Notifications https://github.com/login?return_to=%2Fcppmsg%2Fcpp_by_example
Fork 3 https://github.com/login?return_to=%2Fcppmsg%2Fcpp_by_example
Star 7 https://github.com/login?return_to=%2Fcppmsg%2Fcpp_by_example
Code https://github.com/cppmsg/cpp_by_example
Issues 1 https://github.com/cppmsg/cpp_by_example/issues
Pull requests 0 https://github.com/cppmsg/cpp_by_example/pulls
Discussions https://github.com/cppmsg/cpp_by_example/discussions
Actions https://github.com/cppmsg/cpp_by_example/actions
Projects https://github.com/cppmsg/cpp_by_example/projects
Security and quality 0 https://github.com/cppmsg/cpp_by_example/security
Insights https://github.com/cppmsg/cpp_by_example/pulse
Code https://github.com/cppmsg/cpp_by_example
Issues https://github.com/cppmsg/cpp_by_example/issues
Pull requests https://github.com/cppmsg/cpp_by_example/pulls
Discussions https://github.com/cppmsg/cpp_by_example/discussions
Actions https://github.com/cppmsg/cpp_by_example/actions
Projects https://github.com/cppmsg/cpp_by_example/projects
Security and quality https://github.com/cppmsg/cpp_by_example/security
Insights https://github.com/cppmsg/cpp_by_example/pulse
Basic C++ & Singleton_registry - Suggestions to GrantRostig from an expert.https://github.com/cppmsg/cpp_by_example/issues/2#top
https://github.com/grantrostig
https://github.com/louis-langholtz
https://github.com/grantrostig
grantrostighttps://github.com/grantrostig
on Nov 19, 2023https://github.com/cppmsg/cpp_by_example/issues/2#issue-2000659210
https://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpphttps://github.com/cppmsg/cpp_by_example/blob/master/designp_singleton/singleton_gof_registry.hpp
grantrostighttps://github.com/grantrostig
louis-langholtzhttps://github.com/louis-langholtz
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.