Making overload_t's copy constructor have priority#413
Making overload_t's copy constructor have priority#413DarthRubik wants to merge 2 commits intoboostorg:developfrom
Conversation
So currently the copy constructor for the overload_t does not take
precendent over the other templated constructor. This means a simple
function like the following fails:
void foo()
{
auto a = hana::overload(f1,f2);
auto b(a); //Error
}
To fix this I added a enable_if to turn off the constructor when not
applicable.........
|
I am not quite sure why the automated builds failed......(I don't have much experience with appveyor or travis-ci).....when I did a local make check nothing failed........does someone have a clue as to what is going on here? |
|
It looks like it is detecting trailing white-space. I remember the error message for that being a little better. (err it actually had an error message for that at one time) The Appveyor build failure looks like a config issue with MSVC. |
I am new to this project, and did not realize that I needed to get rid of trailing white space...but know I have removed the offending space.....
ldionne
left a comment
There was a problem hiding this comment.
Looks good to me, with cosmetic changes. Also, please squash the two commits into one to avoid noise in the history.
| @@ -0,0 +1,17 @@ | |||
| #include "boost/hana.hpp" | |||
There was a problem hiding this comment.
We use <> to include Hana's headers in the tests. Also, we try to include the most specific header. #include <boost/hana/functional/overload.hpp>
| template <typename F_, typename ...G_> | ||
| template <typename F_, typename ...G_, | ||
| typename = std::enable_if_t< | ||
| !std::is_same<overload_t,std::decay_t<F_>>::value |
There was a problem hiding this comment.
Nitpick: Please add a space between overload_t and std::decay_t<F_>.
So currently the copy constructor for the overload_t does not take
precendent over the other templated constructor. This means a simple
function like the following fails:
To fix this I added a enable_if to turn off the constructor when not
applicable.........
Note: This (allegedly) fixes issue 412