-
Notifications
You must be signed in to change notification settings - Fork 468
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
SFINAE fix to remove third argument in toXmlElementHelper() #490
base: feature_state_serialization
Are you sure you want to change the base?
SFINAE fix to remove third argument in toXmlElementHelper() #490
Conversation
On travis, gcc gives a compiler error. @klshrinidhi says that later versions of gcc can compile this branch. |
I locally compiled and tested on gcc-5. |
Cool! But how does this prioritize the member function over the free function if both exist? |
Oh, wait -- I'm just being slow. I get it. The free function isn't even there if the member function exists! |
It did not compile with the gcc version you have. It is probably a feature they added in a later version. Up to you to decide what to do with this PR. |
I tested this PR with gcc 5.3.0 and it worked. It does not compile with gcc 4.9.3. I did not try any versions between these two. |
I'm sure there is a way to get the same idea to work in 4.9 with a little hacking around; I suspect it is just the |
@sherm1 it seems you may be right. See stackoverflow, which says:
|
@sherm1 @klshrinidhi I pushed the fix from stackoverflow. Thanks @sherm1 for the tip. I think we should probably move |
@sherm1 if you agree the |
Note: this fix is also mentioned here: http://en.cppreference.com/w/cpp/types/void_t:
I like |
I'm skeptical about adding void_t at all since it will be standardized in C++17 I think. Do we really need it? |
I don't really understand the SFINAE stuff completely. My plan was to only define |
That could work. I doubt we need void_t though. |
This PR is to go into #488.