Closed eseiler closed 1 year ago
As constexpr is a best effort declaration in the sense that in doubt it won't compile, we could simply declare it constexpr without any macros.
As constexpr is a best effort declaration in the sense that in doubt it won't compile, we could simply declare it constexpr without any macros.
But the function body still needs to be a valid, (possibly) constant expression. And because we construct the vector inside the literal, it doesn't work.
Thank you, I thought it would just work, but you right :(
The only thing I want to add is that we should also add
constexpr
toif the compiler supports
constexpr std::vector
.But this should be another PR in any case.
Originally posted by @eseiler in https://github.com/seqan/seqan3/issues/2819#issuecomment-925592163
@eseiler Good point!
Originally posted by @marehr in https://github.com/seqan/seqan3/issues/2819#issuecomment-925598614
We could probably do something like this
However, only MSVC implements
constexpr
forstd::vector
.https://godbolt.org/z/EKGxYnEas
Originally posted by @eseiler in https://github.com/seqan/seqan3/issues/2819#issuecomment-925619276