Skip to content

Consistent return type for size() #2760

Description

@andrjohns

Description

As mentioned in #2641, the math::size() overloads should have a return type consistent with Eigen's size() member to avoid compiler errors when calling code such as:

  Eigen::VectorXd a(2);
  a << 1, 2;

  std::max(a.size(), stan::math::size(a));

Which resolves to:

std::max(size_t, Eigen::Index);

Current Version:

v4.4.0

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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