cpp-proposals-pub
cpp-proposals-pub copied to clipboard
LayoutMapping requirements should constrain `is_always_*()` to be `constexpr`
This is because the primary use case is for constraining algorithms. For instance, the following should be prohibited:
extern bool foo;
struct _my_mapping {
/* ... */
static bool is_always_contiguous() { return foo; }
};
I think the way we should do this is to say in the table that the expression that needs to be valid is std::bool_constant<M::is_always_contiguous()>{}
Agreed.