Skip to content

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

Open
LennardR wants to merge 2 commits into
k06a:masterfrom
LennardR:master
Open

added boolinq::mut_from and modified for each to be able to mutate#67
LennardR wants to merge 2 commits into
k06a:masterfrom
LennardR:master

Conversation

@LennardR
Copy link
Copy Markdown

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
Copy Markdown
Owner

k06a commented Jan 31, 2022

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

@LennardR
Copy link
Copy Markdown
Author

Yeah, don't know how that happend.

Comment thread include/boolinq/boolinq.h
//

struct LinqEndException {};
struct LinqNonMutableException {};
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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