Skip to content

Consistent return type for size() #2760

@andrjohns

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions