File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -200,6 +200,25 @@ class polystore
200200 return static_cast <T*>(find (BOOST_CORE_TYPEID (T)));
201201 }
202202
203+ /* * Assign the pointer for the object associated with `T`, or `nullptr`.
204+
205+ If no object of type `T` is stored, @p t is set to `nullptr`.
206+
207+ @par Thread Safety
208+ `const` member functions are thread-safe. Non-`const` functions
209+ must not run concurrently with any other member function on the
210+ same instance.
211+
212+ @param t The pointer to assign.
213+ @return `true` if an object of type `T` is present, otherwise `false`.
214+ */
215+ template <class T >
216+ bool find (T*& t) const noexcept
217+ {
218+ t = find<T>();
219+ return t != nullptr ;
220+ }
221+
203222 /* * Return a reference to the object associated with type T
204223
205224 If no such object exists in the container, an exception is thrown.
You can’t perform that action at this time.
0 commit comments