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

linq.hpp not compiling in macOS #390

Closed
ivanleapfactor opened this issue Jul 21, 2017 · 3 comments
Closed

linq.hpp not compiling in macOS #390

ivanleapfactor opened this issue Jul 21, 2017 · 3 comments

Comments

@ivanleapfactor
Copy link

ivanleapfactor commented Jul 21, 2017

Hi
In a simple source file like this:

#include <cpplinq/linq.hpp>

using namespace cpplinq;

// no more code...

===========================

I get the following errors:

===========================

In file included from project/dashlitics_service.cpp:27:
linq.hpp:474:39: error: expected a qualified name after 'typename'
template
^
linq.hpp:480:14: error: expected a qualified name after 'typename'
typename element_type sum(typename element_type seed) const {
^
linq.hpp:480:40: error: expected a qualified name after 'typename'
typename element_type sum(typename element_type seed) const {
^
linq.hpp:484:85: error: expected a qualified name after 'typename'
template <typename Selector, typename Result = std::result_of<Selector(typename element_type)>::type>
^
linq.hpp:484:85: error: expected a qualified name after 'typename'
linq.hpp:484:52: error: missing 'typename' prior to dependent type name 'std::result_of<Selector (element_type)>::type'
template <typename Selector, typename Result = std::result_of<Selector(typename element_type)>::type>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
typename
linq.hpp:489:85: error: expected a qualified name after 'typename'
template <typename Selector, typename Result = std::result_of<Selector(typename element_type)>::type>
^
linq.hpp:489:85: error: expected a qualified name after 'typename'
linq.hpp:489:52: error: missing 'typename' prior to dependent type name 'std::result_of<Selector (element_type)>::type'
template <typename Selector, typename Result = std::result_of<Selector(typename element_type)>::type>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
typename
9 errors generated.

========================

using macOS Sierra 10.12.5 with Xcode Version 8.3.3 (8E3004b):
$ clang --version
Apple LLVM version 8.1.0 (clang-802.0.42)
Target: x86_64-apple-darwin16.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

Awesome library, I am looking forward to use it, so if there are any clues you can provide to me, those will be greatly appreciated!

Ivan.

@kirkshoop
Copy link
Member

Thanks! Have you looked at range-v3? This is going to be the official approach in C++ for linq.

This appears to be a repeated pattern in the code that is not standards compliant.

For instance

typename Result = std::result_of<Selector(typename element_type)>::type

should be

typename Result = typename std::result_of<Selector(typename element_type)>::type

someone would need to take a pass over the source making these simple changes. PR's are welcome!

I do not have linq included in the CI for this project. That would make it much more likely to compile :)

@ivanmejiarocha
Copy link

Hi,
Thanks a lot for your response, I'll take a look to the code on Ix project for those changes you suggested. In regard to range-v3, yes I've read something about it but still not deeply so I'll take a serious look to it per your suggestion.

Ivan.

yatli pushed a commit to yatli/RxCpp that referenced this issue Aug 6, 2018
@yatli
Copy link

yatli commented Aug 6, 2018

made some quick changes, submitting a PR now.
note, I just make sure SampleCppLinq could compile. Uncovered features could be still broken.

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

4 participants