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

Add proposal validation for method chaining. #50

Open
madhur-tandon opened this issue Jul 21, 2020 · 3 comments
Open

Add proposal validation for method chaining. #50

madhur-tandon opened this issue Jul 21, 2020 · 3 comments

Comments

@madhur-tandon
Copy link

When using XEITHER_OPTIONAL or XEITHER to limit valid values, the validation check doesn't happen when initialising a variable using Method Chaining.

@SylvainCorlay
Copy link
Member

SylvainCorlay commented Jul 21, 2020

In https://github.com/jupyter-xeus/xproperty/blob/master/include/xproperty/xproperty.hpp#L182-L194

We could try replacing m_value = arg; and m_value = std::move(arg); with

m_value = owner()->template invoke_validators<T>(m_name, arg);

and

m_value = owner()->template invoke_validators<T>(m_name, std::move(arg));

respectively, and add a test.

@SylvainCorlay
Copy link
Member

Do you want to give it a shot @madhur-tandon?

@madhur-tandon
Copy link
Author

Was going to ask :)
I will give it a shot after completing a few things for Mark in the other project.

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

No branches or pull requests

2 participants