Move libcds 1.6.0 from SVN
[libcds.git] / cds / container / details / guarded_ptr_cast.h
1 //$$CDS-header$$
2
3 #ifndef __CDS_CONTAINER_DETAILS_GUARDED_PTR_CAST_H
4 #define __CDS_CONTAINER_DETAILS_GUARDED_PTR_CAST_H
5 //@cond
6
7 #include <cds/details/defs.h>
8
9 namespace cds { namespace container { namespace details {
10
11     template <typename Node, typename T>
12     struct guarded_ptr_cast_set {
13         T * operator()(Node* pNode ) const CDS_NOEXCEPT
14         {
15             return &(pNode->m_Value);
16         }
17     };
18
19     template <typename Node, typename T>
20     struct guarded_ptr_cast_map {
21         T * operator()(Node* pNode ) const CDS_NOEXCEPT
22         {
23             return &(pNode->m_Data);
24         }
25     };
26
27 }}} // namespace cds::container::details
28
29 //@endcond
30 #endif // #ifndef __CDS_CONTAINER_DETAILS_GUARDED_PTR_CAST_H