-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Description
Since Boost 1.71 following code fails to compile on VS 2017 - default type is chosen instead of passed one and static assert fires.
#include <boost/parameter/parameters.hpp>
#include <boost/parameter/name.hpp>
BOOST_PARAMETER_TEMPLATE_KEYWORD(type_param)
BOOST_PARAMETER_TEMPLATE_KEYWORD(another_type_param)
class A {};
class B {};
class C {};
template<class... Args>
class CheckParams {
public:
typedef typename boost::parameter::parameters<
boost::parameter::optional<tag::type_param>
>::bind<Args...>::type args;
typedef typename boost::parameter::value_type<args, tag::type_param,
B>::type basic_shapes_policy;
CheckParams() {
static_assert(std::is_same<basic_shapes_policy, A>::value, "");
}
};
void test() {
CheckParams<
another_type_param<C>,
type_param<A>
> instance;
}
prudhomm and urandon
Metadata
Metadata
Assignees
Labels
No labels