stan-dev / stan-dev/math

get rid of the ::value in include_summand<propto, T1, ..., TN>::value

Open
#1,521 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

code cleanup
Dominant language
C++
Stars
839
Forks
220
Avg merge
2d 4h
Merged PRs (30d)
14

Description

Description

This was suggested by @bob-carpenter in https://github.com/stan-dev/math/pull/1520#issuecomment-565819683:

It would also be nice to get rid of the ::value using the same trick as the standard library uses for enable_if_t with some parameter pack magic for good measure.

template <bool propto, typename ...Ts>
using include_summand_b = include_summand<propto, Ts...>::value;

Then the usage could go from include_summand<propto, T1, ..., TN>::value to
include_summand_v<propto, T1, ..., TN>.

We settled on using _v because the result is a value, rather than the _t for a type in enable_if_t.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by searching the repository for the include_summand definition and all uses of include_summand<...>::value. Apply the requested _v form consistently; done means the old usage has been replaced wherever identified and the project’s relevant C++ checks pass.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.