Skip to content

Add user-defined literal to represent index_constants

Simon Praetorius requested to merge feature/integral-constant-literal into master

Summary

This MR adds user-defined literals _ic, _uc and _sc to create std::size_t/unsigned int/signed int integral constants.

Example

using Dune::Indices::Literals;
static_assert(_5 == 5_uc); // unsigned pre-defined constant vs. literal
static_assert(_27 == 27_ic); // index pre-defined constant vs. literal

auto i = -123_sc;
static_assert(decltype(i)::value == -123); // the generated constant is an integral_constant
Edited by Simon Praetorius

Merge request reports

Loading