Skip to content

refactor: Parameter context#2335

Open
rprospero wants to merge 4 commits intodevelop2from
parameter_context
Open

refactor: Parameter context#2335
rprospero wants to merge 4 commits intodevelop2from
parameter_context

Conversation

@rprospero
Copy link
Contributor

Allows types to define a context type. Declaring the parameter then requires that the context be passed in, if and only if there is a context.

I went with std::monostate for two reasons. First, it's the "official" type of empty data. As such, it includes such niceties as default and copy constructors. Secondly, as the official empty data type, it will take up zero bytes the moment that that is possible. It also gives the compiler the best opportunity to optimise out the context call in the parameter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant