tqchen commented on a change in pull request #9748:
URL: https://github.com/apache/tvm/pull/9748#discussion_r805954346
##########
File path: include/tvm/runtime/container/optional.h
##########
@@ -93,6 +93,11 @@ class Optional : public ObjectRef {
ICHECK(data_ != nullptr);
return T(data_);
}
+ /*!
+ * \return The internal object pointer with container type of T.
+ * \note This function do not perform not-null checking.
+ */
+ const ContainerType* get() const { return
static_cast<ContainerType*>(data_.get()); }
Review comment:
Note that get is not a standard API as per stl style for Optional. While
`get` is a standard stl style name. We might want to have a longer name in this
case.
How about `GetContainerPtr`(use CamelCase to indicate that it is not STL
compatible).
The comment can be updated to explain the behavior of nullopt case(return
nullptr) and non-nullopt case(returns the container ptr)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]