This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/84403] New: Possible further extension of constexpr: allow to use them as template parameters
- From: "bugzilla at poradnik-webmastera dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 15 Feb 2018 09:45:57 +0000
- Subject: [Bug c++/84403] New: Possible further extension of constexpr: allow to use them as template parameters
- Auto-submitted: auto-generated
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;
}