You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I use boost::callable_traits::is_invocable with fu2::unique_function on msvc v19.33 or older, I got C2248 (cannot access private member) error.
When I replace boost::callable_traits::is_invocable with std::is_invocable (since C++17), then the error is disappeared.
#include<function2/function2.hpp>
#include<boost/callable_traits.hpp>
#include<type_traits>usingunique_func_t = fu2::unique_function<void()>;
intmain() {
// no error with std::is_invocablestatic_assert(std::is_invocable<unique_func_t>::value);
// error C2248 with boost::callable_traits::is_invocablestatic_assert(boost::callable_traits::is_invocable<unique_func_t>::value);
}
The issue happens the combination of boost::callable_traits::is_invocable, fu2::unique_function, and msvc v19.33 or older.
It is complecated for me but fortunately, we can reproduce the issue on godbolt.