Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
54
Src/nu/Alias.h
Normal file
54
Src/nu/Alias.h
Normal file
|
@ -0,0 +1,54 @@
|
|||
#ifndef NULLSOFT_UTILITY_ALIASH
|
||||
#define NULLSOFT_UTILITY_ALIASH
|
||||
|
||||
template <class ptr_t>
|
||||
class Alias
|
||||
{
|
||||
public:
|
||||
Alias()
|
||||
:pointer(0)
|
||||
{
|
||||
}
|
||||
Alias(ptr_t *_pointer) : pointer(_pointer)
|
||||
{
|
||||
}
|
||||
Alias(const Alias<ptr_t> ©)
|
||||
{
|
||||
pointer=copy.pointer;
|
||||
}
|
||||
~Alias()
|
||||
{
|
||||
pointer=0;
|
||||
}
|
||||
ptr_t *operator = (ptr_t *copy)
|
||||
{
|
||||
pointer=copy;
|
||||
return copy;
|
||||
}
|
||||
|
||||
ptr_t *operator ->()
|
||||
{
|
||||
return pointer;
|
||||
}
|
||||
|
||||
operator bool()
|
||||
{
|
||||
return !!pointer;
|
||||
}
|
||||
|
||||
bool operator == (ptr_t *compare)
|
||||
{
|
||||
return pointer == compare;
|
||||
}
|
||||
/*
|
||||
operator ptr_t *()
|
||||
{
|
||||
return pointer;
|
||||
}
|
||||
*/
|
||||
|
||||
private:
|
||||
ptr_t *pointer;
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Add table
Add a link
Reference in a new issue