Skip to content
Snippets Groups Projects

void_t, real_t, field_t in dune/common/typetraits.hh

Merged Lars Lubkoll requested to merge lars.lubkoll/dune-common:feature/void_t into master

Contains:

  • void_t (+voider)

  • template <class T> using field_t = typename FieldTraits::field_type;

  • template <class T> using real_t = typename FieldTraits::real_type;

Requires C++11.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 531 531
    532 532 #endif // defined(DOXYGEN) or HAVE_IS_INDEXABLE_SUPPORT
    533 533
    534 namespace detail
    535 {
    536 /// @internal
    537 /// helper to make void_t work with gcc
    538 template <class...>
    539 struct voider
    540 {
    541 using type = void;
    542 };
    • This is not needed due to gcc but due to a language defect in C++11 which allows to ignore unused template arguments for type substitution in template aliases. It would be nice to explain this in the comments to make clear why

      template<class... Type>
      using void_t = void;

      alone may not work.

    • Author Contributor

      Yes you are right, my comment is misleading. I will provide a better one.

  • Lars Lubkoll Added 1 commit:

    Added 1 commit:

    • 93f16b5e - Cleaned up field_t, real_t, improved comment for voider
  • Lars Lubkoll Added 1 commit:

    Added 1 commit:

    • 72cdaf37 - added references to the documentation of void_t
  • mentioned in commit 4420871a

  • Christian Engwer Status changed to merged

    Status changed to merged

  • Mentioned in commit 4420871a

  • Please register or sign in to reply
    Loading