operand::Set and operation::Set have hardcoded uint32_t and assertion,
which is based on wrong assumption that Index is always uint32_t.
This patch replaces uint32_t with Index.
Signed-off-by: Sanggyu Lee <sg5.lee@samsung.com>
bool operator!=(T o) const { return !(*this == o); }
bool operator!=(const Index &o) const { return !(*this == o); }
+ Index operator++(int)
+ {
+ Index temp = *this;
+ _index++;
+ return temp;
+ }
+
bool valid() const { return _index != UNDEFINED; }
T value() const { return _index; }
private:
std::unordered_map<Index, std::unique_ptr<Object>> _objects;
- uint32_t _index_count;
+ Index _index_count;
};
} // namespace operand
private:
std::unordered_map<Index, std::unique_ptr<Node>> _nodes;
- uint32_t _index_count;
+ Index _index_count;
};
} // namespace operation
const Index Set::generateIndex()
{
- assert((_index_count) <= 0x7fffffff);
+ assert(_index_count.valid());
- return Index{_index_count++};
+ return _index_count++;
}
Index Set::append(const Shape &shape, const TypeInfo &type)
const Index Set::generateIndex()
{
- assert((_index_count) <= 0x7fffffff);
+ assert(_index_count.valid());
- return Index{_index_count++};
+ return _index_count++;
}
Index Set::append(std::unique_ptr<Node> &&node)