This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/84403] New: Possible further extension of constexpr: allow to use them as template parameters


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84403

            Bug ID: 84403
           Summary: Possible further extension of constexpr: allow to use
                    them as template parameters
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: bugzilla@poradnik-webmastera.com
  Target Milestone: ---

Values in constexpr functions are known at compile time, so theoretically they
could be used as template parameters like in example below. Please consider
proposing this and implementing for some future version of C++ standard.


#include <type_traits>

constexpr int test(int n)
{
    return std::integral_constant<int, n>::value;
}

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]