Introduce static indices _0, _1, _2 as shortcuts for std::integral_constant<std::size_t,0> etc.
These indices have existed in dune-typetree for a while. They are already used extensively in dune-typetree and dune-functions, and they also make working with MultiTypeBlockVector/Matrix from dune-istl much nicer. They work very much like std::placeholders:_1, std::placeholders::_2, etc. We would have like to use that, but there is no std::placeholders_0.
This patch also introduces
template<std::size_t i>
using index_constant = std::integral_constant<std::size_t, i>;
which helps decrease code verbosity a little bit.
Merge request reports
Activity
Added 13 commits:
- b8e93a09...0d2a9d42 - 9 commits from branch
master
- 2d56637e - Rename indicestest.cc to remoteindicestest.cc
- 6cae75f0 - Introduce static indices _0, _1, _2 as shortcuts for std::integral_constantstd::size_t,0 etc.
- db0497d5 - Add unit test for the new static indices
- 9d376cb6 - Remove accidentally added include from typetree
Toggle commit list- b8e93a09...0d2a9d42 - 9 commits from branch
Added 1 commit:
- 9159760f - [cleanup] Strip down includes to the minimum
mentioned in commit 88cfef67
Mentioned in commit 88cfef67
Please register or sign in to reply