Skip to content

Named template parameters are completely broken in Boost 1.71 #91

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;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions