consteval introduction proposal.
This commit is contained in:
committed by
Matthew Parkinson
parent
f3a9d3a682
commit
15a7e159c0
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user