Doesn't compile with VC14 #5

Closed
opened 2016-01-15 12:48:27 -06:00 by terrymah · 6 comments
terrymah commented 2016-01-15 12:48:27 -06:00 (Migrated from github.com)

I get this error just including base64_default_rfc4648.hpp:

Error C2535 'void cppcodec::detail::base64::pad(Result &,ResultState &,std::enable_if<,size_t>::type)': member function already defined or declared

I get this error just including base64_default_rfc4648.hpp: Error C2535 'void cppcodec::detail::base64<CodecVariant>::pad(Result &,ResultState &,std::enable_if<,size_t>::type)': member function already defined or declared
terrymah commented 2016-01-15 12:50:37 -06:00 (Migrated from github.com)

line 137 base64.hpp

line 137 base64.hpp
jpetso commented 2016-01-15 15:21:01 -06:00 (Migrated from github.com)

Thanks for the report. It seems like the enable_if for the pad() function doesn't work in VC14.

I need the enable_if because codec variants with generates_padding() == false might not have a padding_symbol() function, so calling that from pad() would cause an error.

I tried a few variants but getting SFINAE working on this stuff is tricky even without considering MSVC, so I don't have an easy fix at hand. I also lack a Windows/MSVC environment to test this, making it harder to fix.

I might look into possible alternatives on the weekend. Would be neat if VC14 handled this without errors.

Thanks for the report. It seems like the `enable_if` for the `pad()` function doesn't work in VC14. I need the `enable_if` because codec variants with `generates_padding() == false` might not have a `padding_symbol()` function, so calling that from `pad()` would cause an error. I tried a few variants but getting SFINAE working on this stuff is tricky even without considering MSVC, so I don't have an easy fix at hand. I also lack a Windows/MSVC environment to test this, making it harder to fix. I might look into possible alternatives on the weekend. Would be neat if VC14 handled this without errors.
jpetso commented 2016-01-15 15:42:08 -06:00 (Migrated from github.com)

Please try the master branch from https://github.com/jpetso/cppcodec (my fork). It rephrases the existing SFINAE to match the current semantics, but Microsoft having fixed this issue in 2014 suggests that there's a chance it'll work.

Please try the master branch from https://github.com/jpetso/cppcodec (my fork). It rephrases the existing SFINAE to match the current semantics, but Microsoft having fixed [this issue](https://connect.microsoft.com/VisualStudio/feedback/details/872124) in 2014 suggests that there's a chance it'll work.
jpetso commented 2016-01-20 00:44:17 -06:00 (Migrated from github.com)

So I haven't gotten it to work, but on latest master I've rewritten the SFINAE so it uses less enable_if<> and that results in fewer errors. If someone can make the remaining template to work then there shouldn't be anything necessary on top of that.

So I haven't gotten it to work, but on latest master I've rewritten the SFINAE so it uses less `enable_if<>` and that results in fewer errors. If someone can make the remaining template to work then there shouldn't be anything necessary on top of that.
jpetso commented 2016-01-24 20:30:25 -06:00 (Migrated from github.com)

I believe this should be fixed in current master, since my latest commit implemented padding in a different way that doesn't use enable_if. Needs retesting.

I believe this should be fixed in current master, since my latest commit implemented padding in a different way that doesn't use `enable_if`. Needs retesting.
thrimbor commented 2016-08-02 14:02:33 -05:00 (Migrated from github.com)

Unfortunately, it still seems to be broken on VC14. I uploaded the build log here. I tried to fix the problem myself, but my C++ wizardry isn't that good. Trying to build "base32enc" is enough to provoke the error.

The system I tried to build on was:
Windows 10 x64
Visual Studio Community 2015
Version 14.0.25424.00 Update 3

Unfortunately, it still seems to be broken on VC14. I uploaded the build log [here](http://pastebin.com/gJ8zc2Ce). I tried to fix the problem myself, but my C++ wizardry isn't that good. Trying to build "base32enc" is enough to provoke the error. The system I tried to build on was: Windows 10 x64 Visual Studio Community 2015 Version 14.0.25424.00 Update 3
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-tplgy/cppcodec#5
No description provided.