mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 01:06:45 +08:00
fix: (vs2015) call does not result in a constant expression
This commit is contained in:
parent
e200c49f24
commit
f2ae0f5a3a
@ -457,14 +457,14 @@ struct prod_cons : producer<TransModT, ProdModT>
|
|||||||
, traits<consumer<TransModT, ConsModT>>::header {
|
, traits<consumer<TransModT, ConsModT>>::header {
|
||||||
index_t const circ_size;
|
index_t const circ_size;
|
||||||
|
|
||||||
constexpr header(index_t cs) noexcept
|
header(index_t cs) noexcept
|
||||||
: circ_size(cs) {}
|
: circ_size(cs) {}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
constexpr header(::LIBIMP::span<element<T>> const &elems) noexcept
|
header(::LIBIMP::span<element<T>> const &elems) noexcept
|
||||||
: circ_size(static_cast<index_t>(elems.size())) {}
|
: circ_size(static_cast<index_t>(elems.size())) {}
|
||||||
|
|
||||||
constexpr bool valid() const noexcept {
|
bool valid() const noexcept {
|
||||||
// circ_size must be a power of two.
|
// circ_size must be a power of two.
|
||||||
return (circ_size > 1) && ((circ_size & (circ_size - 1)) == 0);
|
return (circ_size > 1) && ((circ_size & (circ_size - 1)) == 0);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user