-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_ref.h
More file actions
64 lines (48 loc) · 1000 Bytes
/
_ref.h
File metadata and controls
64 lines (48 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef __REF_H__
#define __REF_H__
// Copyright David Lawrence Bien 1997 - 2021.
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
// https://www.boost.org/LICENSE_1_0.txt).
// _ref.h
// reference container
__BIENUTIL_BEGIN_NAMESPACE
template < class t_Ty >
class _ref
{
private:
typedef _ref< t_Ty > _TyThis;
protected:
t_Ty & m_r;
public:
_ref( t_Ty & _r ) // implicit
: m_r( _r )
{
}
_ref( _TyThis const & _r ) // implicit
: m_r( _r.m_r )
{
}
t_Ty & Ref() const
{
return m_r;
}
operator t_Ty & () const
{
return m_r;
}
bool operator == ( _TyThis const & _r ) const
{
return m_r == _r.m_r;
}
bool operator < ( _TyThis const & _r ) const
{
return m_r < _r.m_r;
}
t_Ty * operator -> () const
{
return &m_r;
}
};
__BIENUTIL_END_NAMESPACE
#endif //__REF_H__