Title: in_place_init & friends could be constexpr to enforce constant initialization · Issue #103 · boostorg/optional · GitHub
Open Graph Title: in_place_init & friends could be constexpr to enforce constant initialization · Issue #103 · boostorg/optional
X Title: in_place_init & friends could be constexpr to enforce constant initialization · Issue #103 · boostorg/optional
Description: In https://github.com/boostorg/optional/blob/develop/include/boost/optional/optional.hpp#L93-L106, we have: struct in_place_init_t { struct init_tag{}; explicit in_place_init_t(init_tag){} }; const in_place_init_t in_place_init ((in_plac...
Open Graph Description: In https://github.com/boostorg/optional/blob/develop/include/boost/optional/optional.hpp#L93-L106, we have: struct in_place_init_t { struct init_tag{}; explicit in_place_init_t(init_tag){} }; const...
X Description: In https://github.com/boostorg/optional/blob/develop/include/boost/optional/optional.hpp#L93-L106, we have: struct in_place_init_t { struct init_tag{}; explicit in_place_init_t(init_tag){} }; const...
Opengraph URL: https://github.com/boostorg/optional/issues/103
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"in_place_init \u0026 friends could be constexpr to enforce constant initialization","articleBody":"In https://github.com/boostorg/optional/blob/develop/include/boost/optional/optional.hpp#L93-L106, we have:\r\n\r\n```\r\nstruct in_place_init_t\r\n{\r\n struct init_tag{};\r\n explicit in_place_init_t(init_tag){}\r\n};\r\nconst in_place_init_t in_place_init ((in_place_init_t::init_tag()));\r\n\r\nstruct in_place_init_if_t\r\n{\r\n struct init_tag{};\r\n explicit in_place_init_if_t(init_tag){}\r\n};\r\nconst in_place_init_if_t in_place_init_if ((in_place_init_if_t::init_tag()));\r\n```\r\n\r\nThis results in static initializers in binaries (although trivial ones). Instead, it should be valid to change their definition to the following, which would definitely get rid of static initializers in \u003e= C++11:\r\n\r\n```\r\nstruct in_place_init_t\r\n{\r\n struct init_tag{};\r\n BOOST_CONSTEXPR explicit in_place_init_t(init_tag){}\r\n};\r\nBOOST_CONSTEXPR_OR_CONST in_place_init_t in_place_init ((in_place_init_t::init_tag()));\r\n\r\nstruct in_place_init_if_t\r\n{\r\n struct init_tag{};\r\n BOOST_CONSTEXPR explicit in_place_init_if_t(init_tag){}\r\n};\r\nBOOST_CONSTEXPR_OR_CONST in_place_init_if_t in_place_init_if ((in_place_init_if_t::init_tag()));\r\n```\r\n","author":{"url":"https://github.com/ldionne","@type":"Person","name":"ldionne"},"datePublished":"2022-08-08T21:25:24.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/103/optional/issues/103"}
| 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:1a7db595-cc07-d974-5d07-5de06e5b17e6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D73A:D3DF1:1711A9:204BA3:6981F076 |
| html-safe-nonce | 96e874ffc979bcce346bc2d03545d9651fefcb587a1c2fe30b17ea573371f5f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENzNBOkQzREYxOjE3MTFBOToyMDRCQTM6Njk4MUYwNzYiLCJ2aXNpdG9yX2lkIjoiNDEzODA2NDMzODQ5MTY2NjU1MCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 9c24807cda9239b277999297d83e705e6a34a73dea30cb8513f1e4cd05354b7e |
| hovercard-subject-tag | issue:1332415790 |
| 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/boostorg/optional/103/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6e086b4ff58f078727603c9b6e36754208bca6ce56c89a20a77a5a8b1301dd22/boostorg/optional/issues/103 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6e086b4ff58f078727603c9b6e36754208bca6ce56c89a20a77a5a8b1301dd22/boostorg/optional/issues/103 |
| og:image:alt | In https://github.com/boostorg/optional/blob/develop/include/boost/optional/optional.hpp#L93-L106, we have: struct in_place_init_t { struct init_tag{}; explicit in_place_init_t(init_tag){} }; const... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ldionne |
| hostname | github.com |
| expected-hostname | github.com |
| None | ebfdf8d3e0fd17b103f41cc6696d84938694ebebdfecaf11fe00dbe4a9785801 |
| turbo-cache-control | no-preview |
| go-import | github.com/boostorg/optional git https://github.com/boostorg/optional.git |
| octolytics-dimension-user_id | 3170529 |
| octolytics-dimension-user_login | boostorg |
| octolytics-dimension-repository_id | 7589934 |
| octolytics-dimension-repository_nwo | boostorg/optional |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 7589934 |
| octolytics-dimension-repository_network_root_nwo | boostorg/optional |
| 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 | ac4541b58a15c144d6ed4fc868b9ea4bb99bb4b6 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width