consteval introduction proposal.

This commit is contained in:
David Carlier
2021-05-02 11:32:47 +01:00
committed by Matthew Parkinson
parent f3a9d3a682
commit 15a7e159c0
2 changed files with 8 additions and 2 deletions

View File

@@ -28,6 +28,12 @@
# define SNMALLOC_CONSTINIT_STATIC constexpr
#endif
#if defined(__cpp_consteval)
# define SNMALLOC_CONSTEVAL consteval
#else
# define SNMALLOC_CONSTEVAL constexpr
#endif
#if !defined(__clang__) && defined(__GNUC__)
# define GCC_NOT_CLANG
#endif

View File

@@ -59,7 +59,7 @@ namespace snmalloc
* annotation.
*/
template<capptr_bounds B>
constexpr capptr_bounds capptr_export_type()
SNMALLOC_CONSTEVAL capptr_bounds capptr_export_type()
{
static_assert(
(B == CBChunk) || (B == CBAlloc), "capptr_export_type of bad type");
@@ -74,7 +74,7 @@ namespace snmalloc
}
template<capptr_bounds BI, capptr_bounds BO>
constexpr bool capptr_is_bounds_refinement()
SNMALLOC_CONSTEVAL bool capptr_is_bounds_refinement()
{
switch (BI)
{