Skip to content

Commit

Permalink
odb dbStream: adding an error message to the template recursion limit
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <fgaray@google.com>
  • Loading branch information
fgaray committed Jan 5, 2024
1 parent 1ddb4c1 commit 5a1acf4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/odb/include/odb/dbStream.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class dbOStream
template <size_t I = 0, typename... Ts>
constexpr dbOStream& operator<<(const std::tuple<Ts...>& tup)
{
static_assert(I < kTemplateRecursionLimit);
static_assert(I <= kTemplateRecursionLimit, "OpenROAD disallows of std::variants larger than 16 elements. You should look into alternate solutions");
if constexpr (I == sizeof...(Ts)) {
return *this;
} else {
Expand Down Expand Up @@ -229,7 +229,7 @@ class dbOStream
template <uint32_t I = 0, typename... Ts>
dbOStream& operator<<(const std::variant<Ts...>& v)
{
static_assert(I < kTemplateRecursionLimit);
static_assert(I <= kTemplateRecursionLimit, "OpenROAD disallows of std::variants larger than 16 elements. You should look into alternate solutions");
if constexpr (I == sizeof...(Ts)) {
return *this;
} else {
Expand Down Expand Up @@ -400,7 +400,7 @@ class dbIStream
template <size_t I = 0, typename... Ts>
constexpr dbIStream& operator>>(std::tuple<Ts...>& tup)
{
static_assert(I < kTemplateRecursionLimit);
static_assert(I <= kTemplateRecursionLimit, "OpenROAD disallows of std::variants larger than 16 elements. You should look into alternate solutions");
if constexpr (I == sizeof...(Ts)) {
return *this;
} else {
Expand Down Expand Up @@ -434,7 +434,7 @@ class dbIStream
template <uint32_t I = 0, typename... Ts>
dbIStream& variantHelper(uint32_t index, std::variant<Ts...>& v)
{
static_assert(I < kTemplateRecursionLimit);
static_assert(I <= kTemplateRecursionLimit, "OpenROAD disallows of std::variants larger than 16 elements. You should look into alternate solutions");
if constexpr (I == sizeof...(Ts)) {
return *this;
} else {
Expand Down

0 comments on commit 5a1acf4

Please sign in to comment.