isapego commented on a change in pull request #9713:
URL: https://github.com/apache/ignite/pull/9713#discussion_r781349835



##########
File path: modules/platforms/cpp/common/include/ignite/future.h
##########
@@ -279,6 +279,130 @@ namespace ignite
         /** Shared state. */
         common::concurrent::SharedPointer< common::SharedState<ValueType> > 
state;
     };
+
+    /**
+     * Specialization for shared pointer.
+     */
+    template<typename T>
+    class Future< common::concurrent::SharedPointer<T> >
+    {
+        friend class common::Promise< common::concurrent::SharedPointer<T> >;
+
+    public:
+        /** Template value type */
+        typedef T ValueType;
+
+        /** Template value type shared pointer */
+        typedef common::concurrent::SharedPointer<ValueType> SP_ValueType;
+
+        /**
+         * Copy constructor.
+         *
+         * @param src Instance to copy.
+         */
+        Future(const Future<SP_ValueType>& src) :
+            state(src.state)
+        {
+            // No-op.
+        }
+
+        /**
+         * Assignment operator.
+         *
+         * @param other Other instance.
+         * @return *this.
+         */
+        Future& operator=(const Future<SP_ValueType>& other)
+        {
+            state = other.state;
+
+            return *this;
+        }
+
+        /**
+         * Wait for value to be set.
+         * Active thread will be blocked until value or error will be set.
+         */
+        void Wait() const
+        {
+            const common::SharedState<SP_ValueType>* state0 = state.Get();
+
+            assert(state0 != 0);

Review comment:
       In C++ standard there is no `NULL` - this is C constant, in C++03 and 
below simple 0 constant is used, when not used with C API.




-- 
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]


Reply via email to