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

added boolinq::mut_from and modified for each to be able to mutate #67

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

LennardR
Copy link

Currently compiles only with MSVC!

Propeses a Solution for #55 by introducing a mut_from function.

To enable the normal from function to be able to create mutable Linq Objects would require extensive reworking of existing code.

@k06a
Copy link
Owner

k06a commented Jan 31, 2022

@LennardR could you restore updated formatting to keep changes more focused?

@LennardR
Copy link
Author

Yeah, don't know how that happend.

@@ -32,6 +32,7 @@ namespace boolinq {
//

struct LinqEndException {};
struct LinqNonMutableException {};
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why can't utilize the same LinqEndException exception for this mutable case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can utilize the same exception. You can remove the LinqNonMutableException completely.
But for Debugging and using the Lib I think it is cleaner to have a dedicated Exception.

@k06a
Copy link
Owner

k06a commented Feb 11, 2022

I see compilation error on GCC and Clang is that you use function template param T while the class has same template name T: https://app.travis-ci.com/github/k06a/boolinq/jobs/558567721#L631-L641

In file included from /home/travis/build/k06a/boolinq/test/AllTest.cpp:6:0:
[632]()/home/travis/build/k06a/boolinq/include/boolinq/boolinq.h:111:18: error: declaration of ‘class T’
[633]()         template<typename T,
[634]()                  ^
[635]()In file included from /home/travis/build/k06a/boolinq/test/AllTest.cpp:6:0:
[636]()/home/travis/build/k06a/boolinq/include/boolinq/boolinq.h:47:26: error:  shadows template parm ‘class T’
[637]()     template<typename S, typename T>
[638]()                          ^
[639]()In file included from /home/travis/build/k06a/boolinq/test/AllTest.cpp:6:0:
[640]()/home/travis/build/k06a/boolinq/include/boolinq/boolinq.h:112:82: error: expected ‘>’ before ‘=’ token
[641]()   typename = std::enable_if < std::is_lvalue_reference<T>::value,bool> = false>

Try to rename the template parameter name to something else.

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.

2 participants