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

vs2015: class template has already been defined #3

Open
TrianglesPCT opened this issue Jan 19, 2017 · 0 comments
Open

vs2015: class template has already been defined #3

TrianglesPCT opened this issue Jan 19, 2017 · 0 comments

Comments

@TrianglesPCT
Copy link

TrianglesPCT commented Jan 19, 2017

I tried to use this library on a custom type, but it always fails to compile with the listed error.

Here is my radix sort key function:

uint64_t to_radix_sort_key(const Command & c){
return c.Key().FullKey();
}

And the call to ska_sort

ska_sort(commands.begin(), commands.end());

And full error:

ska_sort.hpp(1017): error C2953: 'detail::FallbackSubKey<T,std::enable_if<!std::is_same<void,unknown-type>::value,void>::type>': class template has already been defined
ska_sort.hpp(846): note: see declaration of 'detail::FallbackSubKey<T,std::enable_if<!std::is_same<void,unknown-type>::value,void>::type>'

If I remove one of these overloads, it does compile, but I see no speedup over std::sort, in fact they appear to have the same runtime so I suspect it is falling back to std::sort.

EDIT: I just tried sorting other data, such as a std::vector<uint32_t>, which I would think would not require a custom sort, and it produces the exact same error.

Rather baffled as to how anyone is using this library, is this a VS2015 specific error?

I tried benchmarking ska_sort with various types(u32,float,u64) and I am not seeing any speed up, it always runs in the same time as std::sort, I believe there may be some issue with how this library works in VS2015(possibly caused by the fact that I had to comment out one of those overloads to get anything to compile).

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

No branches or pull requests

1 participant