LinkedList: Move nonnull_or_empty_option to Option.h so everyone can use it
This commit is contained in:
parent
28f53f9ccf
commit
973e39a255
@ -2,13 +2,6 @@
|
||||
#include <luna/Option.h>
|
||||
#include <luna/TypeTraits.h>
|
||||
|
||||
template <typename T> inline Option<T*> nonnull_or_empty_option(T* ptr)
|
||||
{
|
||||
if (ptr == nullptr) return {};
|
||||
else
|
||||
return ptr;
|
||||
}
|
||||
|
||||
template <typename T> class LinkedList;
|
||||
|
||||
template <typename T> class LinkedListNode
|
||||
|
@ -143,3 +143,10 @@ template <typename T> class Option
|
||||
Storage m_storage;
|
||||
bool m_has_value { false };
|
||||
};
|
||||
|
||||
template <typename T> inline Option<T*> nonnull_or_empty_option(T* ptr)
|
||||
{
|
||||
if (ptr == nullptr) return {};
|
||||
else
|
||||
return ptr;
|
||||
}
|
Loading…
Reference in New Issue
Block a user