Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpp/python: flag to force generation of static methods #23

Open
wants to merge 1 commit into
base: continious-integration
Choose a base branch
from

Conversation

ftynse
Copy link
Member

@ftynse ftynse commented Sep 27, 2017

Introduce the __isl_ensure_static macro that forces the generators to make the
method static if it would otherwise be an instance member function.

This macro is primarily intended for static constructors of an object from
another object of the same type, which are present in sets and spaces. Marking
such methods as constructors would interfere with standard copy construction.
Exporting them directly masks the fact of construction and is inconsistent with
other static methods serving as named constructors. Consider readbility of

isl::set s = isl::set::from_params(another_set);

enabled by this macro against

isl::set s = another_set.from_params();

Closes #22

Introduce the __isl_ensure_static macro that forces the generators to make the
method static if it would otherwise be an instance member function.

This macro is primarily intended for static constructors of an object from
another object of the same type, which are present in sets and spaces. Marking
such methods as constructors would interfere with standard copy construction.
Exporting them directly masks the fact of construction and is inconsistent with
other static methods serving as named constructors. Consider readbility of

	isl::set s = isl::set::from_params(another_set);

enabled by this macro against

	isl::set s = another_set.from_params();

Signed-off-by: Oleksandr Zinenko <[email protected]>
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