Skip to content
Snippets Groups Projects

Add utility IsCompileTimeConstant and use it in HybridFunctor

Merged Simon Praetorius requested to merge issue/hybrid-functor-for-compiletime-constants into master
All threads resolved!

Summary

The type-trait IsIntegralConstant checks exactly for a type std::integral_constant<T,value> but does not allow any derived classes or user-defined classes with the same interface. Example of such compile-time constant is std::is_same<S,T>.

The new utility is directly used to implement HybridFunctor to allow a wider range of compiler-time input.

Merge request reports

Pipeline #60373 passed

Pipeline: Dune Nightly Test

#60375

    Pipeline passed for c733f723 on issue/hybrid-functor-for-compiletime-constants

    Merged by Simon PraetoriusSimon Praetorius 2 years ago (Feb 28, 2023 4:51pm UTC)

    Loading

    Pipeline #60675 passed

    Pipeline: Dune Nightly Test

    #60678

      Pipeline passed for 364d0fd4 on master

      Activity

      Filter activity
      • Approvals
      • Assignees & reviewers
      • Comments (from bots)
      • Comments (from users)
      • Commits & branches
      • Edits
      • Labels
      • Lock status
      • Mentions
      • Merge request status
      • Tracking
    • added 1 commit

      • a13521d2 - Check constexpr property of members in IsCompileTimeConstant

      Compare with previous version

    • Simon Praetorius resolved all threads

      resolved all threads

      • Resolved by Simon Praetorius

        I'm happy with this as is. But out of curiosity: Is there any application where you have something that looks like an std::integral_constant but is not derived from one? If not, we may simply check for the latter instead of introducing a new concept.

    • added 1 commit

      • 86c32edb - Check for derived from integral_constant

      Compare with previous version

    • Simon Praetorius added 3 commits

      added 3 commits

      • ed9417c7 - Add utility IsCompileTimeConstant and use it in HybridFunctor
      • 129c7ead - add test for IsCompileTimeConstant
      • c733f723 - Add changelog entry

      Compare with previous version

    • Simon Praetorius resolved all threads

      resolved all threads

    • mentioned in commit 364d0fd4

    • Please register or sign in to reply
      Loading